165aa
![]() |
|
|
|
|
|||||||
| Howtos & FAQs Would you like to share some of your solutions for certain problems? Tips or tricks? Post here. |
![]() |
|
|
Thread Tools | Display Modes |
|
#1
|
||||
|
||||
|
Do not judge harshly.
Today installed FreeBSD 9.0 RC1 and decided to share with applicants. * applicants/competitors - people who are looking for information on the same topic. Sorry for my English. Create USB Flash. **Be sure to read "D" section. -------------------------------------------------- -------------------------------------------------- Now I have FreeBSD any version, and ftp/wget software. Section A: ========== Download FreeBSD-9.0-RC1-i386-memstick.img, Code:
# mkdir ~/freebsd && cd ~/freebsd # wget "ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/i386/ISO-IMAGES/9.0/FreeBSD-9.0-RC1-i386-memstick.img" ========== Connect your USB Flash device and clear it. My Flash detect how /dev/da0: Code:
# dd if=/dev/zero of=/dev/da0 bs=512 count=4 ========== Create LiveUSB FreeBSD 9.0 RC-1 Flash. Code:
# dd if=FreeBSD-9.0-RELEASE-i386-memstick.img of=/dev/da0 bs=64k ========== Rewrite parameters of your LiveUSB FreeBSD 9.0 Flash. My Flash has one slice - it detected how /dev/da0a: Code:
# moutn -t ufs /dev/da0a /mnt # echo "/dev/ufs/FreeBSD_Install / ufs rw,noatime 1 1" > /mnt/etc/fstab If you have 4K sector size in your HDD, add it parameters in loader.conf. In any case, you can use the alignment of 4k. [!] Further in the text, we will focus on the alignment of 4k sector size. Code:
# echo 'kern.cam.ada.0.quirks="1"' >> /mnt/boot/loader.conf Create partition on your HDD. -------------------------------- -------------------------------- Section A: ========== Run LiveUSB FreeBSD 9.0 with your USB Flash device. Code:
# umount /mnt && reboot now * In your BIOS choose option boot from USB device. Section B: ========== You are run LiveUSB FreeBSD 9 and choose button <Live CD> in "Welcome" window. Okay, you have root access in LiveUSB FreeBSD 9.0 RC-1 OS. Enter: login: root password: <empty> Section C: ========== To check the settings. * If you use 4k sector size alignment, and added 'kern.cam.ada.N.quirks' in /boot/loader.conf, you should get the following result: Code:
# geom disk list ada0
Geom name: ada0
Providers:
1. Name: ada0
Mediasize: 320072933376 (298G)
Sectorsize: 512
Stripesize: 4096
Stripeoffset: 0
Mode: r0w0e0
descr: ST9320423AS
ident: (null)
fwsectors: 63
fwheads: 16
Section D: ========== Clear all partitions of your HDD. * We will use the gpart. Details available here. Thank wblock @. Code:
# gpart show ada0
=> 63 312581745 ipsd0 MBR (298G)
63 11293632 1 !12 [active] (5.4G)
11293695 301288113 - free - (298G)
Code:
# gpart delete -i 1 ada0 Code:
# gpart delete -i 2 ada0 # gpart delete -i 3 ada0 ... # gpart delete -i 128 ada0 Code:
# gpart destroy ada0 ========== Create new partition scheme on your HDD. Create GPT scheme. Code:
# gpart create -s GPT ada0 ** I will use a 4k aligned and I use -a flag. Code:
# gpart add -s 512k -a 4k -t freebsd-boot -l "boot" ada0 # gpart add -b 1m -s 2g -a 4k -t freebsd-ufs -l "root" ada0 # gpart add -s 4g -a 4k -t freebsd-swap -l "swap" ada0 # gpart add -s 4g -a 4k -t freebsd-ufs -l "var" ada0 # gpart add -s 4g -a 4k -t freebsd-ufs -l "tmp" ada0 # gpart add -s 32g -a 4k -t freebsd-ufs -l "usr" ada0 # gpart add -a 4k -t freebsd-ufs -l "home" ada0 Code:
# gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 ada0 bootcode written to ada0 Code:
# gpart show ada0
=> 34 625142381 ada0 GPT (298G)
34 6 - free - (3.0k)
40 1024 1 freebsd-boot (512k)
1064 4194304 2 freebsd-ufs (2.0G)
4195368 8388608 3 freebsd-swap (4.0G)
12583976 8388608 4 freebsd-ufs (4.0G)
20972584 8388608 5 freebsd-ufs (4.0G)
29361192 67108864 6 freebsd-ufs (32G)
96470056 528672352 7 freebsd-ufs (252G)
625142408 7 - free - (3.5k)
Code:
# diskinfo -v ada0
ada0
512 # sectorsize
320072933376 # mediasize in bytes (298G)
625142448 # mediasize in sectors
4096 # stripsize
0 # stripoffset
620181 # Cylinders according to frimware.
16 # Heads according to frimware.
63 # Sectors according to frimware.
5VH4CYKB # Disk ident.
Code:
# echo 0 % 4096 | bc 0 Section F: ========== Create file system. Use journaling softupdates SU+J - you should be use -j flag: Code:
# newfs -J /dev/gpt/root # newfs -j /dev/gpt/var # newfs -J /dev/gpt/tmp # newfs -j /dev/gpt/usr # newfs -j /dev/gpt/home Install FreeBSD 9.0 on your HDD. --------------------------------- --------------------------------- * For that I loved BSDINSTALL (against SYSINSTALL) - because you can turn off BSDINSTALL! * Do not reboot and continue to work on! Section A: ========== Mount all slices for your system. Code:
# mkdir -p /mnt/f9 # mount /dev/gpt/root /mnt/f9 # cd /mnt/f9 # mkdir -p boot var tmp usr # chmod 1777 boot var tmp usr # cd ~/ # mount /dev/gpt/var /mnt/f9/var # mount /dev/gpt/tmp /mnt/f9/tmp # mount /dev/gpt/usr /mnt/f9/usr # mkdir -p /mnt/f9/usr/home # mount /dev/gpt/home /mnt/f9/usr/home ========== Install system. I recommend create folder on your USB Flash and create next scripts: Code:
# mkdir -p /lorddevil # cd /lorddevil/ # vi setupdevil Code:
#!/bin/sh
# Where will unpack the system.
rootsector='/mnt/f9'
# Whence do we unpack the system.
cd /usr/freebsd-dist
# Installation options (use the following packages):
# * All others pkg: doc.txz ports.txz src.txz
# * For x86 CPU (minimal): base.txz kernel.txz
# * For amd64 CPU (minimal): base.txz kernel.txz lib32.txz
# I use: "x86 CPU (minimal)":
for i in base.txz kernel.txz;
do (cat ${i} | tar --unlink -xpJf - -C ${rootsector:-/}); done
exit 0
:wq!
Run it: Code:
# chmod 1555 setupdevil # ./setupdevil Section C: ========== Create /etc/fstab file. Open /mnt/f9/etc/fstab file, and write it: Code:
/dev/gpt/swap none swap sw 0 0
/dev/gpt/root / ufs rw 1 1
/dev/gpt/var /var ufs rw 2 2
/dev/gpt/tmp /tmp ufs rw 2 2
/dev/gpt/usr /usr ufs rw 2 2
/dev/gpt/home /usr/home ufs rw 2 2
========== At the end of... You can immediately skip to step 2. 1. Now you can further customize your system. Mount /dev slice and change the root point: Code:
# mount -t devfs /dev /mnt/f9/dev # chroot /mnt/f9 /bin/sh Code:
# exit Code:
# umount /mnt/f9/usr/home # umount /mnt/f9/usr # umount /mnt/f9/tmp # umount /mnt/f9/var # umount /mnt/f9 # reboot now [!] Do not forget to disconnect the USB Flash. [!] After load real system rewrite root password. Last edited by valsorym; November 14th, 2011 at 22:39. |
|
#3
|
||||
|
||||
|
This HOWTO is convenient to write in the text file and save in their own USB Flash.
Code:
Install FreeBSD 9.0 RC-1
(H A N D S M O D E)
Ukraine
10.11.2011
Doorways
------------------------------------------------------------------------------
Create USB Flash.
------------------------------------------------------------------------------
Now I have FreeBSD any version, and ftp/wget software.
A. Download FreeBSD-9.0-RC1-i386-memstick.img,
# mkdir ~/freebsd && cd ~/freebsd
# wget "ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/i386/
ISO-IMAGES/9.0/FreeBSD-9.0-RC1-i386-memstick.img"
B. Connect your USB Flash device and clear it.
My Flash detect how /dev/da0:
# dd if=/dev/zero of=/dev/da0 bs=512 count=4
C. Create LiveUSB FreeBSD 9.0 RC-1 Flash.
# dd if=FreeBSD-9.0-RELEASE-i386-memstick.img of=/dev/da0 bs=64k
D. Rewrite parameters of your LiveUSB FreeBSD 9.0 Flash.
My Flash has one slice - it detected how /dev/da0a:
# moutn -t ufs /dev/da0a /mnt
# echo "/dev/ufs/FreeBSD_Install / ufs rw,noatime 1 1" > /mnt/etc/fstab
* I added opportunity write in root (and others) sectors on LiveUSB.
** If you have 4K sector size in your HDD, add it parameters in
loader.conf. In any case, you can use the alignment of 4k.
[!] Further in the text, we will focus on the alignment of 4k sector
size.
# echo 'kern.cam.ada.0.quirks="1"' >> /mnt/boot/loader.conf
* [!] My HDD detected how /dev/ada0. If you have device /dev/ada1 - you
must write how: kern.cam.ada.1.quirks="1" .. etc.
------------------------------------------------------------------------------
Create partition on your HDD.
------------------------------------------------------------------------------
A. Run LiveUSB FreeBSD 9.0 with your USB Flash device.
# umount /mnt && reboot now
* [!] No the disconnect your FreeBSD LiveUSB.
* In your BIOS choose option boot from USB device.
B. You are run LiveUSB FreeBSD 9 and choose button <Live CD> in "Welcome"
window. Okay, you have root access in LiveUSB FreeBSD 9.0 RC-1 OS.
Enter:
login: root
password: <empty>
C. To check the settings.
If you use 4k sector size alignment, and added 'kern.cam.ada.N.quirks'
in /boot/loader.conf, you should get the following result:
# geom disk list ada0
Geom name: ada0
Providers:
1. Name: ada0
Mediasize: 320072933376 (298G)
Sectorsize: 512
Stripesize: 4096
Stripeoffset: 0
Mode: r0w0e0
descr: ST9320423AS
ident: (null)
fwsectors: 63
fwheads: 16
* We can see "Stripesize: 4096", else you see "Stripesize: 512" bytes.
D. Clear all partitions of your HDD.
# gpart show ada0
=> 63 312581745 ipsd0 MBR (298G)
63 11293632 1 !12 [active] (5.4G)
11293695 301288113 - free - (298G)
Now I have one partition:
# gpart delete -i 1 ada0
** If you have some others partition (2, 3, 4 ... 128) - remove it. If
you do not do this - You can not run 'gpart destroy ada0'. You will
receive a message: "Device busy!".
# gpart delete -i 2 ada0
# gpart delete -i 3 ada0
...
# gpart delete -i 128 ada0
Delete MBR sector (or other old scheme).
# gpart destroy ada0
E. Create new partition scheme on your HDD.
Create GPT scheme.
# gpart create -s GPT ada0
** In -b and -s flags use next cliche: Xk for Kb, Xm for Mb, Xg for Gb
or empty, etc X - for bloks.
** I will use a 4k aligned and I use -a flag.
# gpart add -s 512k -a 4k -t freebsd-boot -l "boot" ada0
# gpart add -b 1m -s 2g -a 4k -t freebsd-ufs -l "root" ada0
# gpart add -s 4g -a 4k -t freebsd-swap -l "swap" ada0
# gpart add -s 4g -a 4k -t freebsd-ufs -l "var" ada0
# gpart add -s 4g -a 4k -t freebsd-ufs -l "tmp" ada0
# gpart add -s 32g -a 4k -t freebsd-ufs -l "usr" ada0
# gpart add -a 4k -t freebsd-ufs -l "home" ada0
Set the boot loader.
# gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 ada0
bootcode written to ada0
Result for my HDD:
# gpart show ada0
=> 34 625142381 ada0 GPT (298G)
34 6 - free - (3.0k)
40 1024 1 freebsd-boot (512k)
1064 4194304 2 freebsd-ufs (2.0G)
4195368 8388608 3 freebsd-swap (4.0G)
12583976 8388608 4 freebsd-ufs (4.0G)
20972584 8388608 5 freebsd-ufs (4.0G)
29361192 67108864 6 freebsd-ufs (32G)
96470056 528672352 7 freebsd-ufs (252G)
625142408 7 - free - (3.5k)
Checking the alignment:
# diskinfo -v ada0
ada0
512 # sectorsize
320072933376 # mediasize in bytes (298G)
625142448 # mediasize in sectors
4096 # stripsize
0 # stripoffset
620181 # Cylinders according to frimware.
16 # Heads according to frimware.
63 # Sectors according to frimware.
5VH4CYKB # Disk ident.
[!] echo stripoffset % stripsize | bc - should be 0.
# echo 0 % 4096 | bc
0
- it is good.
F. Create file system.
Use journaling softupdates SU+J - you should be use -j flag:
# newfs -J /dev/gpt/root
# newfs -j /dev/gpt/var
# newfs -J /dev/gpt/tmp
# newfs -j /dev/gpt/usr
# newfs -j /dev/gpt/home
* Sectors /root and /tmp has only magazine (use beeg -J flag), other has
-SU+J scheme.
------------------------------------------------------------------------------
Install FreeBSD 9.0 on your HDD.
------------------------------------------------------------------------------
* For that I loved BSDINSTALL (against SYSINSTALL) - because you can turn
off BSDINSTALL!
* Do not reboot and continue to work on!
A. Mount all slices for your system.
# mkdir -p /mnt/f9
# mount /dev/gpt/root /mnt/f9
# cd /mnt/f9
# mkdir -p boot var tmp usr
# chmod 1777 boot var tmp usr
# cd ~/
# mount /dev/gpt/var /mnt/f9/var
# mount /dev/gpt/tmp /mnt/f9/tmp
# mount /dev/gpt/usr /mnt/f9/usr
# mkdir -p /mnt/f9/usr/home
# mount /dev/gpt/home /mnt/f9/usr/home
B. Install system.
I recommend create folder on your USB Flash and create next scripts:
# mkdir -p /lorddevil
# cd /lorddevil/
# vi setupdevil
~~~~
#!/bin/sh
# Where will unpack the system.
rootsector='/mnt/f9'
# Whence do we unpack the system.
cd /usr/freebsd-dist
# Installation options (use the following packages):
# * All others pkg: doc.txz ports.txz src.txz
# * For x86 CPU (minimal): base.txz kernel.txz
# * For amd64 CPU (minimal): base.txz kernel.txz lib32.txz
# I use: "x86 CPU (minimal)":
for i in base.txz kernel.txz;
do (cat ${i} | tar --unlink -xpJf - -C ${rootsector:-/}); done
exit 0
~~~~
:wq!
# chmod 1555 setupdevil
# ./setupdevil
* Do not have time to drink tea! Do not go!
C. Create /etc/fstab file.
Open /mnt/f9/etc/fstab file, and write it:
/dev/gpt/swap none swap sw 0 0
/dev/gpt/root / ufs rw 1 1
/dev/gpt/var /var ufs rw 2 2
/dev/gpt/tmp /tmp ufs rw 2 2
/dev/gpt/usr /usr ufs rw 2 2
/dev/gpt/home /usr/home ufs rw 2 2
D. At the end of...
You can immediately skip to step 2.
1. Now you can further customize your system.
Mount /dev slice and change the root point:
# mount -t devfs /dev /mnt/f9/dev
# chroot /mnt/f9 /bin/sh
Once you're done (setting the Internet, installing ports, rebuild
the kernel, etc.) exit this mode and go to step 2.
# exit
2. Unmount sectors and reboot your computer.
# umount /mnt/f9/usr/home
# umount /mnt/f9/usr
# umount /mnt/f9/tmp
# umount /mnt/f9/var
# umount /mnt/f9
# reboot now
* If something can not unmount use: umoutt -f <mount_point>
[!] Do not forget to disconnect the USB Flash.
[!] After load real system rewrite root password.
Last edited by valsorym; November 14th, 2011 at 22:40. |
| The Following User Says Thank You to valsorym For This Useful Post: | ||
eriksatie (November 14th, 2011) | ||
|
#4
|
||||
|
||||
|
Just out of curiosity, why would you go to all this trouble instead of using bsdinstaller ?
PS wget is not part of the OS binaries. You can use fetch instead. Regards, George
__________________
Powered by BareBSD |
| The Following User Says Thank You to gkontos For This Useful Post: | ||
valsorym (November 10th, 2011) | ||
|
#5
|
||||
|
||||
|
Quote:
Quote:
Last edited by valsorym; November 10th, 2011 at 20:37. |
|
#6
|
||||
|
||||
|
umount(8) is misspelled in the last part. Also, I suggest using SUJ on all filesystems to avoid long fsck times.
|
| The Following User Says Thank You to wblock@ For This Useful Post: | ||
valsorym (November 10th, 2011) | ||
|
#7
|
||||
|
||||
|
Quote:
Quote:
** For this reason, I had never thought to use the log to /tmp. (To understand this, read this post.) But thanks anyway! I'll think about it. Last edited by DutchDaemon; November 10th, 2011 at 21:39. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Manually mounting .gz UFS images in RW mode | Seeker | General | 6 | August 30th, 2011 12:22 |
| Howto: encrypted FreeBSD 9 with UFS | namor | Howtos & FAQs | 3 | August 9th, 2011 11:19 |
| HOWTO: Install FreeBSD with gcc45 | Pavick | Howtos & FAQs | 3 | November 9th, 2010 08:11 |
| howto install freeBSD on iMac/howto boot from CD | leizhenhua | Other Architectures | 1 | June 15th, 2009 06:09 |