3

Example of why this might be desired: I connect a block device, which shows up as /dev/sdb, and mount it. Later that device gets removed without being unmounted. The block device is reconnected, but this time given the name /dev/sdc. I unmount /dev/sdb but then want to switch /dev/sdc to be /dev/sdb.

How can I do this from the command line on OpenSUSE 13.1, without using persistent names?

The purpose of the question is for fixing a problematic state, such as the example given, not as a workaround for deliberately doing something incorrectly (such as not unmounting). This is also why persistent names would not be a solution.

  • What distribution (and what version)? – roaima Sep 18 '15 at 13:46
  • @roaima OpenSUSE 13.1 (question updated) – Owen Pauling Sep 18 '15 at 13:51
  • possible duplicate of Mount hard drives in the same order in debian – Celada Sep 18 '15 at 14:02
  • 3
    @OwenPauling I understand. But the sdX names are assigned by the kernel as soon as the device is detected. Creating an alias for sd<something> under <some-persistent-name> is easy and clean. Trying to rename sd<something> to sd<something-else> on the other hand is problematic. What if the device name you want to rename to is already taken? Do you shuffle names around until they fit? And even if you succeed then the kernel and the /dev filesystem will have a different idea of what the name is, which can be confusing when consulting kernel logs. – Celada Sep 18 '15 at 17:38
  • 3
    I'm not sure what the different would be between "move device from /dev/sdc to /dev/sdb" and "rename device from /dev/sdc to /dev/sdb". Also, remember the underlying reason why the kernel chose sdc in the first place instead of sdb. It's because sda and sdb were already taken at the time! – Celada Sep 18 '15 at 20:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.