BSDG33KCLUB

FreeBSD Manual Install Command By:Vincent0ne-

Jun 16th, 2014
282
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.48 KB | None | 0 0
  1. #FreeBSD Manual Install Commands
  2.  
  3. DHCP Network
  4.  
  5.  
  6. iface is interface of your NIC my computer is rl0.
  7.  
  8. # dhclient iface DHCP (Optional)
  9.  
  10. # gpart show #Verify
  11.  
  12. If disk had partitions
  13.  
  14. # gpart delete -i 1 ada0
  15. ada0s1 deleted
  16. # gpart destroy ada0
  17.  
  18. # gpart create -s mbr ada0
  19. ada0 created
  20. # gpart add -t freebsd -i 1 ada0
  21. => 63 33554369 ada0 MBR (16G)
  22. 63 33554367 1 freebsd (16G)
  23. 33554430 2 - free - (1.0K)
  24.  
  25. # bsdlabel -wB /dev/ad0s1 # to create an empty table shown below
  26.  
  27. # bsdlabel /dev/ad0s1 > labeloutfile
  28.  
  29. # /dev/ad0s1:
  30. 8 partitions:
  31. # size offset fstype [fsize bsize bps/cpg]
  32. a: 33554351 16 unused 0 0
  33. c: 33554367 0 unused 0 0 # "raw" part, don't edit
  34.  
  35. Edit this table to match similar ee can be used during this time
  36. Edit this to your ways
  37.  
  38. ee labeloutfile
  39.  
  40. # bsdlabel /dev/ad0s1 (16 GB Drive)
  41.  
  42. # /dev/ad0s1:
  43. 8 partitions:
  44. # size offset fstype [fsize bsize bps/cpg]
  45. a: 2G 16 4.2BSD 0 0 0
  46. b: 4G * swap 0 0
  47. c: 33554367 0 unused 0 0 # "raw" part, don't edit
  48. d: 5G * 4.2BSD 0 0 0
  49. e: * * 4.2BSD 0 0 0
  50.  
  51. * Means use whatever and * on Size means use rest.
  52.  
  53. Restore disk information from your file
  54.  
  55. # bsdlabel -R /dev/ad0s1 labeloutfile
  56.  
  57. Display the information
  58.  
  59. # bsdlabel /dev/ad0s1
  60.  
  61. # /dev/ad0s1:
  62. 8 partitions:
  63. # size offset fstype [fsize bsize bps/cpg]
  64. a: 4194304 16 4.2BSD 0 0 0
  65. b: 4194304 4194320 swap 0 0
  66. c: 33554367 0 unused 0 0 # "raw" part, don't edit
  67. d: 8388608 8388624 4.2BSD 0 0 0
  68. e: 16777135 16777232 4.2BSD 0 0 0
  69.  
  70. then format each of the drives
  71.  
  72. # newfs -U -O2 /dev/ad0s1a
  73. # newfs -U -O2 /dev/ad0s1d
  74. # newfs -U -O2 /dev/ad0s1e
  75.  
  76. then mount them
  77.  
  78. # mount /dev/ad0s1a /mnt
  79. # mkdir /mnt/usr
  80. # mkdir /mnt/usr/home
  81. # mount /dev/ad0s1e /usr
  82. # mount /dev/ad0s1d /home
  83.  
  84. # cd /mnt
  85.  
  86. install bootblock
  87. # boot0cfg -B /dev/ada0
  88.  
  89.  
  90. # df -h
  91. Filesystem Size Used Avail Capacity Mounted on
  92. /dev/iso9660/FREEBSD_INSTALL 564M 564M 0B 100% /
  93. devfs 1.0K 1.0K 0B 100% /dev
  94. /dev/md0 31M 316K 28M 1% /var
  95. /dev/md1 19M 56K 17M 0% /tmp
  96. /dev/ad0s1a 1.9G 16K 1.8G 0% /mnt
  97. /dev/ad0s1e 7.7G 12K 7.1G 0% /mnt/usr
  98. /dev/ad0s1d 3.9G 8.0K 3.6G 0% /mnt/usr/home
  99. # pwd
  100. /tmp
  101.  
  102. # ls /usr/freebsd-dist/*.txz
  103.  
  104. To see the files in the directory on CD
  105. then if wanted to a shell script can be created or they can be manually
  106. extracted.
  107.  
  108. Script way (Example Script)
  109. !/bin/sh
  110. # forls
  111.  
  112. for loop in `ls /usr/freebsd-dist/*.txz `
  113. do
  114.  
  115. tar vxjpf $loop
  116. done
  117.  
  118.  
  119. Without script the command is
  120.  
  121. # tar xjpfv /usr/freebsd-dist/file.txz
  122.  
  123. and so on till each file in the directory requested is extracted.
  124.  
  125. Configuring the Fstab
  126.  
  127. Add lines to the /etc/fstab as it is blank similar to below
  128.  
  129. #Device Mount FSTtype Option Dump Pass
  130.  
  131. /dev/ad0s1a / ufs rw 1 1
  132. /dev/ad0s1b none swap sw 0 0
  133. /diskdev/usr /usr ufs rw 0 0
  134. /diskdev/home /home ufs rw 0 0
  135. proc /proc procfs rw 0 0
  136.  
  137.  
  138. /diskdev/usr Symbolic link to /dev/ad0s1e
  139. /diskdev/home Symbolic link to /dev/ad0s1d
  140.  
  141. Symbolic link will not work for the root filesystem
  142.  
  143. Then configure the /etc/rc.conf
  144.  
  145. Basic Configuration just to get it to work
  146.  
  147. # Set Hostname
  148. hostname="TestComp"
  149.  
  150. #Set Keyboard
  151. keymap="uk.iso.kbd"
  152.  
  153. #Set Network
  154. ifconfig_rl0="DHCP"
  155.  
  156. # Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
  157. dumpdev="AUTO"
  158.  
  159.  
  160. Set the password for root
  161.  
  162. # cd /mnt
  163. # chroot .
  164. passwd
  165. Enter password for root: Password
  166. Confirm password for root: Password
  167.  
  168. adduser
  169. Follow promptings on screen
  170.  
  171. exit # Exit the chroot environment
  172.  
  173. cd /
  174. umount /mnt/usr/home
  175. umount /mnt/usr
  176. umount /mnt
  177.  
  178. Before rebooting verify the settings.
  179.  
  180. reboot
Add Comment
Please, Sign In to add comment