Discussion:
question on udev device naming before root is mounted
David Avery
2014-02-07 02:44:11 UTC
Permalink
Can the device names for hard drives be forced before root is mounted
in so much so that udev rules can force via a device serial number to
be a specific /dev/sdX device name.

Looking at my pci and bios boot order I shouldn't even need to do this
but I think the defaults of udev or the sysfs?? are to move USB
devices to latter drive letters.

I am booting from a USB 16GB flash drive and would prefer the device
be sda but even if I could force it to be sdz, and force my sata
drives to be specific drive letters based on their serial numbers so
that I can create a hotswap raid array and be confident that once my
drives are installed they won't move around to different device names.
I think this information would be useful to a lot of people who have
simply given up in the past, and after weeks I was at the point of
giving up but Greg's email bot has given me one more ounce of juice to
keep trying. I really would prefer to not bother him directly but I
have a sneaking suspicion what I'm trying to accomplish isn't
possible.

I have this thread: http://ubuntuforums.org/showthread.php?t=2202219
on Ubuntuforums.org where I'm trying to find out if this is possible:

I really appreciate any help, and please forgive my demeanor in my
thread on the ubuntuforums page I have a personality that takes an
acquired taste.

If there is any information needed that I haven't provided in the post
at the link above please let me know and I would be happy to provide
it.
--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Greg KH
2014-02-07 03:28:59 UTC
Permalink
Post by David Avery
Can the device names for hard drives be forced before root is mounted
in so much so that udev rules can force via a device serial number to
be a specific /dev/sdX device name.
No you can't, sorry. Please use the persistant names instead, the ones
in /dev/disk/ for this.
Post by David Avery
Looking at my pci and bios boot order I shouldn't even need to do this
but I think the defaults of udev or the sysfs?? are to move USB
devices to latter drive letters.
You don't know what device is going to be discovered first, and they can
be reordered on different boots all the time. Use the /dev/disk/ links
instead.
Post by David Avery
I am booting from a USB 16GB flash drive and would prefer the device
be sda but even if I could force it to be sdz, and force my sata
drives to be specific drive letters based on their serial numbers so
that I can create a hotswap raid array and be confident that once my
drives are installed they won't move around to different device names.
Then use the /dev/disk/ links, that way they can always be confident,
that is what they are there for.

Just ignore the kernel names, they mean nothing, use the /dev/disk/ ones
instead, as they will always be correct.

Hope this helps,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Loading...