Score:0

Moving /home to another disk, which already contains some data, without erasing it

in flag

I have the /home folder on the same disk as the root, and I was planning to move it to another SSD drive ("ssd1" in the picture), which is already connected and containing some data:

folder structure

I checked the devices info with lsblk, and I got:

sda           8:0    0   1,8T  0 disk /media/sda1
nvme1n1     259:0    0   477G  0 disk 
├─nvme1n1p1 259:1    0   512M  0 part /boot/efi
├─nvme1n1p2 259:2    0     1K  0 part 
└─nvme1n1p5 259:3    0 476,4G  0 part /
nvme0n1     259:4    0   1,9T  0 disk 
└─nvme0n1p1 259:5    0   1,9T  0 part /media/ssd1

So, I was planning to do the following:

  • Make a backup of the original home folder:
sudo mv /home /home_orig    
sudo mkdir /home
  • unmount the partition on the SSD disk from where it is now (/media) and mount it to the new /home folder:
sudo umount /dev/nvme0n1p1
sudo mount /dev/nvme0n1p1 /home
  • finally, make a backup of the original fstab file, and modify it this way:
sudo cp /etc/fstab /etc/fstab_orig
sudo nano /etc/fstab
UUID=<>    /home    ext4    defaults   0  2

Is this the correct procedure? I checked this link and this other answer, but the situation seems slightly different than mine...mostly, I'm worried about potentially deleting the data already present on ssd1.

oldfred avatar
cn flag
Details: To move /home uses rsync- Be sure to use parameters to preserve ownership & permissions https://help.ubuntu.com/community/Partitioning/Home/Moving Looks similar but details matter. You also can use data partition and link some or all folders back into /home. https://askubuntu.com/questions/1013677/storing-data-on-second-hdd-mounting & https://askubuntu.com/questions/1058756/installing-all-applications-on-a-ssd-disk-and-putting-all-files-on-hdd-disk
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.