Discussion:
[PLUG] Indecipherable rsync error message
John Jason Jordan
2018-09-29 05:23:52 UTC
Permalink
This is an rsync command that used to work:

rsync -rptog --progress --stats --delete
--exclude-from=/media/jjj/Movies/rsync_exclusions /media/jjj/Movies/ /media/jjj/Synology

This evening it gives me:

rsync: getcwd(): Input/output error (5) rsync error: errors selecting
input/output files, dirs (code 3) at util.c(1056) [Receiver=3.1.1]

Can someone translate that for me?
Russell Senior
2018-09-29 05:27:42 UTC
Permalink
Try adding a slash at the end

On Fri, Sep 28, 2018, 22:26 John Jason Jordan <***@gmx.com> wrote:

> This is an rsync command that used to work:
>
> rsync -rptog --progress --stats --delete
> --exclude-from=/media/jjj/Movies/rsync_exclusions /media/jjj/Movies/
> /media/jjj/Synology
>
> This evening it gives me:
>
> rsync: getcwd(): Input/output error (5) rsync error: errors selecting
> input/output files, dirs (code 3) at util.c(1056) [Receiver=3.1.1]
>
> Can someone translate that for me?
> _______________________________________________
> PLUG mailing list
> ***@pdxlinux.org
> http://lists.pdxlinux.org/mailman/listinfo/plug
>
John Jason Jordan
2018-09-29 05:39:53 UTC
Permalink
On Fri, 28 Sep 2018 22:27:42 -0700
Russell Senior <***@personaltelco.net> dijo:

>Try adding a slash at the end

It always used to work without the slash, but I added one anyway. I
still get the same error message.
John Jason Jordan
2018-09-29 18:01:58 UTC
Permalink
On Fri, 28 Sep 2018 22:39:53 -0700
John Jason Jordan <***@gmx.com> dijo:

Problem solved:

cd ..
cd /media/jjj/Movies

Now the rsync command works as expected, as do other commands.
Tomas K
2018-09-29 21:28:43 UTC
Permalink
It appears that you either did not have the directory mounted or it was
in power saving mode (disks spun down, etc.)

I would recommend that you to either manually make sure that the source
and destinations are both available or setup some wait loop in your
script to allow and trigger mounting.

Ages ago, I wrote/used this simple bash function which waits for disk
to spin up and become available on the file system.

function waitForDir () {
  # waits for directory to not be empty
  local maxWait=30
  local c=0
  if (( $# != 1 )); then
    >&2 echo "ERROR: Please give directory as cmd argument."
    exit 0
  fi
  while (( $(ls $1 | wc -l) == 0 )); do
    if (( $c > $maxWait )); then
      >&2 echo "ERROR: Directory $1 missing content after $maxWait
seconds"
      exit 0
    else
      c=$(( $c + 1 ))
    fi
    sleep 1
  done
}

Then I used it this way:
waitForDir /media/jjj/Movies
Note: that it needs some content to be in the directory.

Best regards, Tomas

On Sat, 2018-09-29 at 11:01 -0700, John Jason Jordan wrote:
> On Fri, 28 Sep 2018 22:39:53 -0700
> John Jason Jordan <***@gmx.com> dijo:
>
> Problem solved:
>
> cd ..
> cd /media/jjj/Movies
>
> Now the rsync command works as expected, as do other commands.
> _______________________________________________
> PLUG mailing list
> ***@pdxlinux.org
> http://lists.pdxlinux.org/mailman/listinfo/plug
John Jason Jordan
2018-09-29 23:16:28 UTC
Permalink
On Sat, 29 Sep 2018 14:28:43 -0700
Tomas K <***@gmail.com> dijo:

>It appears that you either did not have the directory mounted or it was
>in power saving mode (disks spun down, etc.)

The Movies USB device is always mounted, but yes, it seems to go into
sleep mode all the time. Any disk activity brings it out of sleep mode,
although it can take a full minute before it is available. The Synology
is NAS, and it doesn't appear to suffer from being in sleep mode.

Why couldn't I just make a little bash script:

cd ..
cd /media/jjj/Movies
<my rsync command here>

That seems simpler, simple enough that even I understand it. :)

Having said that I suffer from this drive having to refresh itself all
the time. I mean, dozens of times a day I sit here twiddling my thumbs
while I wait and listen to the discs rumble and watch the lights
blink. I use this disk all day long, yet it seems to go into sleep mode
after five minutes of inactivity.
Tomas K
2018-09-30 00:55:59 UTC
Permalink
Try hdparam to control sleep time.

Here is Ubuntu link:
https://askubuntu.com/questions/39760/how-can-i-control-hdd-spin-down-t
ime

If that does not work, and you cannot change your DAS settings, you
might need to look at powertop to check if your USB is not going to
sleep.

Synology NAS have settings to set disk sleep timer. It is a great way
to prolong disk life and reduce heat and noise. By default it is off.

Tomas

On Sat, 2018-09-29 at 16:16 -0700, John Jason Jordan wrote:
> On Sat, 29 Sep 2018 14:28:43 -0700
> Tomas K <***@gmail.com> dijo:
>
> > It appears that you either did not have the directory mounted or it
> > was
> > in power saving mode (disks spun down, etc.)
>
> The Movies USB device is always mounted, but yes, it seems to go into
> sleep mode all the time. Any disk activity brings it out of sleep
> mode,
> although it can take a full minute before it is available. The
> Synology
> is NAS, and it doesn't appear to suffer from being in sleep mode.
>
> Why couldn't I just make a little bash script:
>
> cd ..
> cd /media/jjj/Movies
> <my rsync command here>
>
> That seems simpler, simple enough that even I understand it. :)
>
> Having said that I suffer from this drive having to refresh itself
> all
> the time. I mean, dozens of times a day I sit here twiddling my
> thumbs
> while I wait and listen to the discs rumble and watch the lights
> blink. I use this disk all day long, yet it seems to go into sleep
> mode
> after five minutes of inactivity. 
> _______________________________________________
> PLUG mailing list
> ***@pdxlinux.org
> http://lists.pdxlinux.org/mailman/listinfo/plug
John Jason Jordan
2018-09-30 02:26:21 UTC
Permalink
On Sat, 29 Sep 2018 17:55:59 -0700
Tomas K <***@gmail.com> dijo:

>Try hdparam to control sleep time.
>
>Here is Ubuntu link:
>https://askubuntu.com/questions/39760/how-can-i-control-hdd-spin-down-t
>ime
>
>If that does not work, and you cannot change your DAS settings, you
>might need to look at powertop to check if your USB is not going to
>sleep.
>
>Synology NAS have settings to set disk sleep timer. It is a great way
>to prolong disk life and reduce heat and noise. By default it is off.

I looked at the Ubuntu link above, which led me to look at the Disks
utility. The Disks utility has a button to display Standby, Advanced
Power Management, and Write Cache. For my Movies USB they were all set
to OFF.

Then I tried powertop, which I had to install first. It would have told
me more if I had understood the display. The top line seemed to be the
Movies USB drive, and it said:

1.5 ms/s 360.9 Process [usb-storage]

It kept changing, but the above is typical of what it displayed.
David Fleck
2018-09-29 12:28:35 UTC
Permalink
On Fri, 2018-09-28 at 23:34 -0700, wes wrote:
> "getcwd()" is a function that returns the current working
> directory, so I'd start there.

Are you in a valid directory location when running the command?
Jim Garrison
2018-09-29 15:10:32 UTC
Permalink
On 9/28/2018 10:23 PM, John Jason Jordan wrote:
> rsync -rptog --progress --stats --delete
> --exclude-from=/media/jjj/Movies/rsync_exclusions /media/jjj/Movies/ /media/jjj/Synology
>
> rsync: getcwd(): Input/output error (5) rsync error: errors selecting
> input/output files, dirs (code 3) at util.c(1056) [Receiver=3.1.1]

What is in the file /media/jjj/Movies/rsync_exclusions ? Did you make
a change to that file recently? Are all the paths in that file valid?

--
Jim Garrison
John Jason Jordan
2018-09-29 16:14:43 UTC
Permalink
On Fri, 28 Sep 2018 23:34:37 -0700
wes <***@the-wes.com> dijo:

>On Fri, Sep 28, 2018 at 10:26 PM John Jason Jordan <***@gmx.com>
>wrote:

>> rsync: getcwd(): Input/output error (5) rsync error: errors selecting
>> input/output files, dirs (code 3) at util.c(1056) [Receiver=3.1.1]

>I don't know about the numbers, but "input/output error" typically
>means it's having problems reading something from a disk. The fact
>that it's not giving you a sensible error message indicates that it's
>a really unusual problem. "getcwd()" is a function that returns the
>current working directory, so I'd start there. Do the commands
>ls /media/jjj/Movies/ and ls /media/jjj/Synology return normal-looking
>output?

Last night when I first posted the question it was too late for me to
think to add some details:

The 'from' directory is a Mediasonic enclosure containing 14TB
of storage, of which all but 4.5TB is used. The destination is a
Synology NAS with 16TB of storage. They are mounted
at /media/jjj/Movies and /media/jjj/Synology, respectively. There is a
text file 'rsync_exclusions' which lists just 'lost+found.'

Just now I tried 'ls -la' while in /media/jjj/Movies and got the
following error: 'ls: reading directory '.': Input/output error'. So
then I added the path to the command and it worked. And I can drag and
drop, and add or delete files with the GUI (Nautilus, Thunar).

Clearly, the problem is the Mediasonic, and I know part of what is
going on. The Mediasonic has two connectors: USB 3.1 Gen 1 and eSATA,
right next to each other on the back of the case. I always used
the USB connector, but recently it failed, and the enclosure is out of
warranty, so I bought an eSATA cable with an eSATA to USB adapter for
the end that goes into the computer. Perhaps the eSATA jack on the
Mediasonic is now also failing.

But I don't understand why the drive continues to work fine for most
things - as I write this a torrent client is reading files without a
problem, and the GUI file managers also work fine. Last night from the
command line I used ddrescue to write an ISO file to the Mediasonic for
a damaged DVD, which also worked fine. But the ls and rsync commands
still fail. That is a mystery. And what to do about it is also a
mystery.
Loading...