last day (16 days later) » 

20:30
14
A: What is `/dev/sda0`? Is it a standard thing?

Stephen KittI’m not aware of /dev/sda0 ever being a standard device name, even on other Unix systems. And as far as I can tell, references to sda0 are likely mistakes rather than indications of a custom setup. Even in cases where the devices are named in output, users still confuse the numbers. For example, ...

Yes, see this answer for SATA and PATA.
I believe that the number 0 for a minor partition has been used for the whole disk in the (very old and now almost defunct Major and Minor numbering system that UDEV replaced). Read ibm.com/docs/en/ds8800?topic=host-linux-device-naming
That, of course, is for the way that the scsi driver likes to name its partitions. GRUB might use another naming system (which is close to the one you report in your answer). And, of course, udev has changed all that old system.
@done That’s what my answer says: “base minor” + 0 (not just minor 0 — each block major is used for multiple disks) is used for the whole disk. Note that udev hasn’t replaced the major/minor numbering system; many drivers are still accessed using fixed majors/minors. For example /dev/sda, /dev/sdb, /dev/sdc and /dev/sdd are respectively minors 0, 16, 32, and 48 of major 8.
Yes, udev (if correctly used) has eliminated any limitation of naming (label) of kernel devices. Any reference to Major and Minor numbers is just used to preserve historical ideas. Please read landley.net/kdocs/ols/2003/ols2003-pages-249-257.pdf and the part: Part of the goal for the udev project is to provide a way for users to name devices based on a set of policies.. That is: a dynamic device naming system.
Ah, found (again 20 years later) the reasons why the developer wanted to have an udev (before systemd apropiated it) and read (carefully): 2) udev does not care about the major/minor number schemes.
@done I’m quite familiar with the design goals of udev, thanks. I lived through the first MAKEDEV efforts, then devfs, then udev. Instead of assuming I’m some clueless numpty and insisting I read carefully, please grant me the courtesy of reading my comments carefully, and not adding things I didn’t bring up: “Note that udev hasn’t replaced the major/minor numbering system; many drivers are still accessed using fixed majors/minors.” Nothing about naming.
20:30
This whole question is about naming, Isn't it?
Nowadays, the code that creates a name for a device is UDEV, isn't it?
Let me reverse your previous comment into a question: The only name that a device of major 8 and minor 16 could have is /dev/sdb ? You seem to imply that there is an static relation between some numbers (major and minor) and the name, which isn't so. The relation is dynamic with udev.
@StephenKitt No, I am assuming nothing, and if anything has aggravated you I deeply apologize and assure you that was never (ever) my intention in any of my comments. Having said that: I also have the responsibility to point to errors where I find them. And the facts still remain true.
In the Debian documentation there is a clear description of which devices are still accessed by major/minor numbers: Kernel device drivers can register devices by name rather than major and minor numbers. (from: wiki.debian.org/DevFS)
And this being the Linux kernel and not some amateur project we can be confident that the code matches the docs. :p
@done fair enough, apology accepted. You’re right that the name doesn’t matter — major 8 minor 16 can have any name, or indeed any number of names. That’s true regardless of what sets the name(s); and that’s because drivers and devices are identified by majors/minors, not by name (drivers provide default names, for udev event purposes). But “very old and now almost defunct Major and Minor numbering system that UDEV replaced” is inaccurate: the major/minor numbering system is most definitely still there.
@done if you want code references, see this answer and this one for starting points. The Debian wiki page you linked to describes Richard Gooch’s DevFS, which has been obsolete for years. It is true that device drivers can register by name; but all that means is that their major is dynamically allocated. All the registered drivers on your system can be seen in /proc/devices; they all have major numbers.
@done my point is that major/minor numbers are still at the heart of communications with device drivers in Linux: when you open /dev/foo, the kernel doesn’t look up foo, it looks up the major number of the device (and its type), and talks to the driver registered for that major.
“drivers provide default names, for udev event purposes” — sorry, that’s wrong.
drivers and devices are identified by majors/minors --> probably, as has been the custom for a long time. But that relation is not static nor constant. A scsi drive has a major of 8, doesn't it?. And an USB plugged disk also has a major of 8, does it?. And a disk inside a md (multi-disk) also has a major of 8, does it?. And an LVM virtual hard disk also has a major of 8, again?. How does the kernel apply the same driver (scsi) to completely different hardware elements? By being dynamic.
What is dead is the static concept of device numbering, the system, not the use of major and minor numbers in the kernel (which actually provided such numbers when the device was detected).
Related: Read: superuser.com/a/686785.
@done you’re arguing over things I’m not saying. I wrote “many drivers are still accessed using fixed majors/minors” — many, not all. All (or nearly all) drivers added since it became possible to have dynamic allocations use dynamic allocations (with or without udev). What the SCSI disk driver does has no bearing on what udev can do; all devices handled through major 8 (and a few others) go through the SCSI driver, whether the target is an actual SCSI disk, or a USB floppy drive, or a SATA disk, etc. (However LVM VGs are handled through dm which has a dynamic allocation.)

  last day (16 days later) »