Re: 5.1-RELEASE: disklabel/bsdlabel for multi-boot system

2003-09-04 Thread Meow Cat
Matthew,
  Thanks for the prompt reply. I have now solved the
issues that were preventing me from installing
(though I still had to do it manually due to some
limitations in sysinstall) and, once installed, I'm
impressed with the package management and automatic
configuration in FreeBSD.
  So, to answer my own questions, in case others have
the same questions:
1) The 'unit' size in bsdlabel/disklabel is the size of
the individual slice. You can only create BSD-partitions
within that slice, and you can't extend beyond that.
However, you shouldn't need to, as:
2) FreeBSD supports DOS-style extended partitions. I guess
I missed that reading the manual the first time around, 
and
I wasn't expecting it because OpenBSD doesn't support 
these.

3) Although FreeBSD supports DOS-style extended 
partitions,
you can't create (or at least can't access) BSD partitions
within them - for example, you there is no such thing as
/dev/ad0s5e. bsdlabel supports writing a label table, but
it isn't read when devfs is detecting devices.

4) Although FreeBSD supports DOS-style extended 
partitions,
sysinstall's fdisk and label management does not, and so 
the
only way to have a small primary slice containing / and 
/var,
and moving the bulk (/usr) into ad0s5 is to install a 
minimal
environment, then chroot to it, mount the extra 
filesystem,
and run sysinstall in upgrade mode.

5) /etc/fstab accepts TAB as the only white-space. Any 
spaces
result in an "Inappropriate file type or format" error.

I guess most of these problems revolve around your point 
that
extended partitions aren't very popular. Unfortunately, 
I've
already got tons of data in those partitions and was 
unable/
unwilling to shift them around just for the convenience of
the BSD install process.

What I was trying to do before (which worked with OpenBSD,
but then OpenBSD doesn't support DOS-style extended
partitions at all) was to use slice 2 as the BSD slice,
but have it claim ownership of the entire disk, so that 
all
slices and DOS-extended slices were able to be accessed as
though they were a part of slice 2. This doesn't work with
FreeBSD, as bsdlabel expects the slice's label table to
stay within the space allocated to it.

Anyway, thanks again for the help!

__
Find People and Businesses at http://www.SearchBug.com
Innovative Messaging Solutions by GMSI, http://www.gmsi1.com
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: 5.1-RELEASE: disklabel/bsdlabel for multi-boot system

2003-09-04 Thread Matthew Seaman
On Wed, Sep 03, 2003 at 07:54:12PM -0500, Meow Cat wrote:
> Hi,
>   Before starting, I should say that I've RTFM'd, looked 
> in
> the FAQ and the mailing lists, etc. I've seen lots of 
> people
> complaining about similar problems but no answers.
>   I have an existing partition table, and I'd like 
> FreeBSD
> to fit into it with as little damage to the existing OSs 
> as
> possible. The setup I have (as reported by OpenBSD 
> disklabel)
> is:
> 
>   a:   262144   2570404.2BSD 1024  819216
>   b:16384   519184  swap 
>   c:   498015   257040unused0 0  
>   d:   219487   5355684.2BSD 1024  819216
>   e:  4000122  67473634.2BSD 1024  819216
>   i:   256977   63ext2fs 
>   l:  5992245   755055 MSDOS 
>   m: 45351432 10747548 MSDOS 
>   n: 32001417 56099043 MSDOS 
>   o: 32001417 88100523 MSDOS 
> 
> It took me ages to figure out how to achieve this under
> OpenBSD, and then after install I couldn't get X to work.
> So I'm trying FreeBSD - of course bsdlabel only supports
> slices a-h for some reason that is never explained, so I
> have to delete half of the slices. Fine, I do that.
> So with a heavily edited label file I try:
> bsdlabel -R /dev/ad2s0 bsdlabel_file

Unfortunately I don't think you can use an OpenBSD disk label on a
FreeBSD system, or vice-versa.  Seems that the OpenBSD folks have
revamped the way the label data is arranged on the disk, incidentally
giving themselves 16 possible partitions rather than the 8 available
under FreeBSD.
 
> Every slice starts "after end of unit" and "extends beyond
> end of unit." The c slice "doesn't cover entire unit!"
> 
> Okay, I can deal with that, I think - just extend the c
> slice to cover the entire disk, use "bsdlabel -A" (after a
> "bsdlabel -w") to read the disk configuration and edit it
> to ensure that it's not broken, and try again.



If you're trying to support multiple OSes on this one disk, then under
FreeBSD you'ld tend to give FreeBSD a slice of it's own, using
fdisk(8) -- there's a terminology problem here that confuses a lot of
people.  See
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/install-steps.html
particularly 'Example 2.4. Conceptual Model of a Disk' about what
FreeBSD means by 'partitions' and 'slices'.  Under /dev, you'll see a
heirarchy of devices for each drive:

/dev/ad0The whole primary master drive

/dev/ad0s1  The first slice on that drive

Anyhow, within the FreeBSD slice you then create the FreeBSD
partitions using disklabel(8), or as it seems to have mutated into on
5.x-RELEASE, bsdlabel(8).  This gives you devices:

/dev/ad0s1a The root partition
/dev/ad0s1b The swap area
/dev/ad0s1c The whole slice 
/dev/ad0s1d Another partition...

so /dev/ad0s1c and /dev/ad0s1 effectively mean the same thing, which
is a bit redundant.  Unfortunately the concept that "the c partition
is the whole [disk|slice]" is so deeply embedded in the psyche (not to
mention the source code) of the BSD's it isn't going to be changed any
time soon.
 
> I get the same errors. How can the first slice possibly
> begin "after end of unit" and what do I do to fix this?
> How are these "unit"-related numbers calculated? Does
> "unit"===entire-hard-disk? Why does this fail even when
> I make the c slice cover the entire hard disk?

This seems to be a confusion between the (DOS compatible) "Partition
table" as established by fdisk(8) and the (BSD specific) disk label.
If bsdlabel(8) is talking about slices, then something is definitely
wrong with the universe.
 
> Also, I'd like to have the a slice to be a small one
> from the main partition table, and /usr mounted on a
> larger slice within the extended partition table. I
> managed this under OpenBSD with the table above - is
> there a problem (other than the one I mentioned) with
> using this type of table in FreeBSD?

'Extended partitions' are a windows sort of thing, not hugely popular
in FreeBSD.  sysinstall(8) doesn't cope with them very well, but if
you have a pre-existing disk with them on, you can access them from
within FreeBSD as:

/dev/ad0s5

or above.  They tend, however to be used for foreign filesystems
rather than native UFS ones.
 
> Finally, before you tell me to try sysinstall - I tried
> it. I'm sure it has its uses, but the interactive fdisk
> part is unable to understand extended partitions, and
> the interactive disklabel does not allow you to specify
> your own begin/end for slices, either in sectors, or in
> cyl/trk/head. So it's useless for my purposes. The only
> possible use I can see for it is for people who want to
> devote their entire machine to FreeBSD. That's something
> I noticed in OpenBSD also - both OSs seem about 10 years
> behind when it comes to supporting mutli-boot systems :(

Ah, but this whole PC disk layout thing has