Move system directory to other drive

For this example, i'm moving /home directory to another drive:

# enter in rescue mode
systemctl isolate
# Mount the other drive
mount -t ext4 -o sync /dev/sdb1 /mnt
# move all data from /home/ folder to the other drive
# and ensure that all data are written to the disk
mv /home/* /mnt/ && sync
# fetch the uuid of the other drive

then in /etc/fstab, add a line to auto mount the other drive as /home directory

UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx    /home      ext4   auto,nouser,defaults,nodev,relatime     0    0

then reboot and voilà!


Last-Updated: 2022-05-09
Content from gemini://

More info about Gemini protocol