Moving partitions 2019-04-21 Moving partitions between different disks or devices. For example: moving /home into a bigger hard-drive. First move the files. You'll need higher privilege to keep the permission settings. $ cp -av [source] [dest] Or with rsync (won't copy files you already have copied), generally faster. $ rsync -aHAXv [source] [dest] Carefully with trailing slashes, rsync uses BSD convention whilst cp uses GNU convention. That's it, if the copy (backup) was all you wanted. Now we need our new partition to be mounted instead of the old one. We'll achieve that by modifying the /etc/fstab file, which tells the system where which partitions should be mounted at boot time. That is, assuming your partition isn't encrypted. Then it's a whole different story and you probably already know best whether you should tinker with /etc/fstab or rather /etc/crypttab. Let's have a look at our fstab first. /etc/fstab entry consists of device name or UUID, mountpoint, filesystem type, then options, dump value and pass value. Dump value determines how often the partition should be backed-up by the "dump" program, which we don't use, really. Keep that 0. Pass value is "a number indicating the order in which the fsck program will check the devices for errors at boot time; this is 1 for the root file system and either 2 (meaning check after root) or 0 (do not check) for all other devices." ( https://en.wikipedia.org/wiki/Fstab ) This file is very important so back it up before modifying. $ cp /etc/fstab /etc/fstab.old All we have to do now is modify the proper entry. To obtain necessary information: $ lsblk -o NAME,SIZE,LABEL,UUID,MOUNTPOINT,FSTYPE Now simply edit the fstab - that's the easiest way. You could leverage genfstab utility, but that would require additional effort. It's a good practice to leave a comment with partition name and label just above the entry. Example:
# /dev/sda2 LABEL=home
UUID=2d32c55e-942f-4b45-8694-07029f2583f6	/home		btrfs		defaults	0 2
That's it, you're done. Now reboot and if everything is working - you can delete the /etc/fstab.old backup file.