Linux: mount the disk into /home
Table of Contents
1. Step 1: find the filename of disk with sudo fdisk -l
, like /dev/sda
2. Step2: mount the disk to a temporal directory.
mkdir /media/home
mount /dev/sda /media/home
3. Step3: Copy the data in home and backup.
rsync -aXS /home/. /media/home/. mv /home /home_old
4. Step 4: new /home
and mount it.
mkdir /home umount /dev/sda mount /dev/sda /home
5. Step 5: automatically mount for future usage.
sudo vim /etc/fstab
add
/dev/sda /home ext4 defaults 0 2
or
UUID=8da46012-ab9c-434f-a855-2484112fd1a7 /home ext4 nodev,nosuid 0 2