简介
solaris 10最新版本已经支持以ZFS文件系统安装根文件系统(以字符界面安装,支持选择UFS或ZFS作为根文件系统)。我在安装过程中有意选择了ZFS文件系 统,并准备在安装完成后将zpool转换为RAID-1。
安装操作系统后,对跟磁盘进行镜像可以确保系统在磁盘损坏时不会导致操作系统无法恢复或崩溃,对我们日常维护solaris系统有很大帮助。
操作系统安装后检查
使用ZFS作为操作系 统根目录后,默认系统创建的zfs pool命名为rpool。
pool: rpool
state: ONLINE
scrub: none requested
config:
NAME STATE READ WRITE CKSUM
rpool ONLINE 0 0 0
c1t0d0s0 ONLINE 0 0 0
errors: No known data errors
在案例中,服务器有4块磁盘,但是zpool默认并不会自动创建RAID-1镜像。
要注意的是Solaris不支持有EFI标记格式的磁盘作为启动磁盘,所以如果新磁盘使用的是EFI格式标 记,需要转换为SMI标记。使用fdisk命令在创建Solaris2分区并删除任何EFI标记。
WARNING: Device /dev/rdsk/c1t1d0s0:
The device does not appear to encompass the entire PHYSICAL disk.
Fdisk is normally used with the device that represents the entire fixed disk.
(For example, /dev/rdsk/c0d0p0 on x86 or /dev/rdsk/c0t5d0s2 on sparc).
Are you sure you want to continue? (y/n) y
Error in ioctl DKIOCGMBOOT: Invalid argument
No fdisk table exists. The default partition for the disk is:
a 100% "SOLARIS System" partition
Type "y" to accept the default partition, otherwise type "n" to edit the
partition table.
y
以上方式对于新磁盘可以很好完成标记。不过,如果磁盘已经在其他系统中使用过,并已经做过分区,则需要使用format来 删除分区,并创建和第一块磁盘完全相同的分区:
partition> p
Current partition table (original):
Total disk cylinders available: 14087 + 2 (reserved cylinders)
Part Tag Flag Cylinders Size Blocks
0 root wm 0 - 14086 136.71GB (14087/0/0) 286698624
1 unassigned wm 0 0 (0/0/0) 0
2 backup wm 0 - 14086 136.71GB (14087/0/0) 286698624
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 unassigned wm 0 0 (0/0/0) 0
7 unassigned wm 0 0 (0/0/0) 0
partition> p
Current partition table (mirror):
Total disk cylinders available: 14087 + 2 (reserved cylinders)
Part Tag Flag Cylinders Size Blocks
0 root wm 0 - 14086 136.71GB (14087/0/0) 286698624
1 unassigned wm 0 0 (0/0/0) 0
2 backup wm 0 - 14086 136.71GB (14087/0/0) 286698624
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 unassigned wm 0 0 (0/0/0) 0
7 unassigned wm 0 0 (0/0/0) 0
确保两块磁盘分区完全一致,label后退出format命令。
- 将第二块磁盘添加到rpool中,添加磁盘后,rpool将转换为mirror
1 | zpool attach -f rpool c1t0d0s0 c1t1d0s0 |
系统提示
Please be sure to invoke installboot(1M) to make 'c1t1d0s0' bootable.
Make sure to wait until resilver is done before rebooting.
- 使用工具installgrub(x86系统)或installboot(SPARC 系统)将启动管理器安装到新磁盘上
1 | installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c1t1d0s0 |
1 | installboot -F zfs /usr/platform/uname -i/lib/fs/zfs/bootblk /dev/rdsk/c1t1d0s0 |
- 以上已经完成rpool的镜像,需要花费一些时间把原始磁盘镜像到新磁盘。可以使用以下命令查看zpool状态
输出显示
pool: rpool
state: ONLINE
scrub: resilver completed after 0h8m with 0 errors on Tue May 11 11:15:20 2010
config:
NAME STATE READ WRITE CKSUM
rpool ONLINE 0 0 0
mirror ONLINE 0 0 0
c1t0d0s0 ONLINE 0 0 0
c1t1d0s0 ONLINE 0 0 0 7.40G resilvered
errors: No known data errors参考
阅读(3427) | 评论(0) | 转发(0) |