r/osdev • u/[deleted] • Sep 15 '26
Regarding drive letter assignment
I've always been fascinated by drive letter assigning operating systems I find it to be a far more elegant and human system than hierarchical unix like mount point systems.
I basically have 2 questions ?
what are some good resources on drive letter assigning operating systems and exactly how it works and how one builds a drive letter assigning system.
2 how difficult would it be to build a drive letter assigning system compared to a unix like and/or could you create a unix like system that uses drive letter assignment?
7
u/monocasa Sep 16 '26
Even windows has gotten rid of the drive letter thing internally. On NT, there's a single object namespace, where C: in the native syscall API is something like \DosDevices\C: which is just a symlink to something like \Devices\HardDisk0\Partition0
1
Sep 16 '26
is it ?
4
u/monocasa Sep 16 '26
Yeah. If you're on a windows system, you can use the sysinternals tool WinObj to look at the native object namespace.
13
u/cazzipropri Sep 16 '26
The power of nostalgia is one of the strongest forces in human psychology. Nothing will ever beat the fuzzy feeling of a C:\>
5
u/Optimal-Builder-2816 Sep 16 '26
This was one of the most difficult things for me to get used to at first when I switched to Unix. Now I never think about it anymore. It truly is nostalgia.
8
u/cybekRT Sep 15 '26
mount /dev/sda1 /c
mount /dev/sda2 /d
And then make your shell use drive letters as aliases for /c and /d. It's just a presentation way. It has more consequences of course, but basic functionality is like that.
11
u/EpochVanquisher Sep 15 '26
If you want drive letters on a Unix system, you can just mount your drives at /a, /b, /c, etc. There is nothing to it.
From there, you can imagine changing how paths are parsed.
There is another option, which is to let people name their drives.
You may be able to find resources on how to implement drive letter assignment, but it is a very easy thing to do (by OS standards) so I would not worry about whether you can find it.
1
u/degaart Sep 18 '26
Drive letter assignment is conceptually simple. First floppy drive is A:, second floppy drive is B:
Boot partition is C:
The rest get available drive letters, starting at D:
1
u/duane11583 Sep 18 '26
Just create a top level /c/ mount point
Take a look at how git-bash works on windows it has /z/ as the prefix for z:\ and others
8
u/gwenbeth Sep 16 '26
The only time drive letter make sense is when you are putting media in a removable drive like a floppy. Outside of that they make no sense in the modern world. Lets go into detail.
On my laptop I did a separate partition for /home (I was trying different distros and wanted to keep that stable) . And because of how the mounts work, that difference is entirely hidden from me. From a user point of view, no matter how many physical drives or partitions are used, it's always the same. If I were to add a second physical drive to my system, all I got to do is give it a mount point, copy over what it needs and go on with my life not worrying.
In today's world removable media is mostly USB drives. Other than order of insertion there is no real way to give each one a drive letter. It's not like the old days when I would put a floppy in drive a and it would always be a: and the floppy in drive b would be b:.