Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 9 Apr 2001 06:55:50 -0500
From:      Mike Meyer <mwm@mired.org>
To:        Pete French <pfrench@firstcallgroup.co.uk>
Cc:        mike@dad.state.vt.us, stable@freebsd.org
Subject:   Re: Disklabel 101?
Message-ID:  <15057.41798.647179.240704@guru.mired.org>
In-Reply-To: <E14mYoZ-0006LJ-00@dilbert.fcg.co.uk>
References:  <15055.61547.661230.147704@guru.mired.org> <E14mYoZ-0006LJ-00@dilbert.fcg.co.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
Pete French <pfrench@firstcallgroup.co.uk> types:
> > Mike Barton <mike@dad.state.vt.us> types:
> > > Are there any issues with placing swap first on the hard drive? Unless you
> > > insist on filling the drive, it seems to me that this swap arrangement would
> > > result in less stack travel.
> >
> > Not that I know of. In fact, I'm pretty sure that one of my systems
> > has root on s2, with swap on s1, which is earlier on the hard disk.
> It doesnt work on the same disc however. Try and do an install of 4.2
> creating a swap partition, then a root partition and it fails. Or always
> has in my expereince anyway. Its a bit of a nasty gotcha actually because it
> is not obvious what the problem is. I can see that it probably makes sense to
> have root frst then sawp (and they become a and b) so I dont do it that way
> anymore, but its still worth knowing about.

I'm doing it on one disk. Here's pstat -s for swap:

eve# pstat -s
Device          1K-blocks     Used    Avail Capacity  Type
/dev/ad0s2b        135040        0   135040     0%    Interleaved

So I'm swapping on s2. Here's what mount has to say about things:

eve# mount
/dev/ad0s4a on / (ufs, local)
devfs on /dev (devfs, local)
/dev/ad0s4e on /usr (ufs, local, soft-updates)
/dev/ad0s1 on /msdos (msdos, local)
procfs on /proc (procfs, local)

So the Unix file systems are on s4. Here's the fdisk:

The data for partition 1 is:
sysid 11,(DOS or Windows 95 with 32 bit FAT)
    start 63, size 7197057 (3514 Meg), flag 0
        beg: cyl 0/ head 1/ sector 1;
        end: cyl 447/ head 254/ sector 63
The data for partition 2 is:
sysid 165,(FreeBSD/NetBSD/386BSD)
    start 7197120, size 4192965 (2047 Meg), flag 0
        beg: cyl 448/ head 0/ sector 1;
        end: cyl 708/ head 254/ sector 63
The data for partition 3 is:
sysid 131,(Linux filesystem)
    start 11390085, size 4192965 (2047 Meg), flag 0
        beg: cyl 709/ head 0/ sector 1;
        end: cyl 969/ head 254/ sector 63
The data for partition 4 is:
sysid 165,(FreeBSD/NetBSD/386BSD)
    start 15583050, size 4401810 (2149 Meg), flag 80 (active)
        beg: cyl 970/ head 0/ sector 1;
        end: cyl 1023/ head 254/ sector 63

So slice 4 starts well after slice 2 on this disk. In fact, there's a
Linux file system in between them.

I didn't use sysinstall, so that may refuse to do things like this. It
may be that you tried to put root on something other than a, which
causes the boot system to not work. I tried that on this system, then
had to edit the disklabel to make the root partition a. Or it may be
that -current does this but -stable doesn't, as this is a -current
system.

> The order of separate discs is not a problem. We have a Compaq server that
> insists on booting from da1 rather than da0, so I have / on da1, /usr on da0
> and an interleved swap between them. Even in this case, however, I found it
> necessary to put the filesystems first on each disc, followed by the swap
> partitions.

I take it you mean root file systems? The default system layout puts
root first, swap second, /var and then /usr, and has followed that
pattern on pretty much every Unix I've run into - even systems with
logical volume managers which add another layer between the disk and
the file systems.

	<mike
--
Mike Meyer <mwm@mired.org>			http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?15057.41798.647179.240704>