X-Git-Url: http://popeye.lapinbilly.eu/git/?p=zfsinstaller.git;a=blobdiff_plain;f=zfsinstall.sh;h=b34634952c9b653978e44408ee87db8180790d6e;hp=9be6c573cd41fbc4ef7be741456ae33c8d8ab2e4;hb=bb26d87271f6c61334a9bd30751335bce207dae7;hpb=e2d774a79f7d04e3b709c8be28f6620dfe3ec5aa diff --git a/zfsinstall.sh b/zfsinstall.sh index 9be6c57..b346349 100644 --- a/zfsinstall.sh +++ b/zfsinstall.sh @@ -33,10 +33,11 @@ echo partitioning ${DESTDISK} echo ============= gpart create -s gpt ${DESTDISK} -gpart add -t freebsd-boot -s 1024 -l boot ${DESTDISK} -gpart add -a 1m -s 32G -t freebsd-swap -l swap ${DESTDISK} -gpart add -a 1m -t freebsd-zfs -l syszfs ${DESTDISK} +gpart add -a 4k -t freebsd-boot -s 512k -l gptboot0 ${DESTDISK} +gpart add -a 1m -s 32G -t freebsd-swap -l swap0 ${DESTDISK} +gpart add -a 1m -t freebsd-zfs -l zfs0 ${DESTDISK} gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ${DESTDISK} +gpart set -a active ${DESTDISK} gpart show ${DESTDISK} @@ -45,28 +46,27 @@ sysctl vfs.zfs.min_auto_ashift=12 echo set up zfs pool: ${ZPOOL} alt mount: ${DESTDIR} echo ================= -zpool create -m none -f -R ${DESTDIR} ${ZPOOL} ${DESTDISK}p3 +zpool create -m none -f -R ${DESTDIR} ${ZPOOL} ${DESTDISK}p3 ada1 if [ "${?}" -ne 0 ]; then echo "unable to create zpool" exit 1 fi -for I in ROOT VAR HOME; do +for I in ROOT VAR HOME DATA; do zfs create -o mountpoint=none -o canmount=off ${ZPOOL}/${I} done zfs create -o atime=off -o mountpoint=/ ${ZPOOL}/ROOT/master + zfs create -o mountpoint=/usr/obj ${ZPOOL}/ROOT/obj zfs create -o compression=off -o mountpoint=/usr/src ${ZPOOL}/ROOT/src +zfs create -o mountpoint=/usr/doc -o compression=on ${ZPOOL}/ROOT/doc # useless ? as far /tmp mountpoint will be mounted by tmpfs zfs create -o mountpoint=/tmp ${ZPOOL}/ROOT/tmp zfs create -o mountpoint=/usr/local ${ZPOOL}/LOCAL zfs create -o mountpoint=/usr/local/etc ${ZPOOL}/LOCAL/config -zfs create -o copies=1 -o mountpoint=/usr/src -o compression=off ${ZPOOL}/src -zfs create -o copies=1 -o mountpoint=/usr/doc -o compression=on ${ZPOOL}/doc -zfs create -o copies=1 -o mountpoint=/usr/obj -o compression=on ${ZPOOL}/obj zfs create -o mountpoint=/var ${ZPOOL}/VAR/master @@ -80,6 +80,7 @@ zfs create -o exec=off -o setuid=off -o mountpoint=/var/tmp ${ZPOOL}/VAR/tmp zfs create -o mountpoint=/usr/home ${ZPOOL}/HOME/master +zpool set bootfs=${ZPOOL}/ROOT/master ${ZPOOL} chmod 1777 ${DESTDIR}/tmp ${DESTDIR}/var/tmp @@ -96,7 +97,7 @@ echo ======================================= for I in base.txz kernel.txz lib32.txz; do - fetch http://ftp.freebsd.org/pub/FreeBSD/snapshots/amd64/12.0-ALPHA8/${I} + fetch http://ftp.freebsd.org/pub/FreeBSD/releases/amd64/11.2-RELEASE/${I} tar --unlink -pJxf ${I} -C ${DESTDIR} done