Quadruple system Windows 7, OSX Snow Leopard, Ubuntu Lucid and FreeBSD 8 on GPT with BURG (supports UEFI/Apple EFI/PCBIOS)
Introduction
This guide shows how to install the four OS on GPT and boots with BURG. In preparation, you needs to have:
The following installation process requires to remove all partitions and create new disk layout, make sure to backup important data first !
UEFI
My test environment: HP ProBook 4510s
grub-install --force /dev/sda update-grub set prefix=(hd0,5)/boot/burg insmod normal normal
This would bring you to the normal burg menu, press 'c' to enter a console windows, and enter these commands:
#!/bin/sh exec tail -n +3 $0# This file provides an easy way to add custom menu entries. Simply type the # menu entries you want to add after this comment. Be careful not to change # the 'exec tail' line above. menuentry "Boot Snow Leopard" --class macosx { set root=(hd0,4) multiboot /boot} menuentry "Boot Leopard" --class macosx { set root=(hd0,9) multiboot /boot} menuentry "Boot FreeBSD" --class freebsd { set root=(hd0,8) kfreebsd /boot/loader} menuentry "Reboot to EFI mode" { gptsync hd0 reboot} then use update-burg to update the configuration file. Mount the EFI partition and create burg directory:sudo mount /dev/sda1 /mnt sudo mkdir /mnt/EFI/burgDownload the latest burg-efi64 and burg-themes package from: http://code.google.com/p/burg/downloads/list, extract to /mnt/EFI/burg directory, and rename /mnt/EFI/burg/burg_uefi.cfg as /mnt/EFI/burg/burg.cfg.
sudo apt-get install efibootmgr Then use this to add a new EFI boot item for burg:sudo efibootmgr -v -c -L "BURG" -l "\\EFI\\burg\\burg64.efi"burg would be the default boot loader for EFI now, you don't need to use "Boot From UEFI File" to choose it.
newfs -O2 -U /dev/da4p8 mount /dev/sda8 /mnt Exit fixit shell. In Options, change install root from / to /mnt. Choose "Configure" and "Distribution" to install. Make sure you don't touch the "Fdisk" and "Disklabel" as they'd mess up the MBR. After it, reopen a fixit shell, cd to /mnt/boot, and rename GENERIC directory to kernel. You also need to create /mnt/etc/fstab as follows:/dev/ad4p7 none swap ew 0 0 /dev/ad4p8 / ufs rw 1 1
Apple EFI
My test environment: Mac Mini 3.1 (early 2009 version)
grub-install --force /dev/sda update-grub #!/bin/sh exec tail -n +3 $0# This file provides an easy way to add custom menu entries. Simply type the # menu entries you want to add after this comment. Be careful not to change # the 'exec tail' line above. menuentry "Boot Windows" --class windows { set root=(hd0,2) chainloader +1 } menuentry "Boot FreeBSD" --class freebsd { set root=(hd0,8) kfreebsd /boot/loader} then use update-burg to update the configuration file.
gptsync hd0 2+ 3 4 reboot The advantage of BURG's gptsync is that you can choose which partition to mapped into MBR slots. For example, if you have a data partition at (hd0,10), you can use this to make it visible to Windows:gptsync hd0 2+ 3 10
burg-install --force /dev/sda update-burg set root=(hd0,6) kfreebsd /fbsd_install/kernel kfreebsd_module /fbsd_install/mfsroot.gz type=mfs_root kfreebsd_loadenv /fbsd_install/devices.hintset FreeBSD.vfs.root.mountfrom=ufs:/dev/md0 boot After that, install FreeBSD using similar method described in UEFI section. PCBIOS
Install in PCBIOS machine is a combination of the above methods, here are highlights:
|
Quadruple system Windows 7, OSX Snow Leopard, Ubuntu Lucid and FreeBSD 8 on GPT with BURG (supports UEFI/Apple EFI/PCBIOS)
ref: http://code.google.com/p/burg/wiki/QuadBoot
UEFI Firmware
ref: http://www.thinkwiki.org/wiki/UEFI_Firmware
UEFI Firmware
UEFI (Unified Extensible Firmware Interface) is a modernized replacement to BIOS (Basic Input/Output System). The specification is maintained by the collaborative non-profit UEFI Forum. UEFI is supported by both recent versions of both Linux and Windows. UEFI firmware with legacy BIOS support has started appearing on Sandybrige (220,420,520,etc.) Thinkpads. On supported machines, the firmware configuration utility (Thinkvantage->F1 on machine startup) has the option of enabling one or both UEFI/BIOS as well as providing the option to specify the order with which the machine tries to boot.
|
Current Status
Though the specification has been around since the late '90s, UEFI only recently started appearing on commodity hardware. Macs are a slight exception, though they do not strictly adhere to the UEFI standard. Linux can boot as usual in BIOS mode, however the ELILO boot loader or recent versions of Grub 2 are necessary to boot in UEFI mode. Linux 3.0-rc1 is reported to successfully boot in UEFI mode (details below), but older versions hang after the kernel gets loaded by grub.
Enabling UEFI boot in Debian
The following are steps to successfully boot in pure UEFI mode ("UEFI only" startup config menu). There are likely some that are redundant or unnecessary.
- Install 64-bit Debian in BIOS mode to an MBR partitioned disk.
- Install Kernel 3.0-rc1 or later. Enable CONFIG_EFI,CONFIG_FB_EFI,CONFIG_EFI_VARS,CONFIG_EFI_PARTITION.
- Create a small ~ 200MB Partition formatted to fat32 and enable the "boot" flag. The first partition is a good choice, but is not strictly required. The "boot" flag is also likely superstitious.
- Burn some form of live cd that allows you access your Debian install in case something goes wrong and you are unable to boot.
- Mount the fat32 partition at /boot/efi
sudo mkdir /boot/efi
sudo mount /dev/sda1 /boot/efi - Install the efi version of grub
aptitude install grub-efi-amd64 - Now run grub-install (ignore warnings about efivars)
sudo grub-install /dev/sda
sudo update-grub - This should have created /boot/efi/efi/debian/grubx64.efi. In order to make this actually work without running efibootmgr (which is not possible in bios mode), just copy it to /boot/efi/efi/boot/bootx64.efi
sudo mkdir /boot/efi/efi/boot/
sudo cp /boot/efi/efi/debian/grubx64.efi /boot/efi/efi/boot/bootx64.efi - Reboot, enter the Thinkvantage menu and set "UEFI only" or "UEFI First". Hopefully you still get a grub menu and it will actually boot the 3.0 kernel. Older kernels appear to freeze with a blank screen as soon as grub loads them.
Links
版本說明
ref:http://registerboy.pixnet.net/blog/post/19136842-trial-,-alpha-,-rc-,-beta-%E7%89%88%E6%9C%AC%E8%A7%A3%E9%87%8B
版本号:
V(Version):即版本,通常用数字表示版本号。
Build:用数字或日期标示版本号的一种方式。
SP:Service Pack,升级包。
授权和功能划分:
Trial:试用版,通常都有时间限制,有些试用版软件还在功能上做了一定的限制。可注册或购买成为正式版。
Unregistered:未注册版,通常没有时间限制,在功能上相对于正式版做了一定的限制。可注册或购买成为正式版。
Demo:演示版,仅仅集成了正式版中的几个功能,不能升级成正式版。
Lite:精简版。
Full:完整版。
开发阶段划分:
α(Alpha)版:内测版,内部交流或者专业测试人员测试用。Bug较多,普通用户最好不要安装。
β(Beta)版:公测版,专业爱好者大规模测试用,存在一些缺陷,该版本也不适合一般用户安装。
γ(Gamma)版 :相当成熟的测试版,与即将发行的正式版相差无几。
RC版:Release Candidate候选版本,处于Gamma阶段。从Alpha到Beta再到Gamma是改进的先后关系,但RC1、RC2往往是取舍关系。
Final:正式版。
语言划分:
SC:Simplified Chinese简体中文版。
GBK:简体中文汉字内码扩展规范版。
TC:Traditional Chinese繁体中文版。
BIG5:繁体中文大五码版。
UTF8:Unicode Transformation Format 8 bit,对现有的中文系统不是好的解决方案。
版本号:
V(Version):即版本,通常用数字表示版本号。
Build:用数字或日期标示版本号的一种方式。
SP:Service Pack,升级包。
授权和功能划分:
Trial:试用版,通常都有时间限制,有些试用版软件还在功能上做了一定的限制。可注册或购买成为正式版。
Unregistered:未注册版,通常没有时间限制,在功能上相对于正式版做了一定的限制。可注册或购买成为正式版。
Demo:演示版,仅仅集成了正式版中的几个功能,不能升级成正式版。
Lite:精简版。
Full:完整版。
开发阶段划分:
α(Alpha)版:内测版,内部交流或者专业测试人员测试用。Bug较多,普通用户最好不要安装。
β(Beta)版:公测版,专业爱好者大规模测试用,存在一些缺陷,该版本也不适合一般用户安装。
γ(Gamma)版 :相当成熟的测试版,与即将发行的正式版相差无几。
RC版:Release Candidate候选版本,处于Gamma阶段。从Alpha到Beta再到Gamma是改进的先后关系,但RC1、RC2往往是取舍关系。
Final:正式版。
语言划分:
SC:Simplified Chinese简体中文版。
GBK:简体中文汉字内码扩展规范版。
TC:Traditional Chinese繁体中文版。
BIG5:繁体中文大五码版。
UTF8:Unicode Transformation Format 8 bit,对现有的中文系统不是好的解决方案。
Alpha:
是内部测试版,一般不向外部发布,会有很多Bug.一般只有测试人员使用。
Beta:
也是测试版,这个阶段的版本会一直加入新的功能。在Alpha版之后推出。
RC:(Release Candidate)
顾名思义么 ! 用在软件上就是候选版本。系统平台上就是发行候选版本。RC版不会再加入新的功能了,主要着重于除错。
RTM:(Release to Manufacture)
是给工厂大量压片的版本,内容跟正式版是一样的,不过RTM版也有出限制、评估版的。但是和正式版本的主要程序代码都是一样的。
OEM:
是给计算机厂商随着计算机贩卖的,也就是随机版。只能随机器出货,不能零售。只能全新安装,不能从旧有操作系统升级。包装不像零售版精美,通常只有一面CD和说明书(授权书)。
是给计算机厂商随着计算机贩卖的,也就是随机版。只能随机器出货,不能零售。只能全新安装,不能从旧有操作系统升级。包装不像零售版精美,通常只有一面CD和说明书(授权书)。
RVL:
号称是正式版,其实RVL根本不是版本的名称。它是中文版/英文版文档破解出来的。
号称是正式版,其实RVL根本不是版本的名称。它是中文版/英文版文档破解出来的。
EVAL:
而流通在网络上的EVAL版,与“评估版”类似,功能上和零售版没有区别。
而流通在网络上的EVAL版,与“评估版”类似,功能上和零售版没有区别。
RTL:Retail(零售版)
是真正的正式版,正式上架零售版。在安装盘的i386文件夹里有一个eula.txt,最后有一行EULAID,就是你的版本。比如简体中文正式版是EULAID:WX.4_PRO_RTL_CN,繁体中文正式版是WX.4_PRO_RTL_TW。其中:如果是WX.开头是正式版,WB.开头是测试版。_PRE,代表家庭版;_PRO,代表专业版。
是真正的正式版,正式上架零售版。在安装盘的i386文件夹里有一个eula.txt,最后有一行EULAID,就是你的版本。比如简体中文正式版是EULAID:WX.4_PRO_RTL_CN,繁体中文正式版是WX.4_PRO_RTL_TW。其中:如果是WX.开头是正式版,WB.开头是测试版。_PRE,代表家庭版;_PRO,代表专业版。
Installing FreeBSD on a GPT disk
Synopsis:
These notes describe the general process for manually installing FreeBSD onto a GPT-partitioned hard disk.
Prerequisites:
- FreeBSD 8.1 RELEASE memstick image, written to a USB flash drive, or
- FreeBSD 8.1 RELEASE dvd1 image written to a DVD-R. (memstick and dvd1 images contain both a Fixit environment and the installation distfiles)
Process:
- Boot from the FreeBSD install DVD or USB stick and run the Fixit environment.
- Create new partition table on ad0 using GPT scheme:
- Add 'freebsd-boot' partition to contain boot code ('-s' argument specifies partition size in 512 byte blocks):
- Write Protective MBR to sector 0 of disk and gptboot code into freebsd-boot partition
- Add 'freebsd-swap' partition:
- Add appropriately sized 'freebsd-ufs' partitions for /, /var, /usr and /home filesystems (I use swap-based tmpfs for /tmp)
- List our partition table so far
- Format freebsd-ufs partitions (p3 will be the root partition so softupdates are not enabled with '-U')
- Mount partitions under /mnt:
- Install FreeBSD distribution to mounted filesystems:
- Copy GENERIC kernel to expected location:
- Create a new fstab
- The hard disk now contains a minimal, unconfigured FreeBSD installation and should be bootable. Exit the Fixit environment, exit Sysinstall and reboot. Remove the CD while the machine resets.
- FreeBSD should boot up cleanly. Perform basic configuration steps:
- Set root's password
- Create /etc/rc.conf, setting hostname, network interface configuration, sshd_enable, etc
- Set timezone by copying appropriate timezone file from /usr/share/zoneinfo/*/ to /etc/localtime
- Create non-root user account
# gpart create -s GPT ad0
# gpart add -t freebsd-boot -s 128 ad0
# gpart bootcode -b /dist/boot/pmbr -p /dist/boot/gptboot -i 1 ad0
# gpart add -t freebsd-swap -s 8388608 ad0
# gpart add -t freebsd-ufs -s 2097152 ad0 # gpart add -t freebsd-ufs -s 2097152 ad0 # gpart add -t freebsd-ufs -s 41942040 ad0 # gpart add -t freebsd-ufs ad0
# gpart show ad0
=> 34 312581741 ad0 GPT (149G)
34 128 1 freebsd-boot (64K)
162 8388608 2 freebsd-swap (4.0G)
8388770 2097152 3 freebsd-ufs (1.0G)
10485922 2097152 4 freebsd-ufs (1.0G)
12583074 41942040 5 freebsd-ufs (20G)
54525114 258056661 6 freebsd-ufs (123G)
# newfs ad0p3 # newfs -U ad0p4 # newfs -U ad0p5 # newfs -U ad0p6
# mount /dev/ad0p3 /mnt # cd /mnt # mkdir var usr home # mount /dev/ad0p4 /mnt/var # mount /dev/ad0p5 /mnt/usr # mount /dev/ad0p6 /mnt/home
# 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
# cd /mnt/boot # rmdir kernel # cp -Rp GENERIC kernel
# cd /mnt/etc # vi fstab /dev/ad0p3 / ufs rw 1 1 /dev/ad0p4 /var ufs rw 2 2 /dev/ad0p5 /usr ufs rw 2 2 /dev/ad0p6 /home ufs rw 2 2 /dev/ad0p2 none swap sw 0 0
About installing FreeBSD to GPT...
gpart create -s gpt ad2 gpart bootcode -b /boot/pmbr ad2 gpart add -s $(( $(du -sk /boot/gptboot | cut -f 1) * 2 )) -t freebsd-boot ad2 gpart bootcode -p /boot/gptboot -i 1 ad2 gpart add -s 2G -t freebsd-ufs ad2 gpart add -s 4G -t freebsd-swap ad2 gpart add -s 9G -t freebsd-ufs ad2 gpart add -s 17G -t freebsd-ufs ad2 gpart add -t freebsd-ufs ad2 gjournal label /dev/ad2p2 gjournal label /dev/ad2p4 gjournal label /dev/ad2p5 gjournal label /dev/ad2p6 newfs -J /dev/ad2p2.journal newfs -J /dev/ad2p4.journal newfs -J /dev/ad2p5.journal newfs -J /dev/ad2p6.journal mount /dev/ad2p2.journal /mnt cd /; pax -p e -r -w -v -X -Y -Z . /mnt umount /mnt mount /dev/ad2p4.journal /mnt cd /tmp; pax -p e -r -w -v -X -Y -Z . /mnt umount /mnt mount /dev/ad2p5.journal /mnt cd /var; pax -p e -r -w -v -X -Y -Z . /mnt umount /mnt mount /dev/ad2p6.journal /mnt cd /usr; pax -p e -r -w -v -X -Y -Z . /mnt umount /mnt |
GPT
PRÉPARATION DU DISQUE AD2
Pour le fun je me suis dis que j'allais partitionner mon disque au format GPT, puisque c'est à la mode (ça sert à rien dans mon cas, mais je voulais jouer avec)
j'ai donc détruit le partionnement existant :
$ gpart destroy ad2
Puis recréer en précisant le système de partitionnement GPT
$ gpart create -s GPT ad2
Une vérification que tout c'est bien passé :
$ gpart show
=> 34 156301421 ad2 GPT (75G)
34 156301421 - free - (75G)
Les BIOS classiques ne sont pas capable de booter sur du GPT, mais sous FreeBSD il y a une astuce qui marche impeccable
$ gpart add -b 34 -s 16 -t freebsd-boot ad2
$ gpart bootcode -b /boot/pmbr ad2
$ cp /boot/gptboot /tmp
$ dd if=/dev/zero bs=641 count=1 >> /tmp/gptboot
$ dd if=/tmp/gptboot of=/dev/ad2p1 bs=512
ainsi le système est bootable;
j'ai plus qu'à recréer mes partitions
$ gpart add -b 50 -s 20971520 -t freebsd-ufs ad2
$ gpart add -b 20971570 -s 4194304 -t freebsd-swap ad2
$ gpart add -b 25165874 -s 131135581 -t freebssd-ufs ad2
Vérification :
$ gpart show
=> 34 156301421 ad2 GPT (75G)
34 16 1 freebsd-boot (8.0K)
50 20971520 2 freebsd-ufs (10G)
20971570 4194304 3 freebsd-swap (2.0G)
25165874 131135581 4 freebsd-ufs (63G)
maintenant j'active le gjournal pour les partitions ufs
$ gjournal label /dev/ad2p2
$ gjournal label /dev/ad2p4
On format le tout (pour rappel sous freebsd pas besoin de formatter les partitions swap
$ newfs -J -L root /dev/ad2p2.journal
$ newfs -J -L home /dev/ad2p4.journal
Le -L signifie que l'on écrit un label ainsi les partitions sont facilement montable grâce à GLABEL qui les représente sous la forme : /dev/ufs/LABEL
MIGRATION DES DONNÉES
maintenant il s'agit de migrer le contenu des partitions / et /home sur les nouvelles le tout à chaud :
$ mkdir /newroot
$ mount -o async /dev/ufs/root /newroot
$ cd /newroot
$ dump -0uanL -f - / | restore -rf -
$ mkdir /home2
$ mount -o async /dev/ufs/home /home2
$ cd /home2
$ dump -0uanL -f - /home | restore -rf -
il faut pour finir modifier la fstab du nouveau root pour rajouter :
- /dev/ufs/root comme partition / (et rajouter l'option async)
- /dev/ufs/home comme partition /home (et mettre l'option async)
- /dev/ad2p3 comme swap
Le fichier /etc/fstab obtenu est donc :
# Device Mountpoint FStype Options Dump Pass#
/dev/ad2p3 none swap sw 0 0
/dev/ufs/root / ufs rw,async 1 1
/dev/ufs/bapt /home ufs rw,async 1 1
Il ne reste plus qu'à rebooter dessus.
FREEBSD 使用gpart建立超過2tb的分割區
ref:http://hd-inky.blogspot.com/2010/07/freebsd-gpart2tb.html
FREEBSD 使用gpart建立超過2tb的分割區
gpart 是 GEOM framework 裡的 tool,
透過它可以支援 multiple partitioning schemes,
在 FreeBSD 7 開始比較建議使用 gpart 而不是 gpt。
gpart跟gpt的指令參數不太一樣 不能直接套用
# gpart create -s GPT da2
# gaprt show
=> 6 1953124597 da2 GPT (7.3T)
6 1953124597 - free - (7.3T)
# gpart add -b 6 -s 1953124597 -t freebsd-ufs da2
da2p1 added
-b -s -t 這三個參數必填
-b是start , -s 是size -t是fs_type
# gpart show
=> 6 1953124597 da2 GPT (7.3T)
6 1953124597 1 freebsd-ufs (7.3T)
# newfs -O2 -b 65536 -f 8192 -U /dev/da2p1
# mount /dev/da2p1 /raid1
#df -h
Filesystem Size Used Avail Capacity Mounted on
/dev/da0s1a 62G 3.7G 54G 6% /
devfs 1.0K 1.0K 0B 100% /dev
/dev/da2p1 7.2T 16K 6.6T 0% /raid1
透過它可以支援 multiple partitioning schemes,
在 FreeBSD 7 開始比較建議使用 gpart 而不是 gpt。
gpart跟gpt的指令參數不太一樣 不能直接套用
# gpart create -s GPT da2
# gaprt show
=> 6 1953124597 da2 GPT (7.3T)
6 1953124597 - free - (7.3T)
# gpart add -b 6 -s 1953124597 -t freebsd-ufs da2
da2p1 added
-b -s -t 這三個參數必填
-b是start , -s 是size -t是fs_type
# gpart show
=> 6 1953124597 da2 GPT (7.3T)
6 1953124597 1 freebsd-ufs (7.3T)
# newfs -O2 -b 65536 -f 8192 -U /dev/da2p1
# mount /dev/da2p1 /raid1
#df -h
Filesystem Size Used Avail Capacity Mounted on
/dev/da0s1a 62G 3.7G 54G 6% /
devfs 1.0K 1.0K 0B 100% /dev
/dev/da2p1 7.2T 16K 6.6T 0% /raid1
Install FreeBSD with GPT partitions ...
ref: http://www.freebsdonline.com/content/view/732/531/
For now sysinstall does not support GPT partition. So everything must be installed manualy but it is easy. This quick tutorial show you stept by step installation using GPT partitions. Why GPT? Better support for bigger drives (>2TB) and up to 128 partitions instead of 4.
Step 1. Partitioning the drive
----------------------------------We boot from FreeBSD 8.2 USB image and then we go to Fixit menu and then from there we mount USB Live image, that has all necessary tools to install FreeBSD.
First we will initialize the drive to support GPT partitions:
gpart create -s GPT ad0
Then we will proceed creating partitions. We will create partitions for boot, root, tmp, var, usr.
gpart add -s 128 -t freebsd-boot -l boot ad0 # for boot (1)
gpart add -s 5G -t freebsd-ufs -l root ad0 # for / (root) (2)
gpart add -s 4G -t freebsd-ufs -l tmp ad0 # for tmp (3)
gpart add -s 4G -t freebsd-swap -l swap ad0 # for swap (4)
gpart add -s 10G -t freebsd-ufs -l var ad0 # for var (5)
gpart add -s 200G -t freebsd-ufs -l usr ad0 # for usr and home (6)
To see partitions you've just created use:
gpart show ad0
To see partition with labels use:
gpart show -l ad0
To delete a partiton use:
gpart delete -i3 ad0 # where 3 is third partiton.
If you want to remove GPT table from drive ad0 run (in case you want start partitioning process again):
gpart destroy ad0
Now we will place the MBR code in our freebsd-boot partition:
gpart bootcode -b /mnt2/boot/pmbr -p /mnt2/boot/gptboot -i 1 ad0
We need now to newfs (format) our newly created partitions:
newfs -U /dev/ad0p2
newfs -U /dev/ad0p3
newfs -U /dev/ad0p5
newfs -U /dev/ad0p6
We will mount now all partitions to install FreeBSD on them:
mount /dev/ad0p2 /mnt
mkdir /mnt/boot /mnt/tmp /mnt/var /mnt/usr
mount /dev/ad0p3 /mnt/tmp
mount /dev/ad0p5 /mnt/var mount /dev/ad0p6 /mnt/usr
Step 2. Installing FreeBSD
-------------------------------We will now use the install.sh script from our FreeBSD USB Image:
export DESTDIR=/mnt
cd /dist/8.2-RELEASE
for dir in base catpages dict doc info lib32 manpages; do (cd $dir; ./install.sh); done
If you install FreeBSD i386 you will not need lib32 in the for loop.
Now we install the kernel:
cd kernels
./install.sh GENERIC
We install the sources:
cd ..
cd src
./install.sh all
We copy the kernel in /mnt/boot/kernel directory:
cd /mnt/boot
rmdir kernel
cp -Rp GENERIC kernel
Step 3. Configuring FreeBSD
-----------------------------------
Last step is to configure FreeBSD by creating /etc/fstab, /etc/resolv.conf and /etc/rc.conf files.
We edit /mnt/etc/resolv.conf file and add our dns there:
nameserver 208.67.220.220 # that is your ISP's DNS
We create /etc/rc.conf with the following content (asuming em0 is our network card):
hostname="server"
ifconfig_em0="inet 10.0.0.2 netmask 255.255.255.0"
sshd_enable="YES"
/dev/ad0p4 none swap sw 0 0
/dev/ad0p2 / ufs rw 1 1
/dev/ad0p3 /tmp ufs rw 2 2
/dev/ad0p6 /usr ufs rw 2 2
/dev/ad0p5 /var ufs rw 2 2
/dev/cd0 /cdrom cd9660 ro,noauto 0 0
GPT Partitioning Tips
----------------------- If you get the error "Device Busy" when you try to delete GPT from drive with gpart delete ad0 , you can succesfully delete GPT if you turn of the safety with sysctl variable:
sysctl kern.geom.debugflags=16
- If you want to destroy GPT table from the drive with gpart delete ad0 command you must first delete all partitions (Otherwise you might get "Device Busy" error.
For now sysinstall does not support GPT partition. So everything must be installed manualy but it is easy. This quick tutorial show you stept by step installation using GPT partitions. Why GPT? Better support for bigger drives (>2TB) and up to 128 partitions instead of 4.
Step 1. Partitioning the drive
----------------------------------We boot from FreeBSD 8.2 USB image and then we go to Fixit menu and then from there we mount USB Live image, that has all necessary tools to install FreeBSD.
First we will initialize the drive to support GPT partitions:
gpart create -s GPT ad0
Then we will proceed creating partitions. We will create partitions for boot, root, tmp, var, usr.
gpart add -s 128 -t freebsd-boot -l boot ad0 # for boot (1)
gpart add -s 5G -t freebsd-ufs -l root ad0 # for / (root) (2)
gpart add -s 4G -t freebsd-ufs -l tmp ad0 # for tmp (3)
gpart add -s 4G -t freebsd-swap -l swap ad0 # for swap (4)
gpart add -s 10G -t freebsd-ufs -l var ad0 # for var (5)
gpart add -s 200G -t freebsd-ufs -l usr ad0 # for usr and home (6)
To see partitions you've just created use:
gpart show ad0
To see partition with labels use:
gpart show -l ad0
To delete a partiton use:
gpart delete -i3 ad0 # where 3 is third partiton.
If you want to remove GPT table from drive ad0 run (in case you want start partitioning process again):
gpart destroy ad0
Now we will place the MBR code in our freebsd-boot partition:
gpart bootcode -b /mnt2/boot/pmbr -p /mnt2/boot/gptboot -i 1 ad0
We need now to newfs (format) our newly created partitions:
newfs -U /dev/ad0p2
newfs -U /dev/ad0p3
newfs -U /dev/ad0p5
newfs -U /dev/ad0p6
We will mount now all partitions to install FreeBSD on them:
mount /dev/ad0p2 /mnt
mkdir /mnt/boot /mnt/tmp /mnt/var /mnt/usr
mount /dev/ad0p3 /mnt/tmp
mount /dev/ad0p5 /mnt/var mount /dev/ad0p6 /mnt/usr
Step 2. Installing FreeBSD
-------------------------------We will now use the install.sh script from our FreeBSD USB Image:
export DESTDIR=/mnt
cd /dist/8.2-RELEASE
for dir in base catpages dict doc info lib32 manpages; do (cd $dir; ./install.sh); done
If you install FreeBSD i386 you will not need lib32 in the for loop.
Now we install the kernel:
cd kernels
./install.sh GENERIC
We install the sources:
cd ..
cd src
./install.sh all
We copy the kernel in /mnt/boot/kernel directory:
cd /mnt/boot
rmdir kernel
cp -Rp GENERIC kernel
Step 3. Configuring FreeBSD
-----------------------------------
Last step is to configure FreeBSD by creating /etc/fstab, /etc/resolv.conf and /etc/rc.conf files.
We edit /mnt/etc/resolv.conf file and add our dns there:
nameserver 208.67.220.220 # that is your ISP's DNS
We create /etc/rc.conf with the following content (asuming em0 is our network card):
/etc/rc.conf
defaultrouter="10.0.0.1"hostname="server"
ifconfig_em0="inet 10.0.0.2 netmask 255.255.255.0"
sshd_enable="YES"
We must create an /etc/fstab file with the following content:
/etc/fstab
# Device Mountpoint FStype Options Dump Pass#/dev/ad0p4 none swap sw 0 0
/dev/ad0p2 / ufs rw 1 1
/dev/ad0p3 /tmp ufs rw 2 2
/dev/ad0p6 /usr ufs rw 2 2
/dev/ad0p5 /var ufs rw 2 2
/dev/cd0 /cdrom cd9660 ro,noauto 0 0
GPT Partitioning Tips
----------------------- If you get the error "Device Busy" when you try to delete GPT from drive with gpart delete ad0 , you can succesfully delete GPT if you turn of the safety with sysctl variable:
sysctl kern.geom.debugflags=16
- If you want to destroy GPT table from the drive with gpart delete ad0 command you must first delete all partitions (Otherwise you might get "Device Busy" error.
訂閱:
文章 (Atom)
- 天旋地轉
- [轉載] 如何將vc 的lib包成dll
- 我的第一支Facebook應用程式
- How to build LAMP ( Linux+Apache 2.2+MySQL 5.1+PHP 5.3) on Ubuntu 910
- [轉載]Howto Install OpenGL Development Environment
- [轉貼] GRUB 運作原理
- 2019年2月9日勾財天女法會後的感想抒發~
- Where are the Apache Configuration files on Mac?
- KernelIoControl [轉載]
- Testing GRUB 2 on your GPT-partitioned flash drive