I have a backup box with a single 1TB HDD, with 4 partitions:
<user>@backup:~> lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 931,5G 0 disk
├─sda1 8:1 0 199M 0 part /boot/efi
├─sda2 8:2 0 16,8G 0 part /
├─sda3 8:3 0 910,5G 0 part /home
└─sda4 8:4 0 4G 0 part [SWAP]
<user>@backup:~>
Directory sizes are:
backup:/home # du -sh */
692G Backup/
16G <user>/
16K lost+found/
backup:/home #
I want to clone /root and /home to a 120G SSD but keep the Backup/ folder and files in the HDD and mount it as /home/Backup in the new home partition on the ssd.
Cloning sda1 and sda2 to SSD is trivial, but I can’t clone only part of sd3. I don’t want to copy the 610,5G elsewhere as this would change the time stamps/whatever, and syncthing would need to resync everything again, which takes a long time in this very slow dual-core intel CPU (J1800).
I think the best way obviously would be to create a new empty sda3 /home partition is the SSD and make a full copy of the original /home/ folder, including all hidden and other special files, if any (fifo, links, etc.).
If this is doable, how should I proceed? Is there a backup utility that does this, not leaving anything behind, for specified directories/folders?
I intend to do this from a live utility distro like partition magic, including the /home/user copy and creation of the mount directory under the new /home and adjusting the cloned /etc/fstab before starting the box and re-enabling syncthing.
Thanks