Chinaunix

标题: solaris10 u6使用zfs安装操作系统!(添加了镜像部分) [打印本页]

作者: zyl555    时间: 2008-11-04 12:52
标题: solaris10 u6使用zfs安装操作系统!(添加了镜像部分)
昨天下载了最新的solaris10 u6的版本,今天在虚拟机上安装了一下。
安装过程和以前差不多,唯一不同的是在安装到选择硬盘的时候,提示你用ufs还是zfs进行。
我使用了zfs默认的安装配置,而且只用了一块硬盘。

安装过程中,不同以往的两个地方:





给大家看看安装后的变化:

bash-3.00# df -k
Filesystem            kbytes    used   avail capacity  Mounted on
rpool/ROOT/s10x_u6wos_07b
                     8193024 4225715 1343908    76%    /
/devices                   0       0       0     0%    /devices
ctfs                       0       0       0     0%    /system/contract
proc                       0       0       0     0%    /proc
mnttab                     0       0       0     0%    /etc/mnttab
swap                 1842668     368 1842300     1%    /etc/svc/volatile
objfs                      0       0       0     0%    /system/object
sharefs                    0       0       0     0%    /etc/dfs/sharetab
/usr/lib/libc/libc_hwcap1.so.1
                     5569623 4225715 1343908    76%    /lib/libc.so.1
fd                         0       0       0     0%    /dev/fd
swap                 1849108    6808 1842300     1%    /tmp
swap                 1842328      28 1842300     1%    /var/run
rpool/export         8193024      19 1343908     1%    /export
rpool/export/home    8193024      18 1343908     1%    /export/home
rpool                8193024      35 1343908     1%    /rpool



bash-3.00# zpool list
NAME    SIZE   USED  AVAIL    CAP  HEALTH  ALTROOT
rpool  7.94G  5.03G  2.91G    63%  ONLINE  -


bash-3.00# zfs list
NAME                        USED  AVAIL  REFER  MOUNTPOINT
rpool                      6.53G  1.28G  35.5K  /rpool
rpool/ROOT                 4.03G  1.28G    18K  legacy
rpool/ROOT/s10x_u6wos_07b  4.03G  1.28G  4.03G  /
rpool/dump                 1.00G  1.28G  1.00G  -
rpool/export                 37K  1.28G    19K  /export
rpool/export/home            18K  1.28G    18K  /export/home
rpool/swap                 1.50G  2.78G    16K  -


bash-3.00# 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     -


bash-3.00# zpool status
  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




经过摸索终于镜像成功,虚拟机里添加了一块硬盘才c1t1d0。

bash-3.00# zpool attach rpool c1t0d0s0 c1t1d0s0

bash-3.00# 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 0h0m, 0.76% done, 0h19m to go
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

errors: No known data errors

[ 本帖最后由 zyl555 于 2008-11-4 14:16 编辑 ]
作者: zyl555    时间: 2008-11-04 13:11
看来大家都没什么兴趣呀。用一块盘安装后,rpool的结构看不出来是什么,按道理默认应该是mirror吧。可是zpool status看不到mirror关键字。不知道再添加一块盘进去做镜像怎么处理?哪位有思路。
作者: hexilanlan    时间: 2008-11-04 13:19
第一次见。。。U6
作者: yoyosys    时间: 2008-11-04 13:23
LZ可以再加一块硬盘进去做个MIRROR,再贴出来让大家看看效果,等有空也去下载个版本来玩玩
作者: zyl555    时间: 2008-11-04 13:29
标题: 回复 #4 yoyosys 的帖子
我也想做mirror呀,可是怎么加呢?手册里池的结构是创建的时候指定的呀。
现在这个rpool池已经创建出来了,结构不清楚。
我只能加一块盘后再看看状态了。

[ 本帖最后由 zyl555 于 2008-11-4 13:31 编辑 ]
作者: mac2008    时间: 2008-11-04 13:39
到官方找找资料
作者: zyl555    时间: 2008-11-04 13:57
试了一下添加,但是应该不行。因为rpool池里的初始设备是c1t0d0s0。
bash-3.00# zpool add -n rpool mirror c1t1d0s0
cannot open '/dev/dsk/c1t1d0s0': I/O error
bash-3.00# zpool add -n rpool mirror c1t1d0
invalid vdev specification: mirror requires at least 2 devices
bash-3.00# zpool add -n rpool c1t1d0s0
cannot open '/dev/dsk/c1t1d0s0': I/O error
bash-3.00# zpool add -n rpool c1t1d0
would update 'rpool' to the following configuration:
        rpool
          c1t0d0s0
          c1t1d0
作者: hexilanlan    时间: 2008-11-04 14:50

作者: yuhuohu    时间: 2008-11-04 15:41
bash-3.00# 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 0h0m, 0.76% done, 0h19m to go
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



这不是显示两块盘了吗?
作者: wuqing    时间: 2008-11-04 15:53
原帖由 zyl555 于 2008-11-4 13:57 发表
试了一下添加,但是应该不行。因为rpool池里的初始设备是c1t0d0s0。
bash-3.00# zpool add -n rpool mirror c1t1d0s0
cannot open '/dev/dsk/c1t1d0s0': I/O error
bash-3.00# zpool add -n rpool mirror c1t1d0
invalid vdev specification: mirror requires at least 2 devices
bash-3.00# zpool add -n rpool c1t1d0s0
cannot open '/dev/dsk/c1t1d0s0': I/O error
bash-3.00# zpool add -n rpool c1t1d0
would update 'rpool' to the following configuration:
        rpool
          c1t0d0s0
          c1t1d0


mirror至少要2块盘
你可以往pool里添加2块盘,这2块盘是一个mirror
zpool add -n rpool mirror c1t1d0 c2t2d0
看看Solaris管理系列中的Solaris ZFS Administration Guide吧,http://docs.sun.com/app/docs/doc/819-5461
才200页不到
作者: alex_linux    时间: 2008-11-04 17:39
好鲜艳的色彩啊




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2