0

I have a database backup script which does a mysqldump and copies the dump to an external hard drive with an XFS partition on it. Unfortunately partway through the copy, the drive dismounts and the device changes from say /dev/sdc to /dev/sdd. /dev/sdc1 will still be mounted, but the folder where it is mounted is not accessible. I unmount the drive and that's when the /dev/sdd (or whatever drive it decides to be) shows up. I mount that and it works just fine.

The dmesg output for when the backup script is running looks like this:

[328722.136119] usb 2-1: USB disconnect, address 69
[328722.172828] xfs_force_shutdown(sdc1,0x1) called from line 335 of file /build/buildd/linux-2.6.32/fs/xfs/xfs_rw.c.  Return address = 0xffffffffa030f9d3
[328722.172845] Filesystem "sdc1": I/O Error Detected.  Shutting down filesystem: sdc1
[328722.181694] Please umount the filesystem, and rectify the problem(s)
[328722.186817] xfs_force_shutdown(sdc1,0x1) called from line 335 of file /build/buildd/linux-2.6.32/fs/xfs/xfs_rw.c.  Return address = 0xffffffffa030f9d3
[328722.172845] Filesystem "sdc1": I/O Error Detected.  Shutting down filesystem : sdc1
[328722.181694] Please umount the filesystem, and rectify the problem(s)
[328722.186817] xfs_force_shutdown(sdc1,0x1) called from line 335 of file /build/buildd/linux-2.6.32/fs/xfs/xfs_rw.c.  Return address = 0xffffffffa030f9d3
[328734.520107] usb 2-1: new high speed USB device using ehci_hcd and address 70
[328734.675122] usb 2-1: configuration #1 chosen from 1 choice
[328734.675493] scsi322 : SCSI emulation for USB Mass Storage devices
[328734.675693] usb-storage: device found at 70
[328734.675697] usb-storage: waiting for device to settle before scanning
[328739.670293] usb-storage: device scan complete
[328739.672217] scsi 322:0:0:0: Direct-Access     Seagate  Desktop          0130

PQ: 0 ANSI: 4

I've ran some filesystem checks on the disk, it seems to come out ok. I've used the disk for other things as well and it also works. It seems like this happens every time I run the backup script.

Kamil Kisiel
  • 12,184
  • 7
  • 48
  • 69
robbrit
  • 363
  • 4
  • 8

1 Answers1

1

Well, it says in your logs: USB disconnect. Could be a loose cable/connector or maybe ovecurrent on USB port if your backup script causes a lot of activity.

If you want to be absolutely sure it's not filesystem-type related you could re-format the external drive and see how it behaves with ext4/3, NTFS or VFAT.

Paweł Brodacki
  • 6,511
  • 20
  • 23
  • Seems like an over-current might have been an issue, but I'm not sure. I tweaked the backup script to generate a much smaller file (60mb vs. 800mb) and it seems to work well now. I guess the drive would just die while trying to copy over a huge file. – robbrit May 06 '11 at 15:29
  • @robbrit If you are backing up to a suspicious drive you are risking your data. I'd recommend dumping/RMAing the drive, or changing its purpose (to carry some less critical stuff) and grabbing a less problematic one for backups. At the very least I would be doing md5sum of the backup file on the system and on the USB drive to have better chance to get my data back should I ever need to restore it. – Paweł Brodacki May 06 '11 at 17:02