I'm just adding stuff here — other people have already answered better, but I couldn't fit the additional info in comments.
You're operating under a slight (if very common) misconception which makes your life a bit harder than it should be.
‘Drive C:
’ is essentially a CP/M term (CP/M was an 8-bit operating system that DOS heavily, ahem, borrowed from). In the days of floppies, ‘drive’ and ‘filesystem’ were equivalent: either your drive held a floppy disk with exactly one filesystem, or it was unformatted (or empty). Easy to make the link and think the two are synonyms.
In fact, C:
is the first readable partition on the first drive. Drives D:
, E:
, F:
etc are other filesystems on the same disk drive, or on others. An exception is made for removable devices, which you can address with special software (e.g. FORMAT
, FDISK
).
Raw drives weren't exposed to the user directly in DOS, and this tradition remains today. You only ever see the physical drives using special software (or if they're removable devices like DVD drives).
This drive letter → partition paradigm works as a ‘forest’ data structure. Each letter is one separate tree in a group. This is what it looks like:
- Drive 128 (first hard drive — invisible to you)
- Partition 1,
C:
- Files and Folders under
C:\*
- Partition 2,
D:
- Files and Folders under
D:\*
- Drive 129 (second hard drive — also invisible)
- Partition 3,
E:
- Files and Folders under
E:\*
- Drive 2 (some sort of removable medium drive)
- Drive letter
F:
- (if a formatted medium is in the drive) Files and Folders under
F:\*
The Unix filing system operates as a single tree. One partition is the root of the tree (hence the term), and other partitions are mounted (grafted) on ‘mount points’ below that and become parts of the same filing tree. This is a simplified view of what it looks like (note the single root):
- Root filesystem (
/
)
- Shared stuff (
/usr
)
- Local stuff (
/usr/local
)
- Users' home directories (
/usr
)
- More local stuff (
/var
)
- Even more local stuff (
/opt
)
- Mounted devices (
/mnt
— this is where removable devices would go by convention)
To answer your question: a Unix always separates programs and data (doesn't have to, but experience has shown it's a Very Good Idea, and now the directory structure is standardised). It also separates (for computers sharing an installation over the network) network-shared programs and data (under /usr
) and computer*-local* programs and data (under /usr/local
, /var
, /opt
, etc), as well as user programs and data (often under /home
).
You can either choose to ignore the distinctions, or to put some (or all) of these directories in separate filesystems (think ‘drive letters’).
If you want to be able to reinstall a Unix and keep your own files, you ensure that /home
is mounted as a separate filesystem (separate partition), and instruct the new OS installer not to touch that partition while installing.
We also use the same trick to make our home directories available to multiple distributions of Linux on the same computer (if, e.g., we're testing them out), or to altogether different Unices. I once ran OpenBSD, FreeBSD and Linux on the same disk, with the same /home
filesystem shared between all three.
C:
isn't a drive, it's a filesystem on a drive — the Linux equivalent would be, e.g.,/dev/sda1
. The drive is/dev/sda
, but DOS-based OSs have no concept of a the raw, unpartitioned drive as a device (outside of the APIs). In the BIOS ‘API’ they're numbered, not lettered. 0x80 (128) is the first hard drive in BIOS-speak.C:
is the first readable filesystem on drive 0x80, and so on. Note: on post-NT Windows, things are very different under the hood. – Alexios Mar 26 '12 at 13:54C:\
on Windows though most people unfortunately don't know and can't make the distinction between the 2. – Karlson Mar 26 '12 at 14:00