Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have several block volumes in /dev like /dev/sds. These block volumes are located on a SAN device. Every time I restart my Ubuntu server, the device names change.

I was wondering if there is any way to fix the device names (e.g. "sds") for these devices ?

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

There is a built in solution. Use the /dev/disk/by-id link, for example -

$ ls -l /dev/disk/by-id | grep sda
lrwxrwxrwx 1 root root  9 Mar 11 21:56 ata-ST95005620AS_5YX07EY0 -> ../../sda
lrwxrwxrwx 1 root root 10 Mar 11 21:56 ata-ST95005620AS_5YX07EY0-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Mar 11 21:56 ata-ST95005620AS_5YX07EY0-part2 -> ../../sda2
lrwxrwxrwx 1 root root 10 Mar 11 21:56 ata-ST95005620AS_5YX07EY0-part5 -> ../../sda5

That output means /dev/disk/by-id/ata-ST95005620AS_5YX07EY0 will always be the drive that is currently "/dev/sda".

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.