ZFS文件系统是Solaris 10的重要特性,实例配置可以更容量的了解ZFS文件系统配置。
一、Solaris磁盘基础 1. 磁盘查看方法
# format
AVAILABLE DISK SELECTIONS:
0. c0d1 <xxx cyl 6524 alt 2 hd 255 sec 63>
/pci@0,0/pci-ide@7,1/ide@1/cmdk@1,0
1. c1t0d0 <VMware,-VMwareVirtualS-1.0 cyl 1302 alt 2 hd 255 sec 63>
/pci@0,0/pci15ad,1976@10/sd@0,0
2. c1t1d0 <VMware,-VMware Virtual S-1.0-10.00GB>
/pci@0,0/pci15ad,1976@10/sd@1,0
3. c1t2d0 <VMware,-VMware Virtual -1.0 cyl 1303 alt 2 hd 255 sec 63>
/pci@0,0/pci15ad,1976@10/sd@2,0
4. c1t3d0 <VMware,-VMware Virtual S-1.0-10.00GB>
/pci@0,0/pci15ad,1976@10/sd@3,0
Specify disk (enter its number): 3
# quit 退出2. 磁盘容量查看方法
# iostat -E
二、ZFS文件系统配置1. 创建zpool(raid0)
创建名为first的zfs文件系统
# zpool create -f first c1t0d0 c1t1d0 c1t2d0
"first" successfully created, but with no redundancy; failure of one
device will cause loss of the pool
说明:
# 提示三块盘没有做冗余,坏一盘全坏。
# 加入pool的硬盘是整块盘,这样便于pool对硬盘的管理。
# 由于加入pool的磁盘之前曾经使用过ufs,所以在创建过程中需要使用-f选项来忽视ufs文件格式将硬盘强制加入pool中。对pool进行扩容
# zpool add first c1t3d0
-n 模拟扩容之后结果
-f 强制执行
# zpool add -n -f first c1t3d0
would update "first" to the following configuration:
first
c1t0d0
c1t1d0
c1t3d02. 创建镜像pool,通常两块盘一样大小容(raid1)
# zpool create -f first mirror c1t0d0 c1t1d0
3. 创建mirror pool(raid 10)
# zpool create -f first mirror c1t0d0 c1t1d0 mirror c1t2d0 c1t3d0
4. 创建raidz zpool (raid5)
# zpool create first raidz2 c1t0d0 c1t1d0 c1t2d0 c1t3d0
5. 创建raidz zpool并加入一块热备盘
# zpool create first raidz2 c1t0d0 c1t1d0 c1t2d0 spare c1t3d0
(1)热备盘的添加
# zpool add first spare c1t3d0
(2)热备盘的删除
# zpool remove first c1t3d0
6. 镜像和拆镜像
(1) 创建镜像
如果创建zpool时,物理盘为单,可以对其进行镜像,命令格式为
# zpool attach first 老的磁盘 新的磁盘
# zpool attach first c1t0d0 c1t1d0
(2) 拆分镜像(与境像过程相反,因为影响数据)
# zpool detach first c1t1d07. 删除zpool
# zpool destroy poolname
# zpool destroy -f poolname8. 查看zpool列表,状态
# zpool list
# zpool status [-x][-v]
# 校验的目的
# zpool scrub poolname
# 校验的目的,这一般会花费很长的时间,
# zpool status 查看校验进度,最好在硬件出现问题,解决后都校验一次以保证一切正常。9. 创建一个文件系统
经典使用示例
1) 创建u01文件系统
# zfs create first/u01
2) 挂载到/u01目录,不挂载也可以直接使用
# zfs set mountpoint=/u01 first/u01
3) 设置磁盘配额
# zfs set quota=20G first/u01
创建快照
1) 创建快照
# zfs snapshot first/u01@ok
2) 恢复快照
# zfs rollback first/u01@ok
3) 删除快照及ZFS文件系统
说明:删除u01的快照时,加-R参数连同源一起删除,慎用。
# zfs destroy -R first/u01@ok创建ZFS克隆:
通过快照创建zfs目录
# zfs clone first/u01@ok first/bak
推荐阅读:Ubuntu下搭建nfs网络文件系统服务器 http://www.linuxidc.com/Linux/2013-07/87367.htm一台Linux服务器上挂载另一台Linx服务器文件系统的方法 http://www.linuxidc.com/Linux/2013-07/87183.htmMFS文件系统部署(2台服务器) http://www.linuxidc.com/Linux/2013-03/80261.htm配置CentOS 5.8上使用ACFS集群文件系统 http://www.linuxidc.com/Linux/2013-02/79797.htm如何在Ubuntu安装AMD私有驱动?Linux中强大且常用命令:find、grep相关资讯 Solaris Solaris ZFS ZFS文件系统
- VMware虚拟机安装x86架构的Solaris (今 14:25)
- Oracle Solaris本地安全漏洞(CVE- (07/17/2015 08:32:02)
- Oracle Solaris 远程安全漏洞(CVE- (10/17/2014 17:12:43)
| - Oracle Sun Solaris 本地安全漏洞( (04月22日)
- Solaris系统配置IPMP教程(基于IP (12/04/2014 13:40:32)
- Oracle Solaris 11.2 正式发布下载 (08/06/2014 12:03:33)
|
本文评论 查看全部评论 (0)