FreeBSD 9.0 的 GPT 纯 ZFS 安装

FreeBSD 9.0 的 GPT 纯 ZFS 安装

注意

由于 FreeBSD 9.0 采用了新的 bsdinstall,官方的 WIKI 指出,原先的 GPT ZFS boot 安装方法可能会不适用(未验证),故有此文。

本文介绍的是基于 GPT 以 ZFS 为根分区安装 FreeBSD 9.0-Release。
本文基于 官网这篇文章 翻译而来,并且实际操作过。
原文修订日期(注意更新): 2012-05-01 19:57:09 by PaulChvostek

4K对齐:

下文出现 gpart add 的地方增加参数 -a 4k
创建 zpool 之前,执行 gnop create -S 4096 ada0p3(第三个分区,-S为大写)
创建 zpool 时,/dev/gpt/disk0 改为 ada0p3.nop
zpool export 之后 import 之前,执行 gnop destroy ada0p3.nop

步骤

1.从 FreeBSD 的 CD1安装盘/DVD安装盘/USB Memstick 启动

2.进入安装界面后,到了 「Partitioning」(分区)这一步时,选择 「Shell」 选项

3.创建分区

#1.将硬盘设为 GPT 分区格式。
#
gpart create -s gpt ada0 #假设你有两块硬盘,这是第一块。
gpart create -s gpt ada1 #没有第二块硬盘则略过。
#2.在第一块硬盘上,分别创建标签(label)名为 boot0, swap0, disk0 这三个分区,最后把引导码写入第1个分区,即 boot0。
#
#gpart add:添加分区
#    -s 指定分区大小,-t 指定分区类型,
#    -l 指定标签名字,可以自由取名,记得前后一致,
#    ada0 是 /dev 下面的设备名字,这里是第一块硬盘。
#
#gpart bootcode: 安装引导码
#    -b -p (无需改动,照抄即可)
#    -i 指定分区的编号,从1开始。这里第一个创建的是 boot0,要写入 boot0, 所以是1。
#
gpart add -s 64K -t freebsd-boot -l boot0 ada0
gpart add -s 8G -t freebsd-swap -l swap0 ada0
gpart add -t freebsd-zfs -l disk0 ada0
gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada0
#针对第二块硬盘,没有则略过。
gpart add -s 64K -t freebsd-boot -l boot1 ada1
gpart add -s 8G -t freebsd-swap -l swap1 ada1
gpart add -t freebsd-zfs -l disk1 ada1
gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada1
#3.创建 zpool 和 zfs
#
#「zroot」是zpool的名字,可随意起名,注意保持一致。
#如果你有两块硬盘,可用 mirror(RAID 1) 模式组建。
zpool create -o altroot=/mnt zroot mirror /dev/gpt/disk0 /dev/gpt/disk1
#如果你只有一块硬盘
zpool create -o altroot=/mnt zroot /dev/gpt/disk0
#下列分区跟据需要自行修改
zfs create zroot/tmp
chmod 1777 /mnt/tmp
zfs create zroot/usr
zfs create zroot/var
zfs create zroot/home
exit

4.退出 shell 之后,继续安装

5.当问及「create partitions」(创建分区)时,选择「Shell」,然后直接输入 exit (刚才我们已经分好了)

6.安装和配置结束后,选择「Live CD」选项,以用户名 root 登录

7.修正挂载点和 cachefile(zpool缓存文件,记录了存储池的所有配置信息)

echo ‘zfs_enable="YES"’ >> /mnt/etc/rc.conf
echo ‘zfs_load="YES"’ >> /mnt/boot/loader.conf
echo ‘vfs.root.mountfrom="zfs:zroot"’ >> /mnt/boot/loader.conf
zfs unmount -a
zpool export zroot
zpool import -o cachefile=/tmp/zpool.cache -o altroot=/mnt zroot
zfs set mountpoint=/ zroot
cp /tmp/zpool.cache /mnt/boot/zfs/
zfs unmount -a
zpool set bootfs=zroot zroot
zpool set cachefile=” zroot
zfs set mountpoint=/tmp zroot/tmp
zfs set mountpoint=/usr zroot/usr
zfs set mountpoint=/var zroot/var
zfs set mountpoint=/home zroot/home

8.输入 reboot,完成安装

 

原文链接:https://wiki.freebsdchina.org/doc/z/gptzfsboot

FreeBSD 9.0 安装入门教程

FreeBSD 9.0 安装入门教程

在 ftp 中看到了 9.0 的 release 安装镜像于是没事 down 过来捣腾一下。貌似安装过程有了新的变化,于是又了这个入门的东东,水平有限,欢迎指正,谢谢。

所有测试没有使用物理机安装,采用的是 VirtualBox 4.1.8 ,本人机器上面的 VM 版本过老,无法安装。
硬件配置 内存分配了 512M 硬盘分配了 4G
CPU 是 intel 的 所以下载的是 I386 版本的

安装开始
1、 安装 log 界面换了

image

PS:实话说 那个东东我看了半天都木有分清楚是猫科类动物还是什么生物。

2、 选择【1】安装 10 秒默认安装

3、 安装界面确实不同了,开始估计会不习惯,不过没关系,新的安装其实更加简单的。

image

3 个选项 第一安装,第二个是shell 估计也可以用来安装吧,水平有限木有尝试,最后一个
是光盘镜像系统,估计用来处错使用的。
选择【install】回车即可

4、询问选择键盘

image

无特殊要求 选择【yes】

5、选择键盘语言种类

image

默认吧

6、设置hostname

image

可以按 【esc】 跳过,建议设置

7、选择需要安装的资源
第一个是 doc 文档估计是帮助文档,说明文档之类的
第二个是 games
第三个是ports 树(建议不要选择,安装比较耗时,我用虚拟机安装到最后报错)
第四个是 src 源代码呗。

image

按空格选择 上下键移动

8、硬盘分区设置
第一个是安装他的步骤引导操作
第二个应该是专家模式的
第三个是shell 模式

image

选择【Guided】

9、配置分区
第一个是整个硬盘
第二个是选择分区(木有尝试成功)

image

选择 【entire disk】

10、分区设置
若是以前安装过早期版本的freebsd 估计这个懂的
你若是需要配置硬盘分区大小就在这里设置
一般是 auto 然后 finish

image

这个是数据提醒

image

配置好后 选择 【finish】

11、选择 提交 【commit】

image

12、格式化完就好开始验证文件 然后 就开始安装了
若是在 第7 步没有选择 games 和port 就只有两项

image

开始安装 比较耗时 如果选择了 ports

image

13、安装完开始系统配置

设置密码

image

14、配置网卡

image

是否配置IPv4

image

是否DHCP 看个人需求配置

image

配置IP 地址

image

image

有配置IPV6 的选项

15、时间配置
在国内要配置时区

image

image

16、用户配置
可以以后进行配置。

image

好差不多完成了
若是刚配置的有问题可以在这里可以进行综合一点的配置。

image

如服务配置
可以开启鼠标。

image

基本完成重启吧。

image

附安装后的图片

image

提示若是不习惯使用新版本的安装向导完全可以使用原来的安装配置

只要 root 用户输入 sysinstall 即可

image

若是大牛说,新版本安装方式很烂啊,完全不习惯怎么办呢?
很简单啦,在第3 部直接选择 【shell】
然后输入 sysinstall 嘿嘿,老的方式安装,
水平有限,大家若是想用鸡蛋砸我,真心请不要那样。

By Ndk 2012-1-8
谢谢。
PS:哪天有时间折腾一个FreeBSD 9.0 + Gnome 的入门教程

FreeBSD 9.0-RELEASE发布了

The FreeBSD Release Engineering Team is pleased to announce the availability
of FreeBSD 9.0-RELEASE. This is the first release from the stable/9 branch,
which improves on stable/8 and adds many new features. Some of the
highlights:

– A new installer, bsdinstall(8) has been added and is the installer
used by the ISO images provided as part of this release
– The Fast Filesystem now supports softupdates journaling
– ZFS updated to version 28
– Updated ATA/SATA drivers support AHCI, moved into updated CAM
framework
– Highly Available Storage (HAST) framework
– Kernel support for Capsicum Capability Mode, an experimental
set of features for sandboxing support
– User-level DTrace
– The TCP/IP stack now supports pluggable congestion control framework
and five congestion control algorithm implementations available
– NFS subsystem updated, new implementation supports NFSv4 in
addition to NFSv3 and NFSv2
– High Performance SSH (HPN-SSH)
– Flattened device tree (FDT), simplifying FreeBSD configuration
for embedded platforms
– The powerpc architecture now supports Sony Playstation 3
– The LLVM compiler infrastructure and clang have been imported
– Gnome version 2.32.1, KDE version 4.7.3

For a complete list of new features and known problems, please see the
online release notes and errata list, available at:

http://www.FreeBSD.org/releases/9.0R/relnotes.html http://www.FreeBSD.org/releases/9.0R/errata.html
For more information about FreeBSD release engineering activities,
please see:

http://www.FreeBSD.org/releng/
Dedication
———-

The FreeBSD Project dedicates the FreeBSD 9.0-RELEASE to the memory of
Dennis M. Ritchie, one of the founding fathers of the UNIX[tm] operating
system. It is on the foundation laid by the work of visionaries like Dennis
that software like the FreeBSD operating system came to be. The fact that
his work of so many years ago continues to influence new design decisions
to this very day speaks for the brilliant engineer that he was.

May he rest in peace.

Availability
————-

FreeBSD 9.0-RELEASE is now available for the amd64, i386, ia64, powerpc,
powerpc64, and sparc64 architectures.

FreeBSD 9.0 can be installed from bootable ISO images or over the
network. Some architectures also support installing from a USB memory
stick. The required files can be downloaded via FTP or BitTorrent as
described in the sections below. While some of the smaller FTP mirrors
may not carry all architectures, they will all generally contain the more
common ones such as amd64 and i386.

NOTE: A problem was discovered with the DVD images for amd64 and i386
architectures shortly after they were loaded on the FTP distribution
server. Those images have since been replaced and we have allowed
enough time that the newer images should have distributed to all the
FTP servers that carry the release. If you downloaded the amd64 or
i386 DVD images prior to this announcement it would be a good idea to
verify the checksums of the image you downloaded with the checksums
provided as part of this Release Announcement. The only thing wrong
with the images that were replaced is that sysinstall(8) can not be used
to install the pre-built packages on the DVD. Other than that there is
nothing different on the updated images. The bad DVD images were never
available on BitTorrent.

MD5 and SHA256 hashes for the release ISO and memory stick images are
included at the bottom of this message.

The purpose of the images provided as part of the release are as follows:

dvd1: This contains everything necessary to install the base FreeBSD
operating system, the documentation, and a small set of pre-built
packages aimed at getting a graphical workstation up and running.
It also supports booting into a "livefs" based rescue mode. This
should be all you need if you can burn and use DVD-sized media.

disc1: This contains the base FreeBSD operating system. It also supports
booting into a "livefs" based rescue mode. There are no pre-built
packages.

bootonly: This supports booting a machine using the CDROM drive but
does not contain the support for installing FreeBSD from the
CD itself. You would need to perform a network based install
(e.g. from an FTP server) after booting from the CD.

memstick: This can be written to an USB memory stick (flash drive) and
used to do an install on machines capable of booting off USB
drives. It also supports booting into a "livefs" based rescue
mode. There are no pre-built packages.

As one example of how to use the memstick image, assuming the USB drive
appears as /dev/da0 on your machine something like this should work:

# dd if=FreeBSD-9.0-RELEASE-amd64-memstick.img of=/dev/da0 bs=10240 conv=sync

Be careful to make sure you get the target (of=) correct.

FreeBSD 9.0-RELEASE can also be purchased on CD-ROM or DVD from several
vendors. One of the vendors that will be offering FreeBSD 9.0-based
products is:

~ FreeBSD Mall, Inc. http://www.freebsdmall.com/
BitTorrent
———-

9.0-RELEASE ISOs are available via BitTorrent. A collection of torrent
files to download the images is available at:

http://torrents.freebsd.org:8080/

FTP

At the time of this announcement the following FTP sites have
FreeBSD 9.0-RELEASE available.

ftp://ftp.freebsd.org/pub/FreeBSD/releases/ISO-IMAGES/9.0/
ftp://ftp5.freebsd.org/pub/FreeBSD/releases/ISO-IMAGES/9.0/
ftp://ftp7.freebsd.org/pub/FreeBSD/releases/ISO-IMAGES/9.0/
ftp://ftp8.freebsd.org/pub/FreeBSD/releases/ISO-IMAGES/9.0/
ftp://ftp.au.freebsd.org/pub/FreeBSD/releases/ISO-IMAGES/9.0/
ftp://ftp.cn.freebsd.org/pub/FreeBSD/releases/ISO-IMAGES/9.0/
ftp://ftp.cz.freebsd.org/pub/FreeBSD/releases/ISO-IMAGES/9.0/
ftp://ftp.dk.freebsd.org/pub/FreeBSD/releases/ISO-IMAGES/9.0/
ftp://ftp.fr.freebsd.org/pub/FreeBSD/releases/ISO-IMAGES/9.0/
ftp://ftp.jp.freebsd.org/pub/FreeBSD/releases/ISO-IMAGES/9.0/
ftp://ftp.ru.freebsd.org/pub/FreeBSD/releases/ISO-IMAGES/9.0/
ftp://ftp.tw.freebsd.org/pub/FreeBSD/releases/ISO-IMAGES/9.0/
ftp://ftp.uk.freebsd.org/pub/FreeBSD/releases/ISO-IMAGES/9.0/
ftp://ftp2.us.freebsd.org/pub/FreeBSD/releases/ISO-IMAGES/9.0/
ftp://ftp10.us.freebsd.org/pub/FreeBSD/releases/ISO-IMAGES/9.0/
ftp://ftp.za.freebsd.org/pub/FreeBSD/releases/ISO-IMAGES/9.0/

However before trying these sites please check your regional mirror(s)
first by going to:

ftp://ftp.<yourdomain>.FreeBSD.org/pub/FreeBSD
Any additional mirror sites will be labeled ftp2, ftp3 and so on.

More information about FreeBSD mirror sites can be found at:

http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/mirrors-ftp.html
For instructions on installing FreeBSD or updating an existing machine to
9.0-RELEASE please see:

http://www.FreeBSD.org/releases/9.0R/installation.html
Support
——-

The FreeBSD Security Team currently plans to support FreeBSD 9.0 until
January 31st, 2013. For more information on the Security Team and their
support of the various FreeBSD branches see:

http://www.freebsd.org/security/
Other Projects Based on FreeBSD
——————————-

There are many "third party" Projects based on FreeBSD. The Projects
range from re-packaging FreeBSD into a more "novice friendly" distribution
to making FreeBSD available on Amazon’s EC2 infrastructure. For more
information about these Third Party Projects see:

http://wiki.freebsd.org/3rdPartyProjects
Acknowledgments
—————

Many companies donated equipment, network access, or man-hours to
support the release engineering activities for FreeBSD 9.0 including
The FreeBSD Foundation, Yahoo!, NetApp, Internet Systems Consortium,
Sentex Communications, New York Internet, Juniper Networks, and
iXsystems.

The release engineering team for 9.0-RELEASE includes:

Ken Smith <kensmith@FreeBSD.org> Release Engineering,
amd64, i386, sparc64 Release Building,
Mirror Site Coordination
Robert Watson <rwatson@FreeBSD.org> Release Engineering, Security
Konstantin Belousov <kib@FreeBSD.org> Release Engineering
Marc Fonvieille <blackend@FreeBSD.org> Release Engineering, Documentation
Josh Paetzel <jpaetzel@FreeBSD.org>    Release Engineering
Hiroki Sato <hrs@FreeBSD.org> Release Engineering, Documentation
Bjoern Zeeb <bz@FreeBSD.org> Release Engineering
Marcel Moolenaar <marcel@FreeBSD.org> ia64, powerpc Release Building
Nathan Whitehorn <nwhitehorn@FreeBSD.org> powerpc64 Release Building
Joe Marcus Clarke <marcus@FreeBSD.org> Package Building
Erwin Lansing <erwin@FreeBSD.org> Package Building
Mark Linimon <linimon@FreeBSD.org> Package Building
Pav Lucistnik <pav@FreeBSD.org> Package Building
Ion-Mihai Tetcu <itetcu@FreeBSD.org> Package Building
Martin Wilke <miwi@FreeBSD.org> Package Building, Ports Security
Colin Percival <cperciva@FreeBSD.org> Security Officer

Trademark
———

FreeBSD is a registered trademark of The FreeBSD Foundation.

ISO Image Checksums
——————-

MD5 (FreeBSD-9.0-RELEASE-amd64-bootonly.iso) = 477019a305797186a8b3e4147f44edec
MD5 (FreeBSD-9.0-RELEASE-amd64-disc1.iso) = b23ef73412bd50ed62ef8613ca1a4199
MD5 (FreeBSD-9.0-RELEASE-amd64-dvd1.iso) = 61221643ebeefeeb74bd552311e07070
MD5 (FreeBSD-9.0-RELEASE-amd64-memstick.img) = b37217292ad626d6ab2d3a9c1d215d2d

MD5 (FreeBSD-9.0-RELEASE-i386-bootonly.iso) = 70b4b0dd42c309da79ce63ba2789cfe3
MD5 (FreeBSD-9.0-RELEASE-i386-disc1.iso) = 5bf615f286ee6eeb3ecce45bd8d1622c
MD5 (FreeBSD-9.0-RELEASE-i386-dvd1.iso) = fee32ba2041285b971daf7ea429e36e4
MD5 (FreeBSD-9.0-RELEASE-i386-memstick.img) = 79ddd8f3422e209ae9bd11fee4e399eb

MD5 (FreeBSD-9.0-RELEASE-ia64-bootonly.iso) = 5c83f9a5bf359b2971059d1664ef5f7e
MD5 (FreeBSD-9.0-RELEASE-ia64-memstick) = ee1d5196eb281966b9ef95b953a36d8d
MD5 (FreeBSD-9.0-RELEASE-ia64-release.iso) = 73ca213db21379eb2527dcea37eeb824

MD5 (FreeBSD-9.0-RELEASE-powerpc-bootonly.iso) = bfe036760daac0cddfe8ce2915eaec54
MD5 (FreeBSD-9.0-RELEASE-powerpc-memstick) = e7a09f343ee248ee538954b39549c241
MD5 (FreeBSD-9.0-RELEASE-powerpc-release.iso) = 2431f52b2f9cc1951b0e568b3cd0f126

MD5 (FreeBSD-9.0-RELEASE-powerpc64-bootonly.iso) = 377714742e5f2e16e34b7818347d4e3f
MD5 (FreeBSD-9.0-RELEASE-powerpc64-memstick) = 9e4ee64a7460c3c930d0e3e2e3cd03b9
MD5 (FreeBSD-9.0-RELEASE-powerpc64-release.iso) = 347e51ceb3e65c1eff3cc3acdb519ffb

MD5 (FreeBSD-9.0-RELEASE-sparc64-bootonly.iso) = 81778b8ee1a8881b8597ee4275cc3b4e
MD5 (FreeBSD-9.0-RELEASE-sparc64-disc1.iso) = a63a07e3c45275568db2cead1b3e7167

SHA256 (FreeBSD-9.0-RELEASE-amd64-bootonly.iso) = d16fd5f32c9483177a01241f37ed84f347484c65e52aba4dbf8a2f3108fb457d
SHA256 (FreeBSD-9.0-RELEASE-amd64-disc1.iso) = bcc69320cd2f227411d55967113abc8ffa5ede0a6526090ca3fb5ab776fead9d
SHA256 (FreeBSD-9.0-RELEASE-amd64-dvd1.iso) = f338e24645f0bcc792b8417411ed737d8057cd2f470f9d2b601c143352d6d459
SHA256 (FreeBSD-9.0-RELEASE-amd64-memstick.img) = b8c964f362200d758e06dc6ea8dd556a4d6fedc2f3cd44c300318d9c2f4fb7a5

SHA256 (FreeBSD-9.0-RELEASE-i386-bootonly.iso) = e655de649040269ffdaa40179c3b91c59c8febef7486e340c3a5a5493097366d
SHA256 (FreeBSD-9.0-RELEASE-i386-disc1.iso) = b03df5fbd345781cab7dcab1fd0ea4d84c7c48712a6035476a709e6c0d5763f0
SHA256 (FreeBSD-9.0-RELEASE-i386-dvd1.iso) = ebc75ecdbd0580fbe9e59373962e0fc452c4480082af563e5cd765aca1ecd705
SHA256 (FreeBSD-9.0-RELEASE-i386-memstick.img) = 99193a7895109d415936ba89e4f2c24227af48f064073dee7c4b49722c3656f8

SHA256 (FreeBSD-9.0-RELEASE-ia64-bootonly.iso) = 1d25fc52d868877eb3cbdc012be895827f9c2bd808f886755d7ca2e9257af108
SHA256 (FreeBSD-9.0-RELEASE-ia64-memstick) = af147d20765bdbe6f71a8fb113fdba64de4d152b554c1fc8d78dc6f941e4737c
SHA256 (FreeBSD-9.0-RELEASE-ia64-release.iso) = 289f31e0dadfa46f51e9a44e26cd9cf6652ff4b5a631a21dca065dcd0d66890d

SHA256 (FreeBSD-9.0-RELEASE-powerpc-bootonly.iso) = 7ca03f71d2dd0cad929d0005601b4c994a54b02ab140d4218fa326b0fce7dad8
SHA256 (FreeBSD-9.0-RELEASE-powerpc-memstick) = 042bb4d473b615cf0d3c46d48d4db1fb457a54695e6ef3e47ee1b2dc6a4f3d9b
SHA256 (FreeBSD-9.0-RELEASE-powerpc-release.iso) = 0a7af5c74ebc0e13e79dfde03d54d3d752f3c71aff39659406ad6e5bcc0cefc3

SHA256 (FreeBSD-9.0-RELEASE-powerpc64-bootonly.iso) = 2eb5f141fb702a9c757f91a54ff8ea5ded13d51b29dfa86e5ba6bfbe9bb8e48e
SHA256 (FreeBSD-9.0-RELEASE-powerpc64-memstick) = 91648a0377cd4cf8dc5453e48416dd16ac99a30e5439534053a1ca16f9944a0d
SHA256 (FreeBSD-9.0-RELEASE-powerpc64-release.iso) = 17ab67fe62e1da232038b1ff598be1aef5fe8ccea620e0fbd67d8e262992fd66

SHA256 (FreeBSD-9.0-RELEASE-sparc64-bootonly.iso) = 1f633899cf42be1fecc61f82aa9fd9197da0cf88dda25aabbbf67250653459f5
SHA256 (FreeBSD-9.0-RELEASE-sparc64-disc1.iso) = 8414abb3a501a9f712fe137a2f3667249ab3d2666815a877a93c934ced5d1110

原文链接:http://www.freebsdchina.org/document_28_52946.html