I want to replace my old SSD hard drive with a new one that has double the size, but somehow fail to understand how rsync is working.
I read this post Copy entire file system hierarchy from one drive to another.
I never cloned a drive with a running system on it with Linux before.
I partitioned my new hard drive similar to the old one:
**Old drive**
Device Start End Sectors Size Type
/dev/sdc1 a b c 1G EFI System
/dev/sdc2 d e f 64G Linux filesystem
/dev/sdc3 g h i 512M Linux swap
/dev/sdc128 j k l 400.3G BIOS boot
**New drive**
Device Start End Sectors Size Type
/dev/sdd1 a b c 1G EFI System
/dev/sdd2 d e f 64G Linux filesystem
/dev/sdd3 g h i 512M Linux swap
/dev/sdd128 j m n 866G Linux filesystem
I also corrected the partition type mistake I hadn't noticed so far (8300 for /home aka /sev/sdX128 instead of BIOS boot)
I tried sudo mount /dev/sdd128 /mnt/ssd/home next, but since that didn't work (bad file system error), I ran
sudo rsync -avxHAX --info=progress2 --numeric-ids /dev/sdc128 /dev/sdd128
with the result that only a few bytes where copied, but when I mounted the drive with above command again it worked and I could access any file from my home-folder via the mount point, so I figured some kind of symlinks was created with rsync.
I tried to copy over files again with
sudo rsync -avxHAX --info=progress2 --numeric-ids /home /mnt/ssd/home
but what now happened was that /home was being copied to /home/home, so the sdc drive went out of disk space very soon.
I want to avoid using dd with which I am more familiar, since I read this isn't recommended for systems in use.
What are the commands I would really need to duplicate my disk? (I want to unplug the old disk and use the new one without needing to reinstall anything [but maybe GRUB]).
Edit:
Now I noticed I accidently deleted almost my entire /home folder content when using rm -r /home/home (hidden files and folders remain), can someone explain me what exactly happened when I used the commands, and, if possible, also a fast way to undo this?