TransWikia.com

How to replace non-boot hard drive without reinstalling my operating system?

Ask Ubuntu Asked on December 23, 2021

I have an HDD and an SSD on my laptop. My HDD has a very high value of reallocated sector count (~10k) and it’s likely i’m going to have to replace it soon. I had dual-booted Windows and Ubuntu and I do not want to reinstall them all over again.

My boot partitions are entirely located in the SSD. Only Ubuntu /home and Windows drives (all except C:/) are placed in the hdd. I am planning to do the following:

  1. "unallocate" the hdd partitions from both Windows and Ubuntu (i.e., make them visible as "free space")
  2. Create a makeshift /home in the ssd, so that ubuntu still boots (is that even necessary though?)
  3. Get the hdd replaced
  4. Reallocate all the free space to both Ubuntu and Windows as required

Will this approach work? Or is there a simpler approach?


System information:

  • Ubuntu 20.04 (Linux gt 5.4.0-42-generic #46-Ubuntu SMP Fri Jul 10 00:24:02 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux)
  • Windows 10 (will install all pending updates when I boot into it)
  • 1TB hdd mounted on /dev/sda TOSHIBA MQ04ABF100 (JU001C)
  • 120GB ssd mounted on /dev/sdb WDC WDS120G2G0B-00EPW0 (UI450000)

One Answer

Your plan sounds good, except where I would copy the existing home to a /home folder on the SSD. You may limit this to just the user configuration data, and the user folders "Documents", "Music" etc. without any files in them if space is an issue. Removing the entry in /etc/fstab for your separate home would then automatically bring you on the copy. The system will boot, and you can then allocate the other data how you see fit.

A way how to go from a separate home partition to a home partition on the root partition is outlined in detail here: Move separate /home partition to the default configuration /home folder.

When you have the new drive

Once you have a new drive, you could reverse the proces, i.e., create a separate home partition again. However, if space on your SSD permits, you could also opt to leave the user configuration data on the SSD and symlink the user folders containing the user's files to the new drive. The latter is much easier to do, and boils down to the same experience for the user.

Answered by vanadium on December 23, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP