nested labels
Adam Martin
adamartin at FreeBSD.org
Tue Sep 26 12:31:33 PDT 2006
Jeffery,
On 2006 Sep 23 , at 16:15, J65nko wrote:
> On 9/21/06, Jeffrey Katz <off at panix.com> wrote:
>> I have hit the limit of 8 disklabels per slice. Supposedly, one can
>> create lables within a label, thus overcoming this limit. I googled
>> everything but could only find references to gpt-- nothing about
>> nested
>> labels or partitions. Can anyone detail the steps involved in
>> setting up
>> nested labels or partitions?
There was some previous discussion in this thread about the merits of
multiple partitions, and why one would need so many. I will not delve
into a long discussion on this; suffice it to say that there are many
valid reasons to create more than 8 partitions on one disc, and that
these reasons are usually unique to the site in question. If a system
administrator feels that he needs more division of storage, he likely
has a good reason.
> A slice can have 8 labels, a disk can have 4 slices, so 4 x 8 labels =
> 32 labels
> Deduct from those 32 the reserved "c" and possibly "b" and you still
> have a lot to spare ;)
Although, the above, using PC partitions with nested BSD labels
within, is a viable solution, and can be used safely with sysinstall,
to give you a nice GUI (well, not gui, but menu at least) to work with
the partitions; the biggest problem here, and the reason I stopped
doing this, is that you have to know in advance how many
meta-partitions you want, and what sizes they are. For example, my old
160 GB disc was divided into a 32 GB and a "remainder" PC partition.
Those each had 7 major partitions therein. (You can use partitions a
and b for filesystems. It's just convention that we use a and b for
root and swap.) As this can be done safely, and straightforward from
the sysinstall program, I won't go into details here.
What you can also do is use the bsdlabel(8) program on any slice. In
FreeBSD, geom labels devices very simply, and sensibly. E.G.:
/dev/ad0s1hs2def is a valid device name. Granted it is a very absurd
case, but it illustrates how one can use it. In geom, any PC
partitions are appended as "sN" where N is 1 thru 4 for primary
partitions, and 5 thru (unknown?) for logical partitions. In the case
of bsdlabel (disklabel) partitions, they receive letters a thru h. In
the above example, the primary master disc's first primary partition
has a bsdlabel, which the last partition of it has a PC partition table
within, which has a primary partition in slot two. That nested PC
partition has a BSD partition, with a partition in slot d, which has
more BSD sub-labels. (Need I go on, with this pathological example?)
In summary, you can make bsdlabels, inside of a partition (PC or BSD).
This is done by just running bsdlabel -w on the partition in which you
wish to create the sub-partitions. (bsdlabel -w /dev/ad0s1h, for
example) You can then create unlimited levels of partitions. Remember
that after running bsdlabel -w, you must run bsdlabel -e, to edit the
partition. Do not forget to create filesystems in the partitions
(newfs -UO2 for UFS 2 with softupdates.) As far as conventions, I
prefer to put the "extended" partition into slot a, and set its type to
"unknown." In cases where slot a is taken by a root partition, I use
slot h. I find that sticking to this convention helps keep me
organized when employing this technique.
Regards,
--
Adam David Alan Martin
More information about the freebsd-questions
mailing list