I want to backup my home
directory to an external SSD drive using rsync
.
I'm on Arch Linux. My home is ext4
(251G), the SSD is NTFS-3G
mounted as fuseblk
(512G).
The exact rsync
invocation is:
rsync -aSh --info=progress2 --delete --exclude=/me/.cache /home/me /run/media/me/Samsung_T5/
Eventually, it fails with this being its last words:
218.76G 99% 25.08MB/s 2:18:36 (xfr#2093188, ir-chk=1368/2286507)
rsync: write failed on "/run/media/me/Samsung_T5/me/a_file": No space left on device (28)
So, rsync
allegedly copied around 218G of data and couldn't go furhter due to my SSD being full.
When I ask du
how much data is there on my SSD rsync
destination, it says 466G.
$ du -hs /run/media/me/Samsung_T5/me
466G /run/media/me/Samsung_T5/me
This is weird. rsync
tried to copy 281G, but it copied 218G and failed because it actually copied 466G.
What am I getting wrong here?
I do know that NTFS
and ext4
are different. But are they different enough to make my files more than 2x larger?
Am I copying more than I actually have in my home
?
What would be the correct rsync
procedure to back up my ~280G home
to my SSD as something comparable in size with my home
?
UPDATE [Thanks to the comments below]:
I have a large number of small files in my source directory and a certain amount of sparse files. For example, there is a file 4K big in the source and 128K big in the destination. There is also a sparse file that is 12K in the source and 128K in the destination.
Also, I do have 244 hard links to different executables (e.g., shared libraries). Some of those hard links point to some relatively large files. For example, a version of binutils
linker (ld
) is around 7M and I have 4 hard links to it.
tar
archive file. This way the ownership and permissions will be saved and can be restored when extracted into a linux file system. And the small files and sparse files should not occupy too much space. -- If you still want to usersync
, you had better copy into a linux file system, e.g. 'ext4`. This way it should work to copy hard links, small files and sparse files in a correct way and avoid that the backup size is bigger than the soulrce. – sudodus Nov 4 '19 at 23:33home
. Is there a technique to build tarballs incrementally (asrsync
syncs only changed files)? – foki Nov 5 '19 at 14:30duplicity
and its gui deja-dup. It does incremental backups using tar files, optionally encrypted, optionally to a remote server. – meuh Nov 5 '19 at 14:45--listed-incremental=snapshot-file
– sudodus Nov 5 '19 at 15:30