solved: failure to create zfs storage pool

Darrel levitch at iglou.com
Sun Jun 5 11:36:18 UTC 2011


>
>
> well you have 2x disks dont you. Break the mirrors and then you have a free
> drive. Setup the pool how you want on this then rsync all your os build over
> onto it. Make any zfs root tweaks you want then boot onto the drive.
>
> If all is good then copy across the partition table from the zfs drive to
> the new one (gpart backup/restore) and attach the relevent slice/partition
> to pool. Finally put the boot blocks onto the drive, job done no work lost
>

Seems like I crashed all of it along with the mirrors.  This worked, 
though:

- boot from FreeBSD82 digital versatile disk; \
         e.g., FreeBSD-8.2-RELEASE-amd64-dvd1.iso

- select 6 at loader menu

load ahci
load zfs
boot

- fixit > dvd

gpart destroy -F ad4
gpart destroy -F ad6
gpart create -s gpt ad4
gpart add -s 64K -t freebsd-boot ad4
gpart add -s 5G -t freebsd-swap ad4
gpart add -t freebsd-zfs ad4
gpart bootcode -b /dist/boot/pmbr -p /dist/boot/gptzfsboot -i 1 ad4
gpart add -s 64K -t freebsd-boot ad6
gpart add -s 5G -t freebsd-swap ad6
gpart add -t freebsd-zfs ad6
gpart bootcode -b /dist/boot/pmbr -p /dist/boot/gptzfsboot -i 1 ad6
gpart show

mkdir /boot/zfs

zpool create pool0 mirror ad4p3 ad6p3
zpool status -v pool0
zfs set mountpoint=none pool0
zfs create pool0/ROOT
zfs create -o mountpount=/mnt pool0/ROOT/freebsd
zfs create pool0/ROOT/freebsd/tmp
zfs create pool0/ROOT/freebsd/var
zfs create pool0/ROOT/freebsd/usr
zfs create -o mountpoint=/home pool0/HOME

export DESTDIR=/mnt
cd /dist/8.2-RELEASE
for dir in base catpages dict doc info lib32 manpages; \
         do (cd $dir; ./install.sh); done
cd kernels
./install.sh GENERIC
cd ../src
./install.sh all

cd /mnt/boot
cp -Rpv GENERIC/* kernel/

vi /mnt/boot/loader.conf
!--
ahci_load="YES"
zfs_load="YES"
vfs.root.mountfrom="zfs:pool0/ROOT/freebsd"

vi /mnt/etc/rc.conf
!--
zfs_enable="YES"

vi /mnt/etc/fstab
!--
/dev/ad4p2      none    swap    sw              0       0
/dev/ad6p2      none    swap    sw              0       0

cp /boot/zfs/zpool.cache /mnt/boot/zfs/zpool.cache
export LD_LIBRARY_PATH=/dist/lib

cd /
zfs umount -a
zfs set mountpoint=legacy pool0/ROOT/freebsd
zfs set mountpoint=/tmp pool0/ROOT/freebsd/tmp
zfs set mountpoint=/usr pool0/ROOT/freebsd/usr
zfs set mountpoint=/var pool0/ROOT/freebsd/var
zfs set mountpoint=/home pool0/HOME

zpool set bootfs=pool0/ROOT/freebsd pool0

exit
- remove the dvd
exit
exit
yes

Darrel


More information about the freebsd-questions mailing list