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.

  • confusedpuppy@lemmy.dbzer0.com
    link
    fedilink
    arrow-up
    2
    ·
    8 hours ago

    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: --delete will 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 --exclude option to exclude the problem folder.

    • sbird@sopuli.xyzOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      8 hours ago

      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

      • bleistift2@sopuli.xyz
        link
        fedilink
        English
        arrow-up
        4
        ·
        8 hours ago

        You can store the output of rsync in a file by using rsync 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.

        • sbird@sopuli.xyzOP
          link
          fedilink
          English
          arrow-up
          2
          ·
          8 hours ago

          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?

          • bleistift2@sopuli.xyz
            link
            fedilink
            English
            arrow-up
            2
            ·
            8 hours ago

            You checked 385GiB of files by hand? Is that size made up by a few humongously large files?

            I suggest using uniq to 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 called rsync-output.txt, do sort rsync-output.txt | uniq -dc. This will print the duplicates and the number of their occurrences.

            • sbird@sopuli.xyzOP
              link
              fedilink
              English
              arrow-up
              0
              ·
              8 hours ago

              when using uniq nothing is printed (I’m assuming that means no duplicates?)

              • bleistift2@sopuli.xyz
                link
                fedilink
                English
                arrow-up
                2
                ·
                8 hours ago

                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.

                • sbird@sopuli.xyzOP
                  link
                  fedilink
                  English
                  arrow-up
                  1
                  ·
                  7 hours ago

                  running du command with --count-links as suggested by another user returns 384G (so that isn’t the problem it seems)

                  • bleistift2@sopuli.xyz
                    link
                    fedilink
                    arrow-up
                    1
                    ·
                    7 hours ago

                    du --count-links only 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 -> ./foo
                    

                    If 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.

          • confusedpuppy@lemmy.dbzer0.com
            link
            fedilink
            arrow-up
            2
            ·
            8 hours ago

            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.

      • confusedpuppy@lemmy.dbzer0.com
        link
        fedilink
        arrow-up
        1
        ·
        8 hours ago

        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.