How to move the root partition to hard drive

When installing the OS, I kept the root partition on my SSD and the home partition on my hard disk.
But my laptop has this issue where sometimes the SSD is not detected (but Hard Disk is detected). So I want the move the root partition also to the Hard Disk, so I don’t have to face the issue of not being able to boot/ use my laptop when the SSD fails to work.

Here’s how I’ve setup my partitions. I want to the move the root partition the sda disk.

λ ~/ lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda           8:0    0 931.5G  0 disk
├─sda1        8:1    0 247.9G  0 part
└─sda2        8:2    0   300G  0 part /home
nvme0n1     259:0    0 238.5G  0 disk
├─nvme0n1p1 259:1    0   100M  0 part
├─nvme0n1p2 259:2    0    16M  0 part
├─nvme0n1p3 259:3    0 184.9G  0 part
├─nvme0n1p4 259:4    0   674M  0 part
├─nvme0n1p5 259:5    0   512M  0 part /boot/efi
└─nvme0n1p6 259:6    0  52.3G  0 part /

Personally never have just copied a root system to another drive I’m sure it can be done I’m just not sure how simple since you have to update the boot loader your fstab file and maybe some others

Why not just install onto the desired location? (unplug the SSD) run the installer and choose the new location after install all your configs will be the same since your home is on a separate partition.

I would recommend a migration via clonezilla. It takes care of what @thefrog mentioned under the hood, all by itself. Just used it to migrate a system to a bigger disk, worked without the need for intervention.

I’m confused, won’t the installer create a new home partition? Should I later replace that?

not if you tell the partition part of the installer to use that device as /home with a no format option. However even if you don’t the new home will be created on the newly installed system which can simply be replaced by editing your fstab to point to your device with /home

2 Likes

Can I merge the root and home partitions later? Or can I do this while installation?
Also what is the minimum space I would need to allocate for the root partition alone.

if you are asking if you can add the separate home partition after install the answer is Yes.

Yes when selecting partitions you can choose to use your /home device
make sure to no format the /home device or you will loose all your settings and have to reinstall them from your backup.

I’m not sure of the actual minimal I guess that would depend on how you plan to use your system. I would say a good size for a Linux partition is 25 Gig’s However I personally keep myne around 50 Gig’s

Just make sure you have a really good backup of your home directory before you attempt any of this. :slight_smile:

1 Like

Sorry if I wasn’t clear, currently, the home is on one partition, and I will be installing the root on another now. I want to know if I can unify both, so both home and root are on the same partition.

(Deleted previous post since I replied to the wrong user)

yes you would have to remove the /home partition that is currently there.

Double-check in the BIOS settings you have the SATA controller set to AHCI mode. If you have it set to RAID, or anything else besides AHCI, that can cause this issue.