Guest User

Untitled

a guest
May 15th, 2012
166
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Gpart destroy –F ada0
  2. Gpart create –s gpt ada0
  3. Gpart add –s 128 –t freebsd-boot ada0
  4. Gpart add –s 10G –t freebsd-zfs ada0
  5. Gpart add -s 4G –t freebsd-swap ada0
  6. Gpart add –t freebsd-zfs ada0
  7.  
  8. Gpart bootcode –b /boot/pmbr –p /boot/gptzfsboot –i 1 ada0
  9. Mdconfig –a –t malloc -s 128m –u 2
  10. Newfs –O2 /dev/md2
  11. Mount /dev/md2 /boot/zfs
  12. Kldload opensolaris
  13. Kldload zfs
  14. Kldload geom_eli
  15.  
  16. Zpool create bootdir /dev/ada0
  17. Zpool set bootfs=bootdir bootdir
  18. Mkdir /boot/zfs/bootdir
  19. Zfs set mountpoint=/boot/zfs/bootdir bootdir
  20. Zfs mount bootdir
  21. Dd if=/dev/random of=/boot/zfs/bootdir/encryption.key bs=4096 count=1
  22. Geli init –b –B /boot/zfs/bootdir/ada0p4.eli –e AES-XTS –K /boot/zfs/bootdir/encryption.key –l 256 –s 4096 /dev/ada0p4
  23. Geli attach –k /boot/zfs/bootdir/encryption.key /dev/ada0p4
  24. Zpool create zroot /dev/ada0p4.eli
  25. zfs set mountpoint=/boot/zfs/zroot zroot
  26. zfs mount zroot
  27. zfs unmount bootdir
  28. mkdir /boot/zfs/zroot/bootdir
  29. zfs set mountpoint=/boot/zfs/zroot/bootdir bootdir
  30. zfs mount bootdir
  31. zfs set checksum=fletcher4 zroot
  32. zfs create –o compression=on –o exec=on –o setuid=off zroot
  33. chmod 1777 /boot/zfs/zroot
  34. zfs create zroot/usr
  35. zfs create zroot/home
  36. cd /boot/zfs/zroot; ln –s /usr/home home
  37. zfs create –o compression=lzjb –o setuid=off zroot/usr/ports
  38. zfs create –o compression=off –o exec=off –o setuid=off zroot/usr/ports/distfiles
  39. zfs create zroot/var
  40. zfs create -o compression=lzjb –o exec=off –o setuid=off zroot/var/crash
  41. zfs create –o exec=off –o setuid=off zroot/var/db
  42. zfs create –o compression=lzjb –o exec=on -o setuid=off zroot/var/db/pkg
  43. zfs create –o exec=off –o setuid=off zroot/var/empty
  44. zfs create –o compression=lzjb –o exec=off –o setuid=off zroot/var/log
  45. zfs create –o compression=gzip –o exec=off –o setuid=off zroot/var/mail
  46. zfs create –o exec=off –o setuid=off zroot/var/run
  47. zfs create –o compression=lzjb –o exec=on –o setuid=off zroot/var/tmp
  48. chmod 1777 /bot/zfs/zroot/var/tmp
  49.  
  50. cd /boot/zfs/zroot
  51. unxz –c /usr/freebsd-dist/base.txz | tar xvpf –
  52. unxz –c /usr/freebsd-dist/kernel.txz | xvpf –
  53. unxz –c /usr/freebsd-dist/src.txz | xvpf
  54. zfs set readonly=on zroot/var/empty
  55. chroot /boot/zfs/zroot
  56. cd /
  57. mv boot bootdir/
  58. ln –fs bootdir/boot
  59. mv bootdir/encryption.key bootdir/boot/
  60. mv bootdir/*.eli boot/boot/
  61.  
  62. echo ‘zfs_enable=”YES”’ > /etc/rc.conf
  63. echo ‘geli_swap_flag=”-e AES-XTS –l 256 –s 4096”’ >> /etc/rc.conf
  64. touch /etc/fstab
  65. #fstab: /dev/ada0p3.eli none swap sw 0 0
  66. echo ‘vfs.zfs.prefetch_disable=”1”’ > /boot/loader.conf
  67. echo ‘vfs.root.mountfrom=”zfs:zroot”’ >> /boot/loader.conf
  68. echo ‘zfs_load=”YES”’ >> /boot/loader.conf
  69. echo ‘aesni_load=”YES”’ >> /boot/loader.conf
  70. echo ‘geom_eli_load=”YES”’ >> /boot/loader.conf
  71. echo ‘geli_ada0p3_keyfile0_load=”YES”’ >> /boot/loader.conf
  72. echo ‘geli_ada0p3_keyfile0_type=ada0p3:geli_keyfile0”’ >> /boot/loader.conf
  73. echo ‘geli_ada0p3_keyfile0_name=”/boot/encryption.key”’ >> /boot/loader.conf
  74.  
  75. passwd root
  76. tzsetup
  77. cd /etc/mail
  78. make aliases
  79. sysinstall
  80. exit
  81. cd /boot/zfs
  82. cp /boot/zfs/zpool.cache /boot/zfs/zroot/boot/zfs/zpool.cache
  83. zfs unmount –a
  84. zfs set mountpoint=legacy zroot
  85. zfs set mountpoint=/tmp zroot/tmp
  86. zfs set mountpoint=/usr zroot/usr
  87. zfs set mountpoint=/var zroot/var
  88. zfs set mountpoint=/bootdir bootdir
RAW Paste Data