Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 5 Jun 2011 07:36:16 -0400 (EDT)
From:      Darrel <levitch@iglou.com>
To:        krad <kraduk@gmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   solved: failure to create zfs storage pool
Message-ID:  <Pine.GSO.4.61.1106050730410.22625@shell1>
In-Reply-To: <BANLkTikw2s49AfzBwCMYL9OHEY6Hsof4ag@mail.gmail.com>
References:  <Pine.GSO.4.61.1106031635480.9153@shell1> <BANLkTinBLHgLLbC1v8RFJUcbsb8x=CpL1A@mail.gmail.com> <Pine.GSO.4.61.1106040641140.24645@shell1> <BANLkTikw2s49AfzBwCMYL9OHEY6Hsof4ag@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

>
>
> 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



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