LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Rsync errors to USB drive (https://www.linuxquestions.org/questions/linux-server-73/rsync-errors-to-usb-drive-512876/)

jstars 12-22-2006 09:41 AM

Rsync errors to USB drive
 
I run a home linux server. I have an external USB HD (FAT32) attached to it that I am trying to backup some directories to. This USB HD is mounted at start-up in /etc/fstab using the following entry:

Code:

/dev/sdb1 /mnt/usb vfat defaults 1 2
I use the following rsync command:
Code:

rsync -av --delete /var/flexshare/shares/ /mnt/usb/backup/
However I get a lot of errors. Some of them are like this:
Code:

rsync: chown "/mnt/usb/backup/documents/My Pictures/2002/Normandy/Copy of Normandy/.addsc01031.jpg.uJoNs7" failed: Operation not permitted (1)
A lot of the chown errors have strange filenames beginning with a "."

Finally, the rsync fails to complete, issuing these errors:
Code:

rsync: connection unexpectedly closed (449722 bytes received so far) [generator]
rsync error: error in rsync protocol data stream (code 12) at io.c(359)
rsync: connection unexpectedly closed (246188 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(359)

Please note that I have ensured that the USB disk has enough free space. What is the reason for the chown errors and the failure to complete the rsync?

phil.d.g 12-22-2006 09:56 AM

The chown error is due to the FAT32 not supporting Linux file permissions. I suspect the final error is also due to rsync trying to do something that FAT32 doesn't support.

You can either try without the -a switch, this of course means you lose all ownership and file permissions, or, if you only use this drive on Linux systems format the drive to ext3 or some other Linux file system of your choosing

jstars 12-22-2006 10:36 AM

Thanks, I'll try formating as ext3. I wanted to use FAT32 as I wanted the ability to simply plug the USB drive into a windows system to recover the files if my linux server completely failed. However, I note there are some free utilities that allow one to read ext3 from Windows.

jstars 12-22-2006 11:43 AM

I just tried again with the USB drive formatted as ext3. I am still getting errors.

Code:

rsync: writefd_unbuffered failed to write 4 bytes: phase "unknown" [sender]: Broken pipe (32)
rsync: write failed on "/mnt/usb/backup/documents/My Music/NOW That's What I Call Music! 21/Nickelback - 14 - Photograph.mp3": Read-only file system (30)
rsync error: error in file IO (code 11) at receiver.c(305)
documents/My Pictures/2002/
rsync: connection unexpectedly closed (449722 bytes received so far) [generator]
rsync error: error in rsync protocol data stream (code 12) at io.c(359)
rsync: connection unexpectedly closed (12148 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(359)

Could the drive be the problem?

phil.d.g 12-22-2006 12:17 PM

The chown errors are definately because FAT32 doesn't support unix file permissions.

The other errors could indeed because of a bad drive. if you have enough space on your main drive try rsync'ing /home to /home2 see if that throws any errors up

trickykid 12-22-2006 12:17 PM

Seems as if your mounting it as "Read-only file system (30)" which is stated in the error. Remount the device as read-write before trying to write data to it.

jstars 12-23-2006 01:08 AM

I attempted to rsync -a to another directory on the same drive (to /tmp/test) and it worked flawlessly.

Regarding my USB drive, I ran:
Code:

fsck -pcVt ext3 /dev/sdb1
fsck 1.35 (28-Feb-2004)
[/sbin/fsck.ext3 (1) -- /mnt/usb] fsck.ext3 -pc /dev/sdb1
/dev/sdb1: Inode 5685259 has illegal block(s).

/dev/sdb1: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.
        (i.e., without -a or -p options)
[root@gateway tmp]# fsck -cVt ext3 /dev/sdb1
fsck 1.35 (28-Feb-2004)
[/sbin/fsck.ext3 (1) -- /mnt/usb] fsck.ext3 -c /dev/sdb1
e2fsck 1.35 (28-Feb-2004)
Checking for bad blocks (read-only test): done
Pass 1: Checking inodes, blocks, and sizes
Inode 5685259 has illegal block(s).  Clear<y>? yes

Illegal block #5132 (3091629248) in inode 5685259.  CLEARED.
Illegal block #5133 (1244712014) in inode 5685259.  CLEARED.
Illegal block #5134 (2778857784) in inode 5685259.  CLEARED.
Illegal block #5135 (4081630798) in inode 5685259.  CLEARED.
Illegal block #5136 (3004343806) in inode 5685259.  CLEARED.
Illegal block #5137 (3698748904) in inode 5685259.  CLEARED.
Illegal block #5138 (520452500) in inode 5685259.  CLEARED.
Illegal block #5139 (157995145) in inode 5685259.  CLEARED.
Illegal block #5140 (2809637349) in inode 5685259.  CLEARED.
Illegal block #5141 (1370337581) in inode 5685259.  CLEARED.
Illegal block #5142 (2922626401) in inode 5685259.  CLEARED.
Too many illegal blocks in inode 5685259.
Clear inode<y>? yes

There were other inodes that had illegal blocks. What does this mean? Drive kaput?

phil.d.g 12-23-2006 03:42 AM

Possibly. However now that you have run fsck, and it seems to have fixed it then I would try rsync'ing again. I would also try taking the drive out of the enclosure and plugging it directly on the motherboard to find out which has/is failing - the controller or the actual hard drive.

Considering you have only just formatted the drive, it doesn't look very promising.

jstars 12-23-2006 11:35 PM

Quote:

Originally Posted by phil.d.g
Possibly. However now that you have run fsck, and it seems to have fixed it then I would try rsync'ing again. I would also try taking the drive out of the enclosure and plugging it directly on the motherboard to find out which has/is failing - the controller or the actual hard drive.

Considering you have only just formatted the drive, it doesn't look very promising.

I agree, nor does it give me much confidence in the drive which is to be used for backup. The drive is from a four year old HP desktop and is manufactured by a company that isn't well known for hard drives. The fsck ran and I had to fix a number of problems, but after that the rsync ran fine. Good call on isolating the controller or drive problem. I wouldn't have thought of that.


All times are GMT -5. The time now is 05:10 PM.