0% found this document useful (0 votes)
10 views12 pages

Storage Management (ZFS)

ZFS is a robust file system and Logical Volume Manager developed by Sun Microsystems, known for its data integrity, scalability, and features like replication, deduplication, and snapshots. It allows for efficient storage management through commands for creating pools, managing quotas, and implementing RAID configurations. ZFS also supports advanced functionalities such as snapshots, rollbacks, and clones, enabling users to maintain data integrity and manage storage effectively.

Uploaded by

Mithilesh Tati
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views12 pages

Storage Management (ZFS)

ZFS is a robust file system and Logical Volume Manager developed by Sun Microsystems, known for its data integrity, scalability, and features like replication, deduplication, and snapshots. It allows for efficient storage management through commands for creating pools, managing quotas, and implementing RAID configurations. ZFS also supports advanced functionalities such as snapshots, rollbacks, and clones, enabling users to maintain data integrity and manage storage effectively.

Uploaded by

Mithilesh Tati
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

SOLARIS_11.

4
SOP: STORAGE MANAGEMENT
ZFS File-system

ZFS is a local file system and Logical Volume Manager created by SUN MICROSYSTEMS to direct
and control the placement, storage and retrieval of data in enterprise-class computing systems.
The ZFS file system and volume manager is characterized by data integrity, high scalability and built-in
storage features such as:
• Replication - The process of making a replica (a copy) of something.
• Deduplication - A process that eliminates redundant copies of data and reduces storage
overhead.
• Compression - A reduction in the number of bits needed to represent data.
• Snapshots - A set of reference markers for data at a particular point in time.
• Clones - An identical copy of something.
• Data protection - The process of safeguarding important information from corruption and/or
loss.

How ZFS works :


ZFS is designed to run on a single server, potentially with hundreds if not thousands of attached storage
drives. ZFS pools the available storage and manages all disks as a single entity. A user can add more
storage drives to the pool if the file system needs additional capacity. ZFS is highly scalable and
supports a large maximum file size.
ZFS stores at least two copies of meta-data each time data is written to disk. The metadata includes
information such as the disk sector where the data is stored, the size of the data blocks and a checksum
of the binary digits of a piece of data. When a user requests access to a file, a checksum algorithm
performs a calculation to verify that the retrieved data matches the original bits written to disk. If the
check-sum detects an inconsistency, it flags the bad data. In systems with a mirrored storage pool or the
ZFS version of RAID, ZFS can retrieve the correct copy from the other drive and repair the damaged
data copy.
1. Creating zpool :
1. Simply poot command ‘zpool create pool-name path-to-device’ as follows:

2. ‘zpool list’ will listout the pools list.

2. Creating zfs file-system on created pool:

1. zfs file-system created by zfs command in created pool. In command after sda1/ we have to
name of file system.

2. You can check your created file-system by command ‘zfs list’

3. Mounting File-System:
1. If you not mount the file system and system configured with automount then by default it
will get mounted by creating directories namely its dataset as shown in below.

2. Follow the following, if you want to mount it on any other mount point.
4. ZFS Quota and Reservation settings:

ZFS supports quotas and reservations at the file system level. You can use the quota property to
set a limit on the amount of space a file system can use. In addition, you can use the reservation
property to guarantee that some amount of space is available to a file system. Both properties
apply to the dataset they are set on and all descendants of that dataset.
That is, if a quota is set on the rpool/export/home dataset, the total amount of space used by
tank/home and all of its descendants cannot exceed the quota. Similarly, if rpool/export/home is
given a reservation, rpool/export/home and all of its descendants draw from that reservation.
The amount of space used by a dataset and all of its descendents is reported by the used
property.
A. Quota: You can set quota for zfs file system, specific user and group by zfs command.

1. File system quota:

You can check the quota for data set :

2. User quota :

You can check the user quota by zfs command:

3. For groups quota:


B. Reservation:

1. Reservation space for data-set:

2. If you set for user home directory then the space is reserved for that user home .directory
in rpool/export/home dataset.

3. You can check the properties by ‘zfs get’ as below.

4. You can put properties by comma separated to get information.

5. You can get all properties by ‘zfs all’.


5. Adding new device on zpool :

1. Adding new disk on existing pool by zpool command.


1. Listing existing zpools.

2. Check the status of pool by ‘zpool status poolname’

3. Adding disk by ‘zpool add’.

4. Now check the status of zpool.

5. Also you can remove disk from pool by ‘zpool remove’.


6. Now check the status.

6. RAID IMPLEMENTATION IN ZFS :

1. Linear :
1. If you provide command ‘zpool create ’ with no option then it will implements
concatenation between the provided no. of disk.

2. Create file system:

3. You can check your pool and file system: As discussed in point 3. you can change mount
point of file system. 3 disks are having total size of 2 GB and grand total is 6 GB
2. Mirroring: If you provide command ‘zpool create ’ with option ‘raid1/2/so on’ then it will
implements mirror of the disk. The no. of mirror depends on provided no. of disk.
1. Single mirror :

2. Two Mirror : 2 mirrors of c3t3d0 device.

3 disks are having total size of 2 GB , 1 contain data and other 2 are the replica’s of disk 1.

3. RAID-5: Single parity-distributed :

The raidz1 vdev type specifies a single-parity raidz group; the raidz2 vdev type specifies a
double-parity raidz group; and the raidz3 vdev type specifies a triple-parity raidz group. The
raidz vdev type is an alias for raidz1.
-raidz3 requires at least 4 devices
-raidz2 requires at least 3 devices
-raidz requires at least 2 devices
A raidz group with N disks of size X with P parity disks can hold approximately (N-P)*X
bytes and can withstand P device(s) failing before data integrity is compromised. The
minimum number of devices in a raidz group is one more than the number of parity disks. The
recommended number is between 3 and 9 to help increase performance.

4. RAID-6: Double parity disk:

7. ZFS Snapshot and Rollback:

1. Snapshot:
A snapshot is a read-only copy of a file system or volume. Snapshots can be created almost
instantly, and they initially consume no additional disk space within the pool. However, as data
within the active dataset changes, the snapshot consumes disk space by continuing to reference
the old data, thus preventing the disk space from being freed.
ZFS snapshots include the following features:
1. The persist across system reboots.
2. The theoretical maximum number of snapshots is 264.
3. Snapshots use no separate backing store. Snapshots consume disk space directly from the
same storage pool as the file system or volume from which they were created.
4. Snapshots of volumes cannot be accessed directly, but they can be cloned, backed up, rolled
back to, and so on.

2. Rollback:

You can use the ‘zfs rollback’ command to discard all changes made to a file system since a
specific snapshot was created. The file system reverts to its state at the time the snapshot was
taken. By default, the command cannot roll back to a snapshot other than the most recent
snapshot.
To roll back to an earlier snapshot, all intermediate snapshots must be destroyed. You can
destroy earlier snapshots by specifying the -r option.

If clones of any intermediate snapshots exist, the -R option must be specified to destroy the
clones as well.

For example: I have directories namely 1, 2, 3, 4, 5 in /sda1/c3t2d0/home directory and I have


taken a snapshot of current state and after this I had done some changes (changes whatever will
be it may edit file or creating dir or suppose I removed some directories in /sda1/c3t2d0/home)
and I wants to get into previous state then simply I will use rollback as follows.
• Command for snapshot is ‘zfs snapshot filesystem@snap-name

• You can list out the snapshots by zfs command. With option t for type.

• Removing directories.

• Now rollback to previous state. Syntax- zfs rollback NAME (as mentioned at the time of
creating)
• Now check whether state is backed up or not.

8. ZFS send and receive:


A snapshot is a read-only copy of a file system or volume. Snapshots can be created extremely
quickly, and initially consume no additional space within the pool. As data within the active dataset
changes, the snapshot consumes more data than would otherwise be shared with the active dataset.
The ‘zfs send’ command creates a stream representation of a snapshot that is written to standard output.
By default, a full stream is generated. You can redirect the output to a file or to a different system. The
‘zfs receive’ command creates a snapshot whose contents are specified in the stream that is provided on
standard input. If a full stream is received, a new file system is created as well. You can send ZFS
snapshot data and receive ZFS snapshot data and file systems with these commands.
You can use the ‘zfs send’ command to send a copy of a snapshot stream and receive the snapshot
stream in another pool on the same system or in another pool on a different system that is used to store
backup data. For example, to send the snapshot stream on a different pool to the same system, use
syntax similar to the following:
You can check out this received snapshot in newpool by following.

To store permanently data, rollback the new received snapshot.

9. ZFS Clones :
A clone is a writable volume or file system whose initial contents are the same as the dataset from
which it was created. As with snapshots, creating a clone is nearly instantaneous and initially consumes
no additional disk space. In addition, you can snapshot a clone.
Clones can only be created from a snapshot. When a snapshot is cloned, an implicit dependency is
created between the clone and snapshot. Even though the clone is created somewhere else in the dataset
hierarchy, the original snapshot cannot be destroyed as long as the clone exists. The origin property
exposes this dependency, and the zfs destroy command lists any such dependencies, if they exist.
• Features of clones :
➢ Snapshot Testing : You can create a clone from a snapshot of an existing file system,
allowing you to test, updates, or modifications without affecting the original data.
If clones doesn’t work as expected, you can simply delete it.
If clones work as expected, then promote it. And replace the original file with clones.
➢ COW : ZfS uses a Copy-on-write (COW) mechanism, which means that when data is
modified, a new block is written instead of overwriting the original.
➢ Versioning : Clone can be used to create versioned copies of data. This can be helpful in
scenarios where you want to maintain a history of changes or different states of a file
system.
➢ Lightweight copies : Creating a clone is a lightweight operation in zfs. It doesn’t consume
additional space until changes are made to clone.
1. Creating clones from snapshot :

2. After testing, any changes are made on clones or cloned file-system and that changes are fulfill
our expectations then that clone will be promoted and renamed by original existing file and
existing original file (unchanged file) will be renamed as like older file system.

You might also like