I have usb disk attached to my linux box (Ubuntu 14.04). When I boot up the PC, the disk is automatically bound to /dev/sdb (and the partition to /dev/sdb1).When I put PC to sleep for some time with rtcwakup command: rtcwake -m standby -s 120after the computer is woken up, my disk gets rebound to /dev/sdc (and partition do /dev/sdc1)... and after another rtcwake to /dev/sdd. Device mapping isn't always changed, but usually it is the case.I tried to follow sugestion in this thread:How to bind USB device under a static name?but it does not seems to work for me. My assumption is that the problem might be with that this is block device and in aforementioned example this is not the case..but that's just a guess.Could you give me a clue how to bind an usb disk to the same device each time computer is woke up?
Mapping of usb device changes afer rtcwakeup
linux;usb;block device
One should never rely on /dev/sd* to be consistent accross reboots, hibernation etc. The letters are assigned in whatever order the kernel modules or user space software is run, and there's no guarantee with respect to that order.However, udev already creates various kinds of symlinks in /dev/disk/, which start with by-. These symlinks remain consistent.Apparently not of all these are updated during a wakeup, but at least the /dev/disk/by-id ones are. Also, the mount is still invalid after wakeup, but remounting these solves the problem.