From owner-freebsd-stable@FreeBSD.ORG Sat Feb 28 07:47:28 2009 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF195106564A for ; Sat, 28 Feb 2009 07:47:28 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (chello087206045082.chello.pl [87.206.45.82]) by mx1.freebsd.org (Postfix) with ESMTP id ED6818FC16 for ; Sat, 28 Feb 2009 07:47:27 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id C89B7456AB; Sat, 28 Feb 2009 08:19:17 +0100 (CET) Received: from localhost (chello087206045082.chello.pl [87.206.45.82]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 8615545683; Sat, 28 Feb 2009 08:19:11 +0100 (CET) Date: Sat, 28 Feb 2009 08:19:45 +0100 From: Pawel Jakub Dawidek To: Matthew Dillon Message-ID: <20090228071945.GA2314@garage.freebsd.pl> References: <4E614185-A54E-43B8-8C07-4BA901DE5861@drsns.com> <49A84B63.5080903@delphij.net> <200902280321.n1S3LFxR018622@apollo.backplane.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="EVF5PPMfhYS0aIcm" Content-Disposition: inline In-Reply-To: <200902280321.n1S3LFxR018622@apollo.backplane.com> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 8.0-CURRENT i386 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-2.6 required=3.0 tests=BAYES_00 autolearn=ham version=3.0.4 Cc: freebsd-stable@freebsd.org Subject: Re: ZFS root File System X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Feb 2009 07:47:29 -0000 --EVF5PPMfhYS0aIcm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Feb 27, 2009 at 07:21:15PM -0800, Matthew Dillon wrote: > My experience with one of our people trying to do the same thing=20 > w/ HAMMER... we got it working, but it is not necessarily cleaner. >=20 > I'd rather just boot from a small UFS /boot partition on 'a' (256M > or 512M), followed by swap on 'b', followed by the big-ass root > partition on 'd' using your favorite filesystem. That's what I do on almost all of my company's servers. Except for... > The boot code already pretty much handles this state of affairs, one = only > needs: >=20 > (1) To partition it this way. >=20 > (2) Add line to /boot/loader.conf pointing the kernel at the actual r= oot, > e.g. (in my case): >=20 > vfs.root.mountfrom=3D"hammer:ad6s1d" This is not needed if you have etc/fstab with this one entry on your boot partition. > (3) Adjust sysctl kern.bootfile in e.g. /etc/sysctl.conf. Since the > boot loader thinks the kernel is on / instead of /boot (because > /boot is the root from the point of view of the bootloader), > it might set this to "/kernel" instead of "/boot/kernel". So > you may have to override it to make crash dumps and name lists > work properly. This is also not needed. My boot partition has boot/ and etc/ directories and I mount it under /bootdir. Then I create symlink /boot -> bootdir/boot. > (4) Add a mount for the little /boot partition in /etc/fstab. >=20 > Trying to create one large root on 'a' puts the default spot for swap > on 'b' at the end of the disk instead of near the beginning. The end > of the disk (closer to the spindle) is a bad place for swap. Having > a small /boot partition there instead retains the ordering and puts t= he > swap where it is expected to be. >=20 > # df > Filesystem 1K-blocks Used Avail Capacity Mounted on > /dev/ad6s1d 193888256 1662976 192225280 1% / > /dev/ad6s1a 257998 110896 126464 47% /boot >=20 > -- >=20 > In anycase, if RAID is an issue the loader could always be adjusted to > look for a boot partition on multiple disks. One could then have a /= boot > on two independant disks, or even operate it as a soft-raid-mirror. = It > seems less of an issue these days since someone with that sort of > requirement who isn't already net-booting can just pop in a SSD for > booting which will have approximately the same or better MTBF as the > motherboard electronics. My 'a' (boot) and 'b' (swap) partitions are mirrored using gmirror. For example: puppet:root:~# mount -t ufs,zfs system/root on / (zfs, local, noatime) /dev/mirror/boot on /bootdir (ufs, local, noatime) system/jails on /jails (zfs, local, noatime) system/tmp on /tmp (zfs, local, noatime, nosuid) system/usr on /usr (zfs, local, noatime) system/home on /usr/home (zfs, local, noatime, nosuid) system/home/pjd on /usr/home/pjd (zfs, local, noatime, nosuid) system/usr/obj on /usr/obj (zfs, local, noatime) system/usr/ports on /usr/ports (zfs, local, noatime) system/usr/ports/distfiles on /usr/ports/distfiles (zfs, local, noatime) system/usr/share on /usr/share (zfs, local, noatime) system/usr/src on /usr/src (zfs, local, noatime) system/var/log on /var/log (zfs, local, noatime) system/var/tmp on /var/tmp (zfs, local, noatime, nosuid) puppet:root:~# swapctl -l Device: 1024-blocks Used: /dev/mirror/swap.eli 4194300 0 Some file systems like /tmp, /usr/src, /usr/ports, /usr/share, /var/log and /var/tmp are compressed. --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --EVF5PPMfhYS0aIcm Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFJqOWRForvXbEpPzQRAhgUAKCZobfdx5kPgOklIwIfSoMVuU9u3ACg43R7 kaAjRpkLU+1jQvllOfvGAkk= =Ii52 -----END PGP SIGNATURE----- --EVF5PPMfhYS0aIcm--