0

I'm in the process of moving /home to a new partition. I have copied the old /home to the new partition (with cp -rp). Next step is to modify /ect/fstab and reboot. However, if something goes wrong I wouldn't be able to log in and repair, I guess..

My current /etc/fstab:

UUID=7132fbfe-7a91-4965-b5f4-cb65fd65558f /     ext4    errors=remount-ro   0 1
UUID=D273-8E7E  /boot/efi       vfat    umask=0077                          0 1
/swapfile 

Here are the block IDs:

$ sudo blkid /dev/sda4
/dev/sda4: UUID="7132fbfe-7a91-4965-b5f4-cb65fd65558f" TYPE="ext4" PARTUUID="075222a8-d450-48c7-9e94-861fe5d4eed0"

$ sudo blkid /dev/sda5
/dev/sda5: UUID="1b4ad4ea-83b8-4dd7-b94e-2cfc04ef1c3f" TYPE="ext4" PARTUUID="ed59a38f-1f34-c441-82fc-f578bcd700a3"

Here the partition table:

Device          Start        End    Sectors   Size Type
/dev/sda1        2048    1026047    1024000   500M EFI System
/dev/sda2     1026048    1288191     262144   128M Microsoft reserved
/dev/sda3     1288192  439164927  437876736 208.8G Microsoft basic data
/dev/sda4   439164928  634476543  195311616  93.1G Linux filesystem
/dev/sda5   634476544 1959163903 1324687360 631.7G Linux filesystem
/dev/sda6  1959163904 1975164927   16001024   7.6G Linux swap
/dev/sda7  1976086528 2000408575   24322048  11.6G Windows recovery environment

Proposed new /etc/fstab:

UUID=7132fbfe-7a91-4965-b5f4-cb65fd65558f /      ext4   errors=remount-ro 0 1
UUID=1b4ad4ea-83b8-4dd7-b94e-2cfc04ef1c3f /home  ext4   defaults          0 2
UUID=D273-8E7E  /boot/efi       vfat    umask=0077      0       1
/swapfile 

But, what about the /home directory in sda4? When do I remove this? I am currently executing these steps logged in as a "user" using sudo. Should I log out as a user and proceed in a different run level?

What precautions can I take to make this step as safe as possible?

3
  • 1
    I'll probably login as root in a tty for this, regardless of whether it is strictly necessary. Or at least su - / sudo -i. Especially when you want to delete everything in /home/ of the / filesystem.
    – Tom Yan
    Commented May 5, 2021 at 17:30
  • The most important precaution is to make a full disk image and verify it! Then it does no matter what goes wrong, since you can restore that image. Used dd or alternatives. cyberciti.biz/open-source/… Commented May 5, 2021 at 22:05
  • Actually he can confirm that the new home works and then unmount and remove stuff in the old home as root and remount the new home. Full disk clone is like super overkill.
    – Tom Yan
    Commented May 6, 2021 at 5:14

0

You must log in to answer this question.

Browse other questions tagged .