Skip to content

Instantly share code, notes, and snippets.

@shutingrz
Created June 16, 2014 15:24
Show Gist options
  • Select an option

  • Save shutingrz/02572fc1024e82f3c24e to your computer and use it in GitHub Desktop.

Select an option

Save shutingrz/02572fc1024e82f3c24e to your computer and use it in GitHub Desktop.
#respected
#core
#http://blogs.yahoo.co.jp/alpha3166/10269630.html
#
#gpart
#http://www.jp.freebsd.org/cgi/mroff.cgi?sect=8&subdir=man&lc=1&cmd=&dir=jpman-7.2.2/man&man=gpart
#
#zfs mirror
#http://www2.shakemid.com/fswiki/wiki.cgi?page=ZFS%A4%F2%BB%C8%A4%C3%A4%C6%A4%DF%A4%EB
#
#StragePool
#http://l-w-i.net/t/macosx/zfs_002.txt
#
#zfs mountpoint
#http://solaris-user.com/zfs/solaris11_b27_zfs.html
gpart create -s gpt ada0
gpart add -t freebsd-boot -s 64K ada0
gpart add -t freebsd-zfs ada0
gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada0
gpart create -s gpt ada1
gpart add -t freebsd-boot -s 64K ada1
gpart add -t freebsd-zfs ada1
gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada1
mdmfs -s 1M md /boot/zfs
zpool create -f zroot mirror ada0p2 ada1p2 #エラーが出るが無視
#zpool list で確認してみる
zfs create -o mountpoint=/mnt zroot/root
#zfs list で確認してみる
tar -xvzf /usr/freebsd-dist/base.txz -C /mnt
tar -xvzf /usr/freebsd-dist/kernel.txz -C /mnt
zpool set bootfs=zroot/root zroot
echo 'zfs_load="YES"' >> /mnt/boot/loader.conf
echo 'vfs.root.mountfrom="zfs:zroot/root"' >> /mnt/boot/loader.conf
echo 'zfs_enable="YES"' >> /mnt/etc/rc.conf
cp /boot/zfs/zpool.cache /mnt/boot/zfs
touch /mnt/etc/fstab
echo 'hostname="ic"' >> /mnt/etc/rc.conf
#再起動後
zfs set mountpoint=/zroot/root zroot/root
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment