ZFS: amd64, devd, root file system.
    Pawel Jakub Dawidek 
    pjd at FreeBSD.org
       
    Mon Apr  9 09:43:35 UTC 2007
    
    
  
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 at FreeBSD.org                           http://www.FreeBSD.org
FreeBSD committer                         Am I Evil? Yes, I Am!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-fs/attachments/20070409/1c60191f/attachment.pgp
    
    
More information about the freebsd-fs
mailing list