Dear all:
i have install freebsd14 with zfs in shell mode. but i dont' know how to create new zfs dataset /usr to mount at /usr , and other /home , /var in new datatset ?
zfs create -o mountpoint=/home zroot/home
zfs create -o mountpoint=/usr zroot/usr
zfs create -o mountpoint=/var zroot/var
i have install freebsd14 with zfs in shell mode. but i dont' know how to create new zfs dataset /usr to mount at /usr , and other /home , /var in new datatset ?
- gpart destroy -F ada0
- gpart create -s gpt ada0.
- gpart add -a 4k -t efi -s 512M -l efi ada0
- newfs_msdos -F 32 -c 1 /dev/ada0p1
- mount -t msdosfs -o longnames /dev/ada0p1 /mnt
- mkdir -p /mnt/EFI/BOOT
- cp /boot/loader.efi /mnt/EFI/BOOT/BOOTX64.efi.
- gpart add -t freebsd-swap -s 32G -l freebsd-swap ada0
- swapon /dev/ada0p2
- gpart add -t freebsd-zfs -l system ada0.
- mount -t tmpfs tmpfs /mnt
- zpool create -o altroot=/mnt zroot ada0p3
- Create the file system hierarchy.
- Set compression.
- zfs set compression=on zroot
- Create a boot environment hierarchy and set up so you can install.
- zfs create -o mountpoint=none zroot/ROOT
- zfs create -o mountpoint=/ -o canmount=noauto zroot/ROOT/default
- mount -t zfs zroot/ROOT/default /mnt
- Set compression.
zfs create -o mountpoint=/home zroot/home
zfs create -o mountpoint=/usr zroot/usr
zfs create -o mountpoint=/var zroot/var
Installing the system
- Install the system by copying the system files from the live CD. If there is a way to download these files off the web before uncompressing them, I'd love to hear it.
- cd /mnt
- tar xvJf /usr/freebsd-dist/base.txz
- tar xvJf /usr/freebsd-dist/kernel.txz
- tar xvJf /usr/freebsd-dist/lib32.txz
- Configure the boot environment
- zpool set bootfs=zroot/ROOT/default zroot
- Chroot in and configure fstab for swap and rc.conf and loader.conf to load the ZFS drivers.
- chroot /mnt
- echo /dev/ada0p2 none swap sw 0 0 > /etc/fstab
- sysrc zfs_enable=YES
- echo zfs_load=”YES” >> /boot/loader.conf
- Set the timezone, network and hostnames.
- tzsetup