Physical drives (Was: Where is the real /home directory?)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Saturday 26 October 2002 22:41, alex wrote:
> When I installed Debian, I made a 1 GB /home partition in hda6. The
> system works fine but I don't understand why when I look at /home and
> its subdirectories,there's nothing that indicates that hda6 is
> mounted there but mtab and fstab both show it is there. Likewise,
> when I look at hda6, there's
> nothing that shows that it is the /home partition.
Now, that sounds a little like a switchover from the M$ world. No
offence meant. Well, OK, a little perhaps ;-) Also, I don't know what
level of response is expected. I'll try to keep it so that perhaps it
might help someone who is a little lost. So here we go.
It's a totally different philosophy than the M$ world. DOS and Windoze
use the drive structure (partitions) as some kind of first directory
level, which is expressed in drive letters (A:, B:, ..., Z:)
Now, this might work for one or two disk drives (A,B), a single harddisk
(C) and perhaps a CD-ROM or whatever (D). But as soon as you start
splitting up (partitioning) the disk, you're in troble. You're in even
more trouble when you present your system with a new disk because
certain configurations completely overthrow lettering so that parts of
the new disk show up between parts of the old disk. So any software
that uses drive letters would be lost. The later M$ systems use stuff
like "spanning volumes" to overcome this, but it's still there.
To handle this better, and also to handle a cartload of other media,
hotplug et al., Un*x separates the physical devices (accessed via
/dev/hd*, /dev/sd*, /dev/scd*, etc.) from the logical filesystem tree.
You just mount a partition _into_ the directory tree at certain points.
This keeps the whole system more flexible because if you have for
example one IDE drive (primary master) accessed via /dev/hda* and you
add a second drive, the new drive can be seen as /dev/hdb* without
messing up your installation, no matter how weird the partitions are.
If you now needed more space for your /usr tree, you could simply
partition the second drive as needed, mount the target partition
somewhere, copy over the whole stuff from /usr (preserving attributes!)
and then - under certain precautions and after having seriously thought
it through and perhaps asked someone who has done it before
successfully ;-) - erase the original /usr tree and remount the new
disk in its place.
Another reason for the principle is transparency and a more or less
standardized layout. You can mount all kinds of filesystems like ext2,
ext3, minix, FAT16, FAT32, NTFS, ISO9660, and still access them in a
tree with a single root where everything is where it's supposed to be.
And please don't blame me if this makes no sense... it's about 2 a.m.
here, I'm tired and this is just meant as a short explanation! You can
build horrible, nested structures of trees mounted into another up to a
point where no-one including yourself will know how it works anymore.
Planning is still important.
- --
Embedded Linux -- True multitasking!
TWO TOASTS AT THE SAME TIME!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.0 (GNU/Linux)
iD8DBQE9uz4neOF0+zcVdv8RAq1kAKCKA537xjBy0pgrUjKlBDnQ69OlFQCdEcYM
L2omtlIdlP2ojYicJKOrv/k=
=Ig2G
-----END PGP SIGNATURE-----
Reply to: