Admin: Making OpenSolaris Boot Disk Mirrored via ZFS
This blog entry is a "note to self" entry. I've got a system running OpenSolaris and I want to protect the data on the boot disk by mirroring it with a second disk; if one disk fails, ZFS will let me boot from the other disk, and I can easily replace the failed disk without any downtime.
I followed the instructions in this blog entry, about the most concise and easy-to-follow tutorial I've ever seen. I've got two disks I'm going to use for my boot disk mirror; call them Disk A (device c7d9) and Disk B (device c9d1). Here's what I did; note that for these instructions below, either be root or prefix these commands with "pfexec", sort of like "sudo" on Linux but without having to type a password if you have the right privileges:
That's it. Meanwhile, as soon as you do the "zpool attach", ZFS will start "resilvering" the second disk, mirrorring the contents of Disk A onto Disk B. Don't believe me? Check it out:
will show you something like this:
That's all there is to it.
I followed the instructions in this blog entry, about the most concise and easy-to-follow tutorial I've ever seen. I've got two disks I'm going to use for my boot disk mirror; call them Disk A (device c7d9) and Disk B (device c9d1). Here's what I did; note that for these instructions below, either be root or prefix these commands with "pfexec", sort of like "sudo" on Linux but without having to type a password if you have the right privileges:
- Installed OpenSolaris on Disk A (c7d9s0).
- Format Disk B (c9d1s0), putting a Solaris Partition on the full disk:
- # format
- within the format program, type "fdisk"
- within fdisks, create 100% Standard Solaris Partition over the full disk)
- Overwrite Disk B's info, copying Disk A's partition info onto it:
- # prtvtoc /dev/rdsk/c7d9s2 | fmthard -s - /dev/rdsk/c9d1s2
- (note: for both disks involved here, use slice 2, not slice 0. i.e., c7d9s2, c9d1s2)
- Attach Disk B to the ZFS root pool (the OpenSolaris install creates a ZFS pool called "rpool" by default; this is where the OS bits are laid out):
- zpool attach -f rpool c7d9s0 c9d1s0
- Install the GRUB boot loader on the mirrored disk (Disk B):
- # installgrub -m /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c9d1s0
That's it. Meanwhile, as soon as you do the "zpool attach", ZFS will start "resilvering" the second disk, mirrorring the contents of Disk A onto Disk B. Don't believe me? Check it out:
- # zpool status
will show you something like this:
drapeau@choctaw:~$ zpool status
pool: rpool
state: ONLINE
status: One or more devices is currently being resilvered. The pool will
continue to function, possibly in a degraded state.
action: Wait for the resilver to complete.
scrub: resilver in progress for 0h1m, 40.90% done, 0h1m to go
config:
NAME STATE READ WRITE CKSUM
rpool ONLINE 0 0 0
mirror ONLINE 0 0 0
c7d0s0 ONLINE 0 0 0
c9d1s0 ONLINE 0 0 0 1.98G resilvered
errors: No known data errors
That's all there is to it.

- Tags:
- opensolaris,
- zfs,
- howto,
- admin

Comments
Post new comment