I am running a Raspberry Pi with Raspbian (a Linux based on Debian Wheezy) as a NAS (Network Attached Storage) with an USB hard drive attached as the only USB device.
The issue I am confronted with is that the external USB hard drive is at /dev/sda
but changes at runtime of the operating system spontaneously to /dev/sdb
without any reason. Then while using it at /dev/sdb
it jumps back to /dev/sda
. It also happens while copying a big bunch of data resulting in I/O errors. Sometimes it takes hours but otherwise it takes minutes for this to happen. – This is really spooky!
Of course I considered the internet for clues before asking here for help. The only interesting thing I found was the following link: Linux: Remember path to USB Device – I followed the described steps and I am posting here the output of the commands,
Command 1: udevadm info -q all -p $(udevadm info -q path -n /dev/sda)
Output 1:
P: /devices/platform/bcm2708_usb/usb1/1-1/1-1.3/1-1.3:1.0/host0/target0:0:0/0:0:0:0/block/sda
N: sda
S: disk/by-id/usb-WDC_WD25_00JS-40NGB2_8DC88D250088-0:0
S: disk/by-path/platform-bcm2708_usb-usb-0:1.3:1.0-scsi-0:0:0:0
E: DEVLINKS=/dev/disk/by-id/usb-WDC_WD25_00JS-40NGB2_8DC88D250088-0:0 /dev/disk/by-path/platform-bcm2708_usb-usb-0:1.3:1.0-scsi-0:0:0:0
E: DEVNAME=/dev/sda
E: DEVPATH=/devices/platform/bcm2708_usb/usb1/1-1/1-1.3/1-1.3:1.0/host0/target0:0:0/0:0:0:0/block/sda
E: DEVTYPE=disk
E: ID_BUS=usb
E: ID_INSTANCE=0:0
E: ID_MODEL=00JS-40NGB2
E: ID_MODEL_ENC=00JS-40NGB2\x20\x20\x20\x20\x20
E: ID_MODEL_ID=2336
E: ID_PART_TABLE_TYPE=dos
E: ID_PATH=platform-bcm2708_usb-usb-0:1.3:1.0-scsi-0:0:0:0
E: ID_PATH_TAG=platform-bcm2708_usb-usb-0_1_3_1_0-scsi-0_0_0_0
E: ID_REVISION=0100
E: ID_SERIAL=WDC_WD25_00JS-40NGB2_8DC88D250088-0:0
E: ID_SERIAL_SHORT=8DC88D250088
E: ID_TYPE=disk
E: ID_USB_DRIVER=usb-storage
E: ID_USB_INTERFACES=:080650:
E: ID_USB_INTERFACE_NUM=00
E: ID_VENDOR=WDC_WD25
E: ID_VENDOR_ENC=WDC\x20WD25
E: ID_VENDOR_ID=152d
E: MAJOR=8
E: MINOR=0
E: SUBSYSTEM=block
E: UDEV_LOG=3
E: UDISKS_ATA_SMART_IS_AVAILABLE=1
E: UDISKS_PARTITION_TABLE=1
E: UDISKS_PARTITION_TABLE_COUNT=1
E: UDISKS_PARTITION_TABLE_SCHEME=mbr
E: UDISKS_PRESENTATION_NOPOLICY=0
E: USEC_INITIALIZED=7853442
Command 2: udevadm info -q all -p $(udevadm info -q path -n /dev/sdb)
Output 2:
P: /devices/platform/bcm2708_usb/usb1/1-1/1-1.3/1-1.3:1.0/host2/target2:0:0/2:0:0:0/block/sdb
N: sdb
S: disk/by-id/usb-WDC_WD25_00JS-40NGB2_8DC88D250088-0:0
S: disk/by-path/platform-bcm2708_usb-usb-0:1.3:1.0-scsi-0:0:0:0
E: DEVLINKS=/dev/disk/by-id/usb-WDC_WD25_00JS-40NGB2_8DC88D250088-0:0 /dev/disk/by-path/platform-bcm2708_usb-usb-0:1.3:1.0-scsi-0:0:0:0
E: DEVNAME=/dev/sdb
E: DEVPATH=/devices/platform/bcm2708_usb/usb1/1-1/1-1.3/1-1.3:1.0/host2/target2:0:0/2:0:0:0/block/sdb
E: DEVTYPE=disk
E: ID_BUS=usb
E: ID_INSTANCE=0:0
E: ID_MODEL=00JS-40NGB2
E: ID_MODEL_ENC=00JS-40NGB2\x20\x20\x20\x20\x20
E: ID_MODEL_ID=2336
E: ID_PART_TABLE_TYPE=dos
E: ID_PATH=platform-bcm2708_usb-usb-0:1.3:1.0-scsi-0:0:0:0
E: ID_PATH_TAG=platform-bcm2708_usb-usb-0_1_3_1_0-scsi-0_0_0_0
E: ID_REVISION=0100
E: ID_SERIAL=WDC_WD25_00JS-40NGB2_8DC88D250088-0:0
E: ID_SERIAL_SHORT=8DC88D250088
E: ID_TYPE=disk
E: ID_USB_DRIVER=usb-storage
E: ID_USB_INTERFACES=:080650:
E: ID_USB_INTERFACE_NUM=00
E: ID_VENDOR=WDC_WD25
E: ID_VENDOR_ENC=WDC\x20WD25
E: ID_VENDOR_ID=152d
E: MAJOR=8
E: MINOR=16
E: SUBSYSTEM=block
E: UDEV_LOG=3
E: UDISKS_ATA_SMART_IS_AVAILABLE=1
E: UDISKS_PARTITION_TABLE=1
E: UDISKS_PARTITION_TABLE_COUNT=1
E: UDISKS_PARTITION_TABLE_SCHEME=mbr
E: UDISKS_PRESENTATION_NOPOLICY=0
E: USEC_INITIALIZED=2425648913
So I tried the trick and added the line BUS=="usb", ATTR{serial}=="WDC_WD25_00JS-40NGB2_8DC88D250088-0:0", NAME="sda"
to the file /etc/udev/rules.d/10-usb-serial
but unfortunately this also did not solve the issue.
I do not know if this is important to mention but the used external USB storage consists of two identical Hard drives of 256 GB of size in a JBOD controlled case. That means that it looks like one hard drive of 512 GB of size for the operating system.
And now I am looking forward to get any help and/or suggestions. – Thanks in advance!
/dev
name of your disk is changing?DEVPATH
andP:
lines are different.