0% found this document useful (0 votes)
115 views

ZFS USB Disk Install

This document provides instructions for installing FreeBSD on ZFS using 3 disks in a mirrored configuration. The process involves creating GPT partitions on each disk, creating a mirrored ZFS storage pool across the disks, installing FreeBSD to the ZFS filesystems, configuring boot options, and rebooting into the new ZFS-based installation. Additional configuration is then needed to fully set up the system.

Uploaded by

Oronti Adewale
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
115 views

ZFS USB Disk Install

This document provides instructions for installing FreeBSD on ZFS using 3 disks in a mirrored configuration. The process involves creating GPT partitions on each disk, creating a mirrored ZFS storage pool across the disks, installing FreeBSD to the ZFS filesystems, configuring boot options, and rebooting into the new ZFS-based installation. Additional configuration is then needed to fully set up the system.

Uploaded by

Oronti Adewale
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 5

This command is used to make a bootable usb disk in Unix If you're using another OS and want to do it manually, simply

insert your USB drive and enter df or you do a mount command to check all the mounted filesystems in a shell to determine the location it is mounted at (mine was /dev/sdf) and then issue the following command as root (where /dev/sdf is the location of the USB disk): sudo dd if=8.0-RELEASE-amd64-memstick.img of=/dev/sdf bs=10240 conv=sync Note:if you are loogged in as root you dont need the sudo command Process: 1. Boot from the USB stick or DVD 2. At the loader menu, press 6 to escape to a loader prompt 3. Load required modules, then continue booting: Type '?' for a list of commands, 'help' for more detailed help. OK load ahci /boot/kernel/ahci.ko size 0xfd88 at 0x126b000 OK load zfs /boot/kernel/zfs.ko size 0x19eb18 at 0x127b000 loading required module 'opensolaris' /boot/kernel/opensolaris.ko size 0x3868 at 0x141a000 OK boot
4. In sysinstall, set your keyboard language and then choose Fixit from

the main menu, specifying the appropriate device to run the environment from (DVD or USB) but own case I am using a 2GB USB disk for my installation. To know how to make a bootable USB disk check from above (making bootable FreeBSD USB disk) 5. GPT partition first disk, ad4, and install bootcode: # gpart create -s gpt ad4 # gpart add -s 64K -t freebsd-boot ad4 ad4p1 added # gpart add -s 4G -t freebsd-swap ad4 ad4p2 added # gpart add -t freebsd-zfs ad4 ad4p3 added # gpart bootcode -b /dist/boot/pmbr p /dist/boot/gptzfsboot -i 1 ad4

ad4 has bootcode


6. Repeat the previous steps for second and third disk, ad5 and ad6 this

depends on what the system sees your disk drives as. 7. Show GPT layout so far: # gpart show => 34 488397101 34 128 162 8388608 8388770 480008365 => 34 34 162 8388770 488397101 128 8388608 480008365

ada0 1 2 3 ada1 1 2 3

GPT (233G) freebsd-boot (64K) freebsd-swap (4.0G) freebsd-zfs (229G) GPT (233G) freebsd-boot (64K) freebsd-swap (4.0G) freebsd-zfs (229G)

8. Set the single partition defined in the protective MBR as active. Some systems that have a BIOS that checks for the existence of an active MBR partition on the boot drive and fails to boot if it isn't found. Intel motherboards seem to do this: # fdisk -a -1 /dev/ad4 # fdisk -a -1 /dev/ad5 # fdisk -a -1 /dev/ad6 9. Create /boot/zfs directory for zpool.cache file: # mkdir /boot/zfs 10. Create mirrored zpool from freebsd-zfs partitions on each disk:

# zpool create pool0 mirror ad4p3 ad5p3 ad6p3 # zpool status -v pool0 pool: pool0 state: ONLINE scrub: none requested config: NAME pool0 mirror ad4p3 STATE ONLINE ONLINE ONLINE READ WRITE CKSUM 0 0 0 0 0 0 0 0 0

ad5p3 ONLINE ad6p3 ONLINE errors: No known data errors 11. # # # # # # # # # # 12. zfs zfs zfs zfs zfs zfs zfs zfs zfs zfs

0 0

0 0

0 0

Create ZFS hierarchy, mounted under /mnt: set mountpoint=none pool0 create pool0/ROOT create -o mountpoint=/mnt pool0/ROOT/freebsd create pool0/ROOT/freebsd/var create pool0/ROOT/freebsd/usr create pool0/ROOT/freebsd/usr/local create pool0/ROOT/freebsd/usr/ports create pool0/ROOT/freebsd/usr/ports/distfiles create pool0/ROOT/freebsd/usr/src create -o mountpoint=/home pool0/home Extract FreeBSD distribution to ZFS filesystems:

# export DESTDIR=/mnt # cd /dist/8.1-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 13. Copy GENERIC kernel to expected location:

# cd /mnt/boot # rmdir kernel # cp -R GENERIC kernel 14. Edit loader.conf and rc.conf to start ZFS on boot:

# 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"
15. Set up fstab to mount swap and /tmp on boot:

# vi /mnt/etc/fstab tmpfs /dev/ad4p2 /dev/ad5p2 /dev/ad6p2 16. /tmp none none none tmpfs swap swap swap rw,mode=01777 sw 0 sw 0 sw 0 0 0 0 0 0

Copy zpool.cache to /mnt/boot:

# cp /boot/zfs/zpool.cache /mnt/boot/zfs/zpool.cache 17. Export LD_LIBRARY_PATH:

# export LD_LIBRARY_PATH=/dist/lib 18. # # # # # 19. zfs zfs zfs zfs zfs Unmount all ZFS filesystems and then change their mountpoints: umount -a set mountpoint=legacy pool0/ROOT/freebsd set mountpoint=/usr pool0/ROOT/freebsd/usr set mountpoint=/var pool0/ROOT/freebsd/var set mountpoint=/home pool0/home Set bootfs property on pool:

# zpool set bootfs=pool0/ROOT/freebsd pool0 20. Exit Fixit environment and reboot

The system should now boot into the new ZFS-based FreeBSD installation. At this stage, it is very minimally configured. The following still needs to be done:
o o o o

Set root's password Configure hostname and networking Configure timezone Configure services to start on boot; sshd, ntpd, etc

You might also like