转:http://www.andybotting.com/zfs-on-linux
ZFS is a fantastic filesystem developed by Sun. Compared to other filesystems, it’s quite interesting as it combines both a filesystem and a logical volume manager. This allows you to get great flexibility, features and performance. It supports things like integrated snapshots, native NFSv4 ACL support and clever data integrity checking.
I’m now running a HP ProLiant MicroServer N36L which is a small NAS unit containing a 4-bay SATA enclosure. It has a low-performance AMD CPU, and comes with 1GB RAM and a 250GB harddisk. I’ve upgraded mine to 4GB of RAM and 4 x 2TB Seagate Barracuda drives.
The benefit of these units are that they’re a standard x86 machine allowing you to easily install any OS you like. They’re also really cheap and often have cash-back promotions.
I bought mine when I was in the UK and I brought it back with me to Australia. I waited until I got back to upgrade it so save me the trouble of shipping the extra harddisks on the ship.
In this post, I’ll document how to easily install ZFS on Debian Wheezy and some basic ZFS commands you’ll need to get started.
Installation
UPDATE: ZFS on Linux now has their own Debian Wheezy repository!http://zfsonlinux.org/debian.html
Install the ZFS packages
# apt-get install debian-zfs
This should use DKMS to build some new modules specific to your running kernel and install all the required packages.
Pull the new module into the kernel# modprobe zfs
If all went well, you should see that spl and zfs have been loaded into the kernel.
Prepare disks
ZFS works best if you give it full access to your disks. I’m not going to run ZFS on my root filesystem, so this makes things much simpler.
Find our ZFS disks. We use the disk ID’s instead of the standard /dev/sdX naming because it’s more stable.# ls /dev/disk/by-id/ata-*
lrwxrwxrwx 1 root root 9 Jan 21 19:18 /dev/disk/by-id/ata-ST2000DM001-1CH164_Z1E1GYH5 -> ../../sdd
lrwxrwxrwx 1 root root 9 Jan 21 08:55 /dev/disk/by-id/ata-ST2000DM001-9YN164_Z1E2ACRM -> ../../sda
lrwxrwxrwx 1 root root 9 Jan 21 08:55 /dev/disk/by-id/ata-ST2000DM001-9YN164_Z1F1SHN4 -> ../../sdb
Create partition tables on the disks so we can use them in a zpool:# parted /dev/disk/by-id/ata-ST2000DM001-9YN164_Z1E2ACRM mklabel gpt
# parted /dev/disk/by-id/ata-ST2000DM001-9YN164_Z1F1SHN4 mklabel gpt
# parted /dev/disk/by-id/ata-ST2000DM001-1CH164_Z1E1GYH5 mklabel gpt
Create a new pool
ZFS uses the concept of pools in a similar way to how LVM would handle volume groups.
Create a pool called mypool, with the initial member being a RAIDZ composed of the remaining three drives.# zpool create -m none -o ashift=12 mypool raidz /dev/disk/by-id/ata-ST2000DM001-1CH164_Z1E1GYH5/dev/disk/by-id/ata-ST2000DM001-9YN164_Z1E2ACRM/dev/disk/by-id/ata-ST2000DM001-9YN164_Z1F1SHN4
RAIDZ is a little like RAID-5. I’m using RAID-Z1, meaning that from a 3-disk pool, I can lose one disk while maintaining the data access.
NOTE: Unlike RAID, once you build your RAIDZ, you cannot add new individual disks. It’s a long story.
The -m none means that we don’t want to specify a mount point for this pool yet.
The -o ashift=12 forces ZFS to use 4K sectors instead of 512 byte sectors. Many new drives use 4K sectors, but lie to the OS about it for ‘compatability’ reasons. My first ZFS filesystem used the 512-byte sectors in the beginning, and I had shocking performance (~10Mb/s write).
Seehttp://zfsonlinux.org/faq.html#HowDoesZFSonLinuxHandlesAdvacedFormatDrives for more information about it.
# zpool listNAME SIZE ALLOC FREE CAP DEDUP HEALTH ALTROOT
mypool 5.44T 1.26T 4.18T 23% 1.00x ONLINE -
Disable atime for a small I/O boost# zfs set atime=off mypool
Deduplication is probably not worth the CPU overheard on my NAS.# zfs set dedup=off mypool
Our pool is now ready for use.
Create some filesystems
Create our documents filesystem, mount and share it by NFS# zfs create mypool/documents
# zfs set mountpoint=/mnt/documents mypool/documents
# zfs set sharenfs=on mypool/documents
Create our photos filesystem, mount and share it by NFS# zfs create mypool/photos
# zfs set mountpoint=/mnt/photos mypool/photos
# zfs set sharenfs=on mypool/photos
Photos are important, so keep two copies of them around# zfs set copies=2 mypool/photos
Documents are really important, so we’ll keep three copies of them on disk# zfs set copies=3 mypool/documents
Documents are mostly text, so we’ll compress them.
# zfs set compression=on mypool/documents
Scrub
ZFS pools should be scrubbed at least once a week. It helps balance the data across the disks in your pool and to fix up any data integrity errors it might find.# zpool scrub <pool>
To do automatic scrubbing once a week, set the following line in your root crontab# crontab -e
...
30 19 * * 5 zpool scrub <pool>
...
相关推荐
Introducing ZFS on Linux Understand the Basics of Storage with ZFS 英文epub 本资源转载自网络,如有侵权,请联系上传者或csdn删除 查看此书详细信息请在美国亚马逊官网搜索此书
Introducing ZFS on Linux Understand the Basics of Storage with ZFS 英文无水印原版pdf pdf所有页面使用FoxitReader、PDF-XChangeViewer、SumatraPDF和Firefox测试都可以打开 本资源转载自网络,如有侵权,请...
Understand the gains ZFS gives system and storage administrators and utilize its features Install and configure ZFS software Create and maintain ZFS pool Administer ZFS storage, including sharing
ZFS on Linux - 用于Linux的官方OpenZFS实现
使用 ZFSonLinux (zfsonlinux.org) 在 Debian 和 Ubuntu GNU/Linux 上进行测试。 执照 bashShot - sun-auto-snap-like implementation for ZFSonLinux using cron. Copyright (C) 2014 Hans-Filip Elo, Rovanion ...
sbo-zfsonlinux:适用于SlackBuilds.org的ZFS-on-Linux SlackBuild脚本
zfsonlinux.github.com ZoL的官方网站。
zfs on linux,运行在linux下的ZFS,不是solaris哦
ZFSon Linux进入部署状态.pdf
Linux 上 ZFS 的 ##Zabbix 模板###如何使用: 将模板导入 zabbix 服务器。 授予zabbix用户权限:vi /etc/sudoers.d/zabbix Defaults:zabbix !requiretty zabbix ALL=(root) NOPASSWD: /sbin/zpool zabbix ALL=...
休闲构建说明只需像这样快速构建: $ apt-get source --build mountall开发人员构建说明克隆这个存储库: $ git clone git://github.com/zfsonlinux/mountall.git$ cd mountall按分支名称列出当前版本: $ git ...
明确地说,这个分支与 Sun、Oracle、ZFSOnLinux、OpenSolaris、IllumOS、OpenIndiana、SmartOS、FreeBSD 等无关。 如果您运行旧池 version=30,此分支将允许您导入池并将其升级到标准池 version=5000,并且它将...
$ git clone git://github.com/zfsonlinux/dkms.git $ cd dkms 按分支名称列出当前版本: $ git branch --list 'master/*' 或按标签名称列出以前的版本: $ git tag --list 'master/*' 签出要构建的分支名称或...
此插件已在Arch Linux for ZFS on Linux 2.x和Ubuntu 1.8.x上进行了测试,首先定位到2.x。 用法 自容器1.1起,该插件默认为内置。 无需重新编译容器或执行代理快照程序。 设置ZFS文件系统。 ZFS文件系统名称是任意...
开发人员构建说明克隆这个存储库: $ git clone git://github.com/zfsonlinux/grub.git$ cd grub按分支名称列出当前版本: $ git branch --list 'master/*'或按标签名称列出以前的版本: $ git tag --list 'master/*...
Debian Wheezy 7.8(3.2.0-4-amd64),zfsonlinux 0.6.4.2,带有8磁盘的raidz2设置 用法 $ bin/check_zfs --help Usage of bin/check_zfs: -c int Capacity critical limit (80% is considered soft limit of ZFS)...
用于 Cockpit 的 Linux 管理包上的交互式 ZFS。 使用本软件的风险由您自行承担! 生命尽头 该软件已达到使用寿命,不再进行维护。 要求 驾驶舱:201+ NFS(可选) 桑巴舞:4+(可选) ZFS:0.8+ 安装 将 zfs ...
在Zabbix上Linux上监视ZFS 该模板是pbergdolt完成的原始工作的修改版本,并在不久前发布在zabbix论坛上: ://www.zabbix.com/forum/zabbix-cookbook/35336-zabbix-zfs-discovery-monitoring 。 该变体的原始目录也...
corezfsCoreOS上的ZFS 这是一个在CoreOS上编译和安装ZFS的脚本。 它打算安装在全新的CoreOS实例上。 尽管它可以手动运行,但可以预见它通常被用作自动配置过程的一部分。安装要在CoreOSLinux上构建和安装ZFS,请将...
简而言之,它等效于ZFS加密文件系统的network-online.target : ZFS文件系统加密密钥放置在本地加密的密钥存储库中,该存储库自身的加密密钥放置在Azure Key Vault中。 引导后,系统服务会到达一个名为ZFS密钥网关...