A Guide to Install and Use ZFS on Cent. OS 7. ZFS, short form of Zettabyte Filesystem is an advanced and highly scalable filesystem. It was originally developed by Sun Microsystems and is now part of the Open. ZFS project. With so many filesystems available on Linux, it is quite natural to ask what is special about ZFS. Unlike other filesystems, it is not just a filesystem but a logical volume manager as well. Some of the features of ZFS that make it popular are Data Integrity data consistency and integrity are ensured through copy on write and checksum techniques. Pooling of storage space available storage drives can be put together into a single pool called zpool. Software RAID Setting up a raidz array is as simple as issuing a single command. Inbuilt volume manager ZFS acts as a volume manager as well. This is an article dealing with installing ZFS on CentOS 7 and using zpool, zfs utilities of the filesystem to create and maintain disk pools and datasets. This article, explains how to upgrade or install a supported stable version of PHP 5. 4, PHP 5. 5 or PHP 5. 6 on a CentOS 6 Linux distribution using remi repo. Snaphots, clones, compression these are some of the advanced features that ZFS provides. ZFS is a 1. 28 bit filesystem and has the capacity to store 2. In this guide, we will be learning how to install, setup and also to use some important ZFS commands on a Cent. OS 7 server. NOTE The installation part is specific to Cent. OS server while the commands are common on any Linux system. Terminology. Before we move on, let us understand some of the terminologies that are commonly used in ZFS. Pool. Logical grouping of storage drives. It is the basic building block of ZFS and it is from here that storage space gets allocated for datasets. Datasets. The components of ZFS filesystem namely filesystem, clones, snapshots and volumes are referred to as datasets. Mirror. A virtual device storing identical data copies on two or more disks. In situations where one disk fails, same data is available on other disks of that mirror. Resilvering. Process of copying data from one disk to another in the event of restoring a device. Scrub. Scrub is used for consistency check in ZFS like how fsck is used in other filesystems. Installing ZFSIn order to install ZFS on Cent. OS, we need to first setup the EPEL repository for supporting packages and then the ZFS repository to install the required ZFS packages. Note Please prefix sudo to all the commands if you are not the root user. yum localinstall nogpgcheck http epel. Now install the kernel development and zfs packages. Kernel development packages are needed as ZFS is built as a module and inserted into the kernel. I am trying to add a physical volume for use to add volume groups and thus LV inside them. Sadly I am getting the following error. rootserver pvcreate devsdb1. Most of you who are using CentOS as a server are going to frequently come across situations where editing configuration files is necessary. Almost all configuration. Verify if the zfs module is inserted into the kernel using lsmod command and if not, insert it manually using modprobe command. email protected lsmod grep zfs. Let us check if we are able to use the zfs commands email protected zfs listno datasets available. Administration. ZFS has two main utilities, zpool and zfs. While zpool deals with creation and maintenance of pools using disks zfs utility is responsible for creation and maintenance of datasets. Creating and destroying pools. First verify the disks available for you to create a storage pool. email protected ls l devsdbrw rw 1 root disk 8, 0 Mar 1. Mar 1. 6 0. 8 1. Mar 1. 6 0. 8 1. Mar 1. 6 0. 8 1. Mar 1. 6 0. 8 1. Mar 1. 6 0. 8 1. Create a pool from a set of drives. ONLINEscan none requestedconfig NAME STATE READ WRITE CKSUMzfspool ONLINE 0 0 0sdc ONLINE 0 0 0sdd ONLINE 0 0 0sde ONLINE 0 0 0sdf ONLINE 0 0 0errors No known data errors. Verify if the pool creation was successful. email protected df h. Filesystem Size Used Avail Use Mounted ondevsda 1. G 1. 4. G 1. G 8 devtmpfs 4. M 0 4. M 0 devtmpfs 4. M 0 4. M 0 devshmtmpfs 4. M 5. 0M 4. M 1. 1 runtmpfs 4. M 0 4. M 0 sysfscgrouptmpfs 1. M 0 1. M 0 runuser0zfspool 3. G 0 3. G 0 zfspool. As you can see, zpool has created a pool by name zfspool of size 3. GB and has also mounted it in zfspool. To destroy a pool, use the zpool destroy commandzpool destroy lt pool name. Let us now try creating a simple mirror pool. We can also create multiple mirrors at the same time by repeating the mirror keyword followed by the drives. email protected zpool create f mpool mirror sdc sdd mirror sde sdfemail protected zpool statuspool mpoolstate ONLINEscan none requestedconfig NAME STATE READ WRITE CKSUMmpool ONLINE 0 0 0mirror 0 ONLINE 0 0 0sdc ONLINE 0 0 0sdd ONLINE 0 0 0mirror 1 ONLINE 0 0 0sde ONLINE 0 0 0sdf ONLINE 0 0 0errors No known data errors. In the above example, we have created mirror pools each with two disks. Similarly, we can create a raidz pool. email protected zpool create f rpool raidz sdc sdd sde sdfemail protected zpool statuspool rpoolstate ONLINEscan none requestedconfig NAME STATE READ WRITE CKSUMrpool ONLINE 0 0 0raidz. ONLINE 0 0 0sdc ONLINE 0 0 0sdd ONLINE 0 0 0sde ONLINE 0 0 0sdf ONLINE 0 0 0errors No known data errors. Managing devices in ZFS pools. Once a pool is created, it is possible to add or remove hot spares and cache devices from the pool, attach or detach devices from mirrored pools and replace devices. But non redundant and raidz devices cannot be removed from a pool. We will see how to perform some of these operations in this section. Im first creating a pool called testpool consisting of two devices, sdc and sdd. Another device sde will then be added to this. email protected zpool create f testpool sdc sdd. ONLINEscan none requestedconfig NAME STATE READ WRITE CKSUMtestpool ONLINE 0 0 0sdc ONLINE 0 0 0sdd ONLINE 0 0 0sde ONLINE 0 0 0errors No known data errors. As mentioned earlier, I cannot remove this newly added device as it is not a redundant or raidz pool. email protected zpool remove testpool sdecannot remove sde only inactive hot spares, cache, top level, or log devices can be removed. But I can add a spare disk to this pool and remove it. email protected zpool add testpool spare sdfemail protected zpool statuspool testpoolstate ONLINEscan none requestedconfig NAME STATE READ WRITE CKSUMtestpool ONLINE 0 0 0sdc ONLINE 0 0 0sdd ONLINE 0 0 0sde ONLINE 0 0 0sparessdf AVAILerrors No known data errorsemail protected zpool remove testpool sdfemail protected zpool statuspool testpoolstate ONLINEscan none requestedconfig NAME STATE READ WRITE CKSUMtestpool ONLINE 0 0 0sdc ONLINE 0 0 0sdd ONLINE 0 0 0sde ONLINE 0 0 0errors No known data errors. Similarly, we can use attach command to attach disks to a mirrored or non mirrored pool and detach command to detach disks from a mirrored pool. When a device fails or gets corrupted, we can replace it using the replace command. We will test this by forcefully corrupting a device in a mirrored configuration. email protected zpool create f testpool mirror sdd sde. This creates a mirror pool consisting of disks sdd and sde. Now, let us deliberately corrupt sdd drive by writing zeroes into it. email protected dd ifdevzero ofdevsdddd writing to devsdd No space left on device. GB copied, 2. 2. MBs. We will use the scrub command to detect this corruption. email protected zpool scrub testpoolemail protected zpool statuspool testpoolstate ONLINEstatus One or more devices could not be used because the label is missing orinvalid. Sufficient replicas exist for the pool to continuefunctioning in a degraded state. Replace the device using zpool replace. ZFS 8. 00. 0 4. Jscan scrub repaired 0 in 0h. Fri Mar 1. 8 0. 9 5. NAME STATE READ WRITE CKSUMtestpool ONLINE 0 0 0mirror 0 ONLINE 0 0 0sdd UNAVAIL 0 0 0 corrupted datasde ONLINE 0 0 0errors No known data errors. We will now replace sdd with sdc. email protected zpool replace testpool sdd sdc zpool statuspool testpoolstate ONLINEscan resilvered 8. K in 0h. 0m with 0 errors on Fri Mar 1. NAME STATE READ WRITE CKSUMtestpool ONLINE 0 0 0mirror 0 ONLINE 0 0 0replacing 0 UNAVAIL 0 0 0sdd UNAVAIL 0 0 0 corrupted datasdc ONLINE 0 0 0sde ONLINE 0 0 0errors No known data errors. ONLINEscan resilvered 7. K in 0h. 0m with 0 errors on Fri Mar 1. NAME STATE READ WRITE CKSUMtestpool ONLINE 0 0 0mirror 0 ONLINE 0 0 0sdc ONLINE 0 0 0sde ONLINE 0 0 0errors No known data errors. Migration of pools. Device devsdb. 1 not found or ignored by filteringThe block device type could also be a problem. If you run pvcreate with vvvv and you see an error like Skipping Unrecognised LVM device type 2. Just look up the device type for the number in procdevices and add it to the devices section of the lvm config etclvmlvm. Thats it, you can now use pvcreate as expected.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |