From owner-freebsd-current@FreeBSD.ORG Mon Apr 9 15:08:28 2007 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 596D716A400 for ; Mon, 9 Apr 2007 15:08:28 +0000 (UTC) (envelope-from joao.barros@gmail.com) Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.238]) by mx1.freebsd.org (Postfix) with ESMTP id 010FB13C45E for ; Mon, 9 Apr 2007 15:08:27 +0000 (UTC) (envelope-from joao.barros@gmail.com) Received: by wr-out-0506.google.com with SMTP id 50so867599wra for ; Mon, 09 Apr 2007 08:08:27 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=EflwNvC7mMn1iqv80AxiE4MmTtTkpdWbIZiIpPASEJMeFaQslch8lnc3/7wnMWEgtOUU9E0LehhZxZRwU1DOXefcZI846PHR2CV/3Lv1qz7DFl5ABgDQk+/h4BgQzY9danNln8BO5VvU054J+fm3AMmpE3am8dfTotktn6xrD8U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=XEoM+AFcW9Ay2vyjymBCyJk8FBRaPjccsIx2G4j35wjUk9wSh/j6IFlWu6TPopMLOl3edRnCoxO3itguYpHIFn7+XAF1ibAYakS+O2MXDjTqVbhBvTutovX7nal+/92UwC1HdOX4u1VKU6/98Tn6bYEvEt1zQYA862/RUf7Q8d8= Received: by 10.78.203.13 with SMTP id a13mr877261hug.1176131306408; Mon, 09 Apr 2007 08:08:26 -0700 (PDT) Received: by 10.78.188.9 with HTTP; Mon, 9 Apr 2007 08:08:26 -0700 (PDT) Message-ID: <70e8236f0704090808y5d305175wdc3cee5be1a26a9@mail.gmail.com> Date: Mon, 9 Apr 2007 16:08:26 +0100 From: "Joao Barros" To: "Pawel Jakub Dawidek" In-Reply-To: <20070409094319.GB76673@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20070409011723.GB74547@garage.freebsd.pl> <20070409094319.GB76673@garage.freebsd.pl> Cc: freebsd-fs@freebsd.org, freebsd-current@freebsd.org Subject: Re: ZFS: amd64, devd, root file system. X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2007 15:08:28 -0000 I was looking at how Solaris got support for booting off ZFS and the patch to GRUB to support it. Is it feasible for FreeBSD's boot loader? What would be the main issue: technical or licensing? On 4/9/07, Pawel Jakub Dawidek wrote: > On Mon, Apr 09, 2007 at 03:17:23AM +0200, Pawel Jakub Dawidek wrote: > > 3. It is now possible to have root file system on ZFS. You would still > > need UFS for your /boot/ file system. > > Let me explain how this suppose to work. > > You have ad0 disk. Create one slice covering entire disk: > > # fdisk -BI /dev/ad0 > > Initialize BSDlabel: > > # bsdlabel -wB /dev/ad0s1 > > Edit your label and create small (like 256MB-512MB) 'a' partition and > use the rest for 'd' partition: > > # bsdlabel -e /dev/ad0s1 > > 'd' partition will be used for ZFS: > > # zpool create tank ad0s1d > > Create UFS file system on /dev/ad0s1a and copy /boot/ directory in > there: > > # newfs /dev/ad0s1a > # mount /dev/ad0s1a /mnt/tmp > # cp -Rp /boot/* /mnt/tmp/ > > Note that there is no /boot/ directory on ad0s1a yet. This is one of the > two possibilities. You now need to create symlink: > > # cd /mnt/tmp > # ln -s . boot > > From what I checked our loader should handle symlinks just fine. > This will allow us to mount /dev/ad0s1a on /boot directory and use it as > usual. > > Another option is to: > > # cp -Rp /boot /mnt/tmp/ > > and in the future mount /dev/ad0s1a on eg. /bootdisk and create symlink: > > # ln -s bootdisk/boot /boot > > All in all, you should see your kernel when you do: > > # ls -l /mnt/tmp/boot/kernel > > Now don't forget to add zfs_load="YES" to /mnt/tmp/boot/loader.conf. > > Ok, you also need to tell your loader where your root file system is. > You can do it by adding: > > vfs.root.mountfrom="zfs:tank" > > to /mnt/tmp/boot/loader.conf or you can create /mnt/tmp/etc/fstab file > with one entry only: > > tank / zfs rw 0 0 > > On your ZFS file system, your /etc/fstab should contains the line above > and: > > /dev/ad0s1a /boot ufs rw 0 0 > > (and everything else, ie. your swap and other file systems) > > -- > Pawel Jakub Dawidek http://www.wheel.pl > pjd@FreeBSD.org http://www.FreeBSD.org > FreeBSD committer Am I Evil? Yes, I Am! > > -- Joao Barros