Subject: Re: HDD partition handling
To: None <port-sparc@NetBSD.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
Date: 07/27/2004 15:10:19
> When I attach a "virgin" HDD to my system (e.g. designated to sd1),
> disklabel it, create one single partition covering the entire disk
> and newfs the "a" partition, I actually have two slices on it:
> /dev/sd1a my partition
> /dev/sd1c the "entire disk" for BSD disklabel
Right. This is normal.
> That's OK so far. But...:
> How comes I can mount both /dev/sd1a and /dev/sd1c and get the same
> results in "df -k" e.g?
Because they both refer to the same piece of the disk, so you get the
same filesystem each time. You could get a similar effect by defining
e and f to both refer to some smaller piece of the disk....
> Shouldn't /dev/sd1c be unmountable, since it is not a _real_
But it _is_ a real partition, as real as any other. (About the only
thing special about it is that it always accesses the whole disk, no
matter what you put in the disklabel for it.)
> How comes I can even mount a and c concurrently?
For the same reason you can mount e and f concurrently: they are
different partitions. (The check is to make sure you don't multiple
mount a partition, not to make sure you don't multiple-mount a given
piece of disk space.)
This actually is useful; I've occasionally wanted the same piece of
disk space mounted in two different places. (Fortunately, when I've
wanted this, I've wanted both mounts to be read-only....)
> What exactly do I really mount when I mount /dev/sda1c?
The same piece of disk you get when you mount sd1a, only under another
name. Type "disklabel sd1" and look at the size and offset values.
/~\ The ASCII der Mouse
\ / Ribbon Campaign
X Against HTML firstname.lastname@example.org
/ \ Email! 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B