If I attach a hard drive to the system, and I want the system to recognize this device as a /dev/sde device rather than the default /dev/sdb. How should I do that?
Thanks.
If I attach a hard drive to the system, and I want the system to recognize this device as a /dev/sde device rather than the default /dev/sdb. How should I do that?
Thanks.
Actually, there is a way to do this: it involves udev, and it is the simplest possible use of its rules.
Create a file /etc/udev/rules.d/10-local.rules and insert into it this single line:
KERNEL=="sd?1", NAME="my_hdd1"
This rule simply takes anything which would be called sda1, or sdb1, or sdc1,... and renames it to a name of your choice, in this case `my_hdd1'. The device node will appear at
/dev/my_hdd1
If you wish you can do this with devices, not with partitions, whichever you like best:
KERNEL=="sd?", NAME="my_hdd"
The above rules will be applied to the first disk to be discovered, which is normally the root disk, /dev/sda. If you prefer to continue calling this disk /dev/sda, but you wish to apply this rule to all other disks, then these rules become:
KERNEL=="sd[b-z]", NAME="my_hdd"
KERNEL=="sd[b-z]1", NAME="my_hdd1"
again as per your wishes.
Restart udev, or reboot, and that's it.
Unfortunately, the order of the drive under the /dev/sdX naming scheme are created based on the bus (bus-based naming). That is why "persistent naming methods" are very helpful, as they uniquely identify any given device on any number of occasions.
There are four schemes for persistent naming:
Here is a good source about Persistent block device naming
As I said in my comment, if you provide a why, you may get better answers that actually deal with your root issue instead of simply wanting things to be mounted in different places, there's few times you need to actually use the /dev/sdX identifier.