When running
rsync -Paz /home/sbird "/run/media/sbird/My Passport/sbird"
As told by someone, I run into a ran out of storage error midway. Why is this? My disk usage is about 385 GiB for my home folder, and there is at least 800 GiB of space in the external SSD (which already has stuff like photos and documents). Does rsync make doubly copies of it or something? That would be kind of silly. Or is it some other issue?
Note that the SSD is from a reputable brand (Western Digital) so it is unlikely that it is reporting a fake amount of storage.


There might be a possibility that recursion is happening and a directory is looping into itself and filling up your storage.
I have some suggestions for your command to help make a more consistent experience with rsync.
1:
--dry-run(-n) is great for troubleshooting issues. It performs a fake transfer so you can sort issues before moving any data. Remove this option when you are confident about making changes.2:
--verbose --human-readable(-vh) will give you visual feedback so you can see what is happening. Combine this with --dry-run so you get a full picture of what rsync will attempt to do before any changes are made.3:
--compress(-z) might not be suitable for this specific job, as I understand, it’s meant to compress data during a file transfer intended over a network. In your commands current state, it’s just adding extra processing power which might not be useful for a connected device.4: If you are transferring directories/folders, I found more consistent behaviour from rsync by adding a trailing slash at the end of a path. For example use “/home/username/folder_name/” and not “/home/username/folder_name”. I’ve run into recursion issues by not using a trailing slash.
Don’t use a trailing slash if you are transferring a single file. That distinction helps me to understand what I’m transferring too.
5:
--deletewill make sure your source folder and destination folder are a 1:1 match. Any files deleted in the source folder will be deleted in the destination folder. If you want to keep any and all added files in your destination folder, this option can be ignored.--archive(-a) and--partial --progress(-P) are both good and don’t need to be changed or removed.If you do happen to be running into a recursion issue that’s filling up your storage, you may need to look into using the
--excludeoption to exclude the problem folder.How do I find which folder is causing problems? When using --verbose and --dry-run, it goes way too fast and the terminal can’t see all of the history
You can store the output of
rsyncin a file by usingrsync ALL_THE_OPTIONS_YOU_USED > rsync-output.txt. This creates a file called rsync-output.txt in your current directory which you can inspect later.This, however means that you won’t see the output right away. You can also use
rsync ALL_THE_OPTIONS_YOU_USED | tee rsync-output.txt, which will both create the file and display the output on your terminal while it is being produced.Having a quick scroll of the output file (neat tip with the > to get a text file, thanks!) nothing immediately jumps out to me. There isn’t any repeated folders or anything like that from a glance. Anything I should look out for?
You checked 385GiB of files by hand? Is that size made up by a few humongously large files?
I suggest using
uniqto check if you have duplicate files in there. (uniq’s input must be sorted first). If you still have the output file from the previous step, and it’s calledrsync-output.txt, dosort rsync-output.txt | uniq -dc. This will print the duplicates and the number of their occurrences.when using uniq nothing is printed (I’m assuming that means no duplicates?)
I’m sorry. I was stupid. If you had duplicates due to a file system loop or symlinks, they would all be under different names. So you wouldn’t be able to find them with this method.
running du command with --count-links as suggested by another user returns 384G (so that isn’t the problem it seems)
du --count-linksonly counts hard-linked files multiple types. I assumed you had a symlink loop that rsync would have tried to unwrap.For instance:
$ ls -l foo -> ./bar bar -> ./fooIf you tried to rsync that, you’d end up with the directories
foo,bar,foo/bar,bar/foo,foo/bar/foo,bar/foo/bar,foo/bar/foo/bar, ad infinitum, in the target directory.Ok then, that makes sense
If you don’t spot any recusion issues, I’d suggest looking for other issues and not spend too much time here. At least now you have some troubleshooting knowledge going forward. Best of luck figuring out the issue.
Does your terminal have a scroll back limit? You may need to change that setting if there is a limit.
That will depend on which terminal you are using and it may have a different name so I can’t really help more with this specific issue. You’ll have to search that up based on the terminal you are using.