ZFS 第一次出现在 OpenSolaris 上是在2005年11月发布的 build 27 版本,因为稳定性、可靠性等原因直到最近 VPSee 才有考虑把它用在生产环境里,现在 VPSee 所有的 Solaris 服务器还是在用很古老的 UFS,UFS 仍是 Solaris 10 的默认文件系统。昨天简单玩了一下 ZFS ,用6个文件模拟6个硬盘在 ZFS 上进行了一系列添加、删除、镜像的操作,立刻体会到了 ZFS 的强大,但这与实际操作物理硬盘还是有点差别。VPSee 当时安装 OpenSolaris 的时候只用了一块 250GB 的硬盘,现在可以增加一块 250GB 的硬盘做镜像,试验一下 ZFS 强大的 mirror,相当于做 RAID1.
检查 pool
要在服务器上增加一块实际硬盘,先要看看系统原来的 pool 有什么:
# zpool status pool: rpool state: ONLINE scrub: none requested config: NAME STATE READ WRITE CKSUM rpool ONLINE 0 0 0 c8t0d0s0 ONLINE 0 0 0 errors: No known data errors
上面显示 c8t0d0s0 是里面唯一的一块硬盘。现在插上一块新硬盘后(必要时需要重启)运行 format 工具:
# format Searching for disks... The device does not support mode page 3 or page 4, or the reported geometry info is invalid. WARNING: Disk geometry is based on capacity data. The current rpm value 0 is invalid, adjusting it to 3600 done c8t1d0: configured with capacity of 232.87GB AVAILABLE DISK SELECTIONS: 0. c8t0d0 /pci@0,0/pci108e,534c@5/disk@0,0 1. c8t1d0 /pci@0,0/pci108e,534c@5/disk@1,0 Specify disk (enter its number):
按 “Ctrl + C” 退出。c8t0d0 是原来的硬盘,c8t1d0 是后来加上去的新硬盘。
分区和 label
现在用 -e 参数再次运行 format,然后选择 partition,创建一个 Solaris 分区后打印出分区表看看,只有 s0, s2, s8 有内容。完成分区后退到 format 菜单,接着选择 label,因为大多数的 PC BIOS 都不支持 EFI labels,所以要选择 SMI:
# format -e c8t1d0 format> partition SELECT ONE OF THE FOLLOWING: 1. Create a partition ... partition> print Current partition table (original): Total disk cylinders available: 30398 + 2 (reserved cylinders) Part Tag Flag Cylinders Size Blocks 0 root wm 1 - 30396 232.85GB (30396/0/0) 488311740 1 unassigned wu 0 0 (0/0/0) 0 2 backup wu 0 - 30396 232.85GB (30397/0/0) 488327805 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 8 boot wu 0 - 0 7.84MB (1/0/0) 16065 9 unassigned wu 0 0 (0/0/0) 0 partition>quit format> label [0] SMI Label [1] EFI Label Specify Label type[0]: 0 Ready to label disk, continue? y
做镜像
退出 format,在 rpool 里增加新硬盘作为第1一块硬盘 mirror,会出现以下报错:
# zpool attach -f rpool c8t0d0 c8t1d0 cannot label 'c8t1d0': EFI labeled devices are not supported on root pools.
我们必须把 VTOC 从第1块硬盘拷贝到第2块硬盘,注意这里 s2 是 slice(分区),c8t0d0s2 是 c8t0d0 的 s2 分区,注意上面打印的分区显示 s2 代表整个硬盘,看 Blocks 发现 s2 = s0 + s8,s0 是 root 分区,s8 是 boot 分区:
# prtvtoc /dev/rdsk/c8t0d0s2 | fmthard -s - /dev/rdsk/c8t1d0s2 fmthard: Partition 2 specifies the full disk and is not equal full size of disk. The full disk capacity is 488343870 sectors. fmthard: New volume table of contents now in place.
新硬盘的 c8t1d0s0 分区做成 c8t0d0s0 的镜像,注意上面打印的分区显示 s0 是 root 分区,有 232.85GB 空间,也是我们想 mirror 的分区:
# zpool attach -f rpool c8t0d0s0 c8t1d0s0 Please be sure to invoke installgrub(1M) to make 'c8t1d0s0' bootable.
安装 grub
这一步非常重要,需要把 grub 安装在第二块硬盘上:
# installgrub -m /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c8t1d0s0 Updating master boot sector destroys existing boot managers (if any). continue (y/n)?y
校验 pool
校验 pool 后查看校验后状态:
# zpool scrub rpool # zpool status pool: rpool state: ONLINE scrub: scrub in progress for 0h0m, 0.95% done, 0h26m to go config: NAME STATE READ WRITE CKSUM rpool ONLINE 0 0 0 c8t0d0s0 ONLINE 0 0 0 c8t1d0s0 ONLINE 0 0 0 errors: No known data errors
相关推荐
zfs zfs0.8.4 zfs安装
zfs-remote-mirror, 关于为家庭使用设置远程ZFS镜像的详细教程 用于家庭使用的远程镜像更新:现在使用内置 ZFS 树莓派 映像 ! 跳转到附录以获得更多信息。 in: Flash 图像,更改密钥,发送快照。 注意:对于ECC内存...
What You’ll Learn Understand the gains ZFS gives system and storage administrators and utilize its features ... Create and maintain ZFS pool Administer ZFS storage, including sharing
ZFS 7000 硬件 安装ZFS 7000 硬件 安装ZFS 7000 硬件 安装ZFS 7000 硬件 安装
oracle solaris ZFS 管理指南
ZFS Best Practices with NetApp,基于NETAPP的ZFS最佳实践 ,英文版
zfs管理 zfs命令 zfs特性 zfs快照 oracle Solaris zfs 文件系统 oracle Solaris zfs 存储池
包括spl和zfs,版本是0.6.3,记得下同样版本的spl和zfs
1.3.1 镜像和拆镜像 8 1.3.2 添加zpool空间 9 1.3.3 spare盘的添加和删除 10 1.4 zpool的维护/故障盘的更换 12 1.5 zpool的迁移 15 1.6 恢复销毁的zpool 16 1.7 zpool的I/O统计 18 1.8 迁移ZFS 存储池 19 1.9 ...
zfs on linux,运行在linux下的ZFS,不是solaris哦
本文是作者自己做实验是的实验报告可分享给给为好友 有助于初学者了解zfs系统
proxmox服务器增加硬盘的操作流程。文档中包含增加lvm硬盘或者zfs硬盘的操作。特别注意,如果本机硬盘格式是lvm,新加硬盘想使用zfs格式,那么请一定要关闭swap。 命令为 swapoff -a ,否则zfs会发生很怪异的事情.
linux下的ZFS命令手册
Oracle® Solaris 管理:ZFS 文件系统 中文版 同样适用OpenZFS ZFS (old:Zettabyte file system) combines a file system with a volume manager. It began as part of the Sun Microsystems Solaris operating ...
Introducing ZFS on Linux Understand the Basics of Storage with ZFS 英文epub 本资源转载自网络,如有侵权,请联系上传者或csdn删除 查看此书详细信息请在美国亚马逊官网搜索此书
ZFS是目前最先进的文件系统,甚至可以说是“21世纪的文件系统”。这份资料是对ZFS管理的一个介绍,相信对大家有帮助。
存储培训;统一存储;培训;zfs7000产品介绍
SUN的128位存储管理软件ZFS的管理指南。 当前流行企业服务器的核心件维护指南。
zfs文件系统源码,自学使用,开源代码不得用于其他目的。