Tuesday, July 21, 2009

ZFS boot/root - intro

I think on the whole, you will find that ZFS booting is very simple. It should make your lives easier.

Also, I believe that our goal of implementing SAN booting as a standard will be much easier to achieve if we first adopt ZFS root file systems as a prerequisite standard.


Here are the basic rules, requirements, and recommendations around ZFS booting:
• ZFS boot is supported with Solaris 10 10/08 (update 6) and later versions
• No OBP upgrades are required
• Disks must be partitioned with SMI labels (this is the same for both UFS and ZFS booting).
• A ZFS root pool must contain only one VDEV. The VDEV can be mirrored (with two or more disks) but Raid-Z is not supported.
• It is recommended that ZFS root pools reside on slice 0 of the boot disk(s).
• A ZFS root pool must be large enough to accommodate the OS, as well as independent datasets for SWAP, DUMP, and /home
• A ZFS root pool should normally be named "rpool" but this is not an absolute requirement.

Here is an example of a 72GB root pool built on a pair of 72GB disks.
In this example slice 0 on both disks is sized to make use of all available space on the disks.

-----------------------------------------------------------------------------
|72GB root pool named "rpool" - contains /, /var, /home, swap, & dump |
| |
| --------------------------------------------------------------------- |
| |72GB mirrored VDEV | |
| | | |
| | ---------------------------- ---------------------------- | |
| | | 72GB "Slice 0" on disk#1 | | 72GB "Slice 0" on disk#2 | | |
| | | | : | | | |
| | | | : | | | |
| | | 1st mirror | : | 2nd mirror | | |
| | | | | | | |
-----------------------------------------------------------------------------


I would encourage you to try jumpstarting a system with ZFS boot enabled, and then run a few commands to see how things are set up:

e.g.
ok> boot net - install
……….. wait while the OS installs ……...

# df -k | grep rpool
rpool/ROOT/blue 51351552 1898362 39609380 5% /
rpool/ROOT/blue/var 51351552 29578 39609380 1% /var
rpool/home 1048576 437 1048138 1% /home
rpool/marimba 524288 135049 389239 26% /opt/Marimba
rpool/bmc 2097152 235035 1862117 12% /opt/bmc
rpool 51351552 93 39609380 1% /rpool
rpool/openv 524288 5551 518737 2% /usr/openv

# zpool status
pool: rpool
state: ONLINE
scrub: none requested
config:
NAME STATE READ WRITE CKSUM
rpool ONLINE 0 0 0
mirror ONLINE 0 0 0
c0t0d0s0 ONLINE 0 0 0
c0t1d0s0 ONLINE 0 0 0
errors: No known data errors

# zfs list -o name,quota,volsize,mountpoint
NAME QUOTA VOLSIZE MOUNTPOINT
rpool none - /rpool
rpool/ROOT none - legacy
rpool/ROOT/blue none - /
rpool/ROOT/blue/var none - /var
rpool/bmc 2G - /opt/bmc
rpool/dump - 1G -
rpool/home 1G - /home
rpool/marimba 512M - /opt/Marimba
rpool/openv 512M - /usr/openv
rpool/swap - 8G -
Notice that the pool named "tools" is no longer created; everything that was in the tools pool is now placed in "rpool".

# dumpadm
Dump content: kernel pages
Dump device: /dev/zvol/dsk/rpool/dump (dedicated)
Savecore directory: /var/crash/gnat
Savecore enabled: yes

# swap -l
swapfile dev swaplo blocks free
/dev/zvol/dsk/rpool/swap 256,1 16 33030128 33030128

The size of the swap device is based on the formula : 2 * memory with upper and lower bounds that are based on the size of the disk.

# dumpadm
Dump content: kernel pages
Dump device: /dev/zvol/dsk/rpool/dump (dedicated)
Savecore directory: /var/crash/gnat
Savecore enabled: yes

Notice that swap device and the dump device are independent zvols. Unfortunately they are not allowed to share the same dataset.

For now, the size of the dump device is based on a default Sun formula that is built into the Solaris installation program; I may override the Sun formula in the near future if we start finding that the our dump devices are too small.

# cat /etc/vfstab
#device device mount FS fsck mount mount
#to mount to fsck point type pass at boot options
#
fd - /dev/fd fd - no -
/proc - /proc proc - no -
/dev/zvol/dsk/rpool/swap - - swap - no -
/devices - /devices devfs - no -
sharefs - /etc/dfs/sharetab sharefs - no -
ctfs - /system/contract ctfs - no -
objfs - /system/object objfs - no -
swap - /tmp tmpfs - yes -

The vfstab no longer contains entries for /, /var, or /home, but there is still an entry for swap.

# echo ver | format c0t0d0
...
Volume name = < >
ascii name = <SUN72G cyl 14087 alt 2 hd 24 sec 424>
pcyl = 14089
ncyl = 14087
acyl = 2
nhead = 24
nsect = 424
Part Tag Flag Cylinders Size Blocks
0 root wm 0 - 14083 68.34GB (14084/0/0) 143318784
1 unassigned wu 0 0 (0/0/0) 0
2 backup wm 0 - 14086 68.35GB (14087/0/0) 143349312
3 unassigned wu 0 0 (0/0/0) 0
4 unassigned wu 0 0 (0/0/0) 0
5 unassigned wu 0 0 (0/0/0) 0
6 unassigned wu 0 0 (0/0/0) 0
7 unassigned wu 0 0 (0/0/0) 0

That is all for today…

I would encourage you sit down on the couch tonight, turn off your favourite distractions, and start the video on your laptop.
http://blogs.sun.com/storage/entry/zfs_boot_in_solaris_10.

Readers who read this page, also read:




Bookmark and Share My Zimbio http://www.wikio.com

0 comments: