feischi
Posts: 7
Joined: Mon May 20, 2013 11:51 am

External USB HDD recognized as duplicate devices

Thu May 23, 2013 8:42 am

Hi,

I am using RPi mainly as an NAS to utilize my several old external HDDs, which are all connected through a powered usb hub. fstab and exportfs are all correctly setup for automount (by uuid) and normally it works well.

However, occasionally a working external HDD could emerge as an extra device, get auto-mounted to the same mounting point, and mess up with the file access. For example, HDD1 is recognized as /dev/sda at the beginning and mounted to /media/hdd1. After some use a new device /dev/sdd emerges and gets mounted to /media/hdd1 automatically. It is the same device as /dev/sda as can be seen in /proc/partitions and fdisk -lu. NAS and other file access to HDD1 all stop working after its mounting and I have to manually umount.

This is observed with both of my HDDs. I am not sure if this is because of my usb hub or something else. But there were two cases I can, with certain success rate, reproduce this problem. First is using transmission to download to HDD1 (WD 500G), after a short time a new device for HDD1 would be automatically added. Second is after plugging and unplugging an external sd card reader to the usb hub, HDD2 (HP 80G) would be recognized as two devices.

But after all, I still don't know what could be the causes of this problem and how to solve it. Following is my fstab for reference. Thanks a lot!

Code: Select all

proc /proc proc defaults 0 0
/dev/mmcblk0p1 /boot vfat defaults 0 2
/dev/mmcblk0p2 / ext4 defaults,noatime 0 1
/var/swapfile	swap	swap	defaults	0	0

#user added auto-mounts
UUID=325220A852207331 /media/wd1-500p1-ntfs ntfs-3g rw,defaults 0 0
UUID=09872A9913DA284D /media/hp1-80p1-ntfs ntfs-3g rw,defaults 0 0
UUID=30b7b966-df79-402e-a3d4-4e5376fabaf0 /media/hp1-80p2-ext3 ext3 rw,users,exec 0 0
#user added bind mounts
/media/hp1-80p1-ntfs /media/nfs-share/HP1-80P1-NTFS none _netdev,bind 0 0
/media/wd1-500p1-ntfs /media/nfs-share/WD1-500P1-NTFS none _netdev,bind 0 0

remsnet
Posts: 151
Joined: Wed Dec 19, 2012 7:32 pm
Location: Planet Gaia
Contact: Website Yahoo Messenger

Re: External USB HDD recognized as duplicate devices

Thu May 23, 2013 10:28 am

please consider using udev rules to gain uniq disk names i.e /dev/sda

feischi
Posts: 7
Joined: Mon May 20, 2013 11:51 am

Re: External USB HDD recognized as duplicate devices

Thu May 23, 2013 9:14 pm

remsnet wrote:please consider using udev rules to gain uniq disk names i.e /dev/sda
Thanks. Yes that's probably what I will do anyway. I will test and see if this solves my problem and if it results in other errors.

M33P
Posts: 199
Joined: Sun Sep 02, 2012 1:14 pm

Re: External USB HDD recognized as duplicate devices

Thu May 23, 2013 9:35 pm

UUID should prevent any sort of duplicate mounting of filesystems.

Can you post a complete dmesg output (and lsusb) over the timespan that incorporates a re-mount event?

If a USB device is reset (it can happen at random sometimes on the Pi, usually power related) then it will be re-enumerated and may be remounted but with broken state (i.e. where another drive is already mounted).

feischi
Posts: 7
Joined: Mon May 20, 2013 11:51 am

Re: External USB HDD recognized as duplicate devices

Fri May 24, 2013 6:32 pm

M33P wrote:UUID should prevent any sort of duplicate mounting of filesystems.

Can you post a complete dmesg output (and lsusb) over the timespan that incorporates a re-mount event?

If a USB device is reset (it can happen at random sometimes on the Pi, usually power related) then it will be re-enumerated and may be remounted but with broken state (i.e. where another drive is already mounted).
Hi M33P,

I reproduced the problem and looks you are right. There are many I/O errors then USB disconnect. When the device reconnects, it's recognized as a new device.

That's what I can see through my non-expert eyes. If you can help me find the exact causes and suggest a solution, it will be greatly appreciated!

Thanks,
Feischi

dmesg:

Code: Select all

[ 1578.533655] sd 0:0:0:0: [sda] Unhandled error code
[ 1578.533683] sd 0:0:0:0: [sda]  
[ 1578.533693] Result: hostbyte=0x07 driverbyte=0x00
[ 1578.533704] sd 0:0:0:0: [sda] CDB: 
[ 1578.533711] cdb[0]=0x2a: 2a 00 07 b6 d0 d0 00 00 f0 00
[ 1578.533743] end_request: I/O error, dev sda, sector 129421520
[ 1578.533758] Buffer I/O error on device sda1, logical block 16177434
[ 1578.533766] lost page write due to I/O error on sda1
[ 1578.533802] Buffer I/O error on device sda1, logical block 16177435
[ 1578.533811] lost page write due to I/O error on sda1
[ 1578.533826] Buffer I/O error on device sda1, logical block 16177436
[ 1578.533834] lost page write due to I/O error on sda1
[ 1578.533847] Buffer I/O error on device sda1, logical block 16177437
[ 1578.533854] lost page write due to I/O error on sda1
[ 1578.533866] Buffer I/O error on device sda1, logical block 16177438
[ 1578.533874] lost page write due to I/O error on sda1
[ 1578.533886] Buffer I/O error on device sda1, logical block 16177439
[ 1578.533894] lost page write due to I/O error on sda1
[ 1578.533906] Buffer I/O error on device sda1, logical block 16177440
[ 1578.533914] lost page write due to I/O error on sda1
[ 1578.533927] Buffer I/O error on device sda1, logical block 16177441
[ 1578.533934] lost page write due to I/O error on sda1
[ 1578.533946] Buffer I/O error on device sda1, logical block 16177442
[ 1578.533954] lost page write due to I/O error on sda1
[ 1578.533966] Buffer I/O error on device sda1, logical block 16177443
[ 1578.533974] lost page write due to I/O error on sda1
[ 1578.633579] sd 0:0:0:0: [sda] Unhandled error code
[ 1578.633606] sd 0:0:0:0: [sda]  
[ 1578.633616] Result: hostbyte=0x07 driverbyte=0x00
[ 1578.633626] sd 0:0:0:0: [sda] CDB: 
[ 1578.633633] cdb[0]=0x2a: 2a 00 07 b6 d1 c0 00 00 40 00
[ 1578.633664] end_request: I/O error, dev sda, sector 129421760
[ 1578.653824] usb 1-1.3.4: USB disconnect, device number 6
[ 1578.673633] sd 0:0:0:0: [sda] Unhandled error code
[ 1578.673661] sd 0:0:0:0: [sda]  
[ 1578.673672] Result: hostbyte=0x01 driverbyte=0x00
[ 1578.673683] sd 0:0:0:0: [sda] CDB: 
[ 1578.673691] cdb[0]=0x2a: 2a 00 07 b6 d6 00 00 00 f0 00
[ 1578.673723] end_request: I/O error, dev sda, sector 129422848
[ 1578.681224] sd 0:0:0:0: [sda] Unhandled error code
[ 1578.681254] sd 0:0:0:0: [sda]  
[ 1578.681264] Result: hostbyte=0x01 driverbyte=0x00
[ 1578.681275] sd 0:0:0:0: [sda] CDB: 
[ 1578.681282] cdb[0]=0x2a: 2a 00 07 b6 d6 f0 00 00 f0 00
[ 1578.681317] end_request: I/O error, dev sda, sector 129423088
[ 1578.998437] sd 0:0:0:0: [sda] Synchronizing SCSI cache
[ 1578.998778] sd 0:0:0:0: [sda]  
[ 1578.998796] Result: hostbyte=0x01 driverbyte=0x00
[ 1582.613863] usb 1-1.3.4: new high-speed USB device number 29 using dwc_otg
[ 1582.715078] usb 1-1.3.4: New USB device found, idVendor=1058, idProduct=070a
[ 1582.715103] usb 1-1.3.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1582.715119] usb 1-1.3.4: Product: My Passport 070A
[ 1582.715130] usb 1-1.3.4: Manufacturer: Western Digital
[ 1582.715141] usb 1-1.3.4: SerialNumber: 575848314133304634313335
[ 1582.718698] usb-storage 1-1.3.4:1.0: Quirks match for vid 1058 pid 070a: 200000
[ 1582.718836] scsi2 : usb-storage 1-1.3.4:1.0
[ 1583.716348] scsi 2:0:0:0: Direct-Access     WD       My Passport 070A 2018 PQ: 0 ANSI: 4
[ 1583.721456] scsi 2:0:0:1: CD-ROM            WD       Virtual CD 070A  2018 PQ: 0 ANSI: 4
[ 1583.723789] sd 2:0:0:0: [sdc] 975400960 512-byte logical blocks: (499 GB/465 GiB)
[ 1583.726304] sd 2:0:0:0: [sdc] Write Protect is off
[ 1583.726335] sd 2:0:0:0: [sdc] Mode Sense: 2b 00 10 08
[ 1583.728176] sr0: scsi3-mmc drive: 51x/51x caddy
[ 1583.728870] sr 2:0:0:1: Attached scsi CD-ROM sr0
[ 1583.730434] sd 2:0:0:0: [sdc] No Caching mode page present
[ 1583.730461] sd 2:0:0:0: [sdc] Assuming drive cache: write back
[ 1583.733213] scsi 2:0:0:2: Enclosure         WD       SES Device       2018 PQ: 0 ANSI: 4
[ 1583.740447] sd 2:0:0:0: [sdc] No Caching mode page present
[ 1583.740477] sd 2:0:0:0: [sdc] Assuming drive cache: write back
[ 1583.784179]  sdc: sdc1
[ 1583.791184] sd 2:0:0:0: [sdc] No Caching mode page present
[ 1583.791212] sd 2:0:0:0: [sdc] Assuming drive cache: write back
[ 1583.791227] sd 2:0:0:0: [sdc] Attached SCSI disk
[ 1616.830068] quiet_error: 88 callbacks suppressed
[ 1616.830092] Buffer I/O error on device sda1, logical block 18358089
[ 1616.830827] Buffer I/O error on device sda1, logical block 18358089
[ 1616.833872] Buffer I/O error on device sda1, logical block 18358089
[ 1623.761950] Buffer I/O error on device sda1, logical block 18358089
[ 1623.766250] Buffer I/O error on device sda1, logical block 18358089
[ 1623.775632] Buffer I/O error on device sda1, logical block 18358089
[ 1623.778935] Buffer I/O error on device sda1, logical block 18358089
[ 1626.213849] Buffer I/O error on device sda1, logical block 17065346
[ 1626.219109] Buffer I/O error on device sda1, logical block 17065346
[ 1627.917881] Buffer I/O error on device sda1, logical block 786483
[ 1627.923368] Buffer I/O error on device sda1, logical block 786483
[ 1630.929805] Buffer I/O error on device sda1, logical block 786450
[ 1630.933080] Buffer I/O error on device sda1, logical block 786449
lsusb:

Code: Select all

Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. 
Bus 001 Device 004: ID 04cc:1521 ST-Ericsson USB 2.0 Hub
Bus 001 Device 028: ID 03f0:110c Hewlett-Packard 
Bus 001 Device 029: ID 1058:070a Western Digital Technologies, Inc. My Passport Essential SE

Return to “Troubleshooting”