24
Submitted by: Prabhakar Jaiswal Employee ID: 818089 Enterprise Services

ZFS imp

Embed Size (px)

DESCRIPTION

zfs imp

Citation preview

Page 1: ZFS imp

Submitted by: Prabhakar JaiswalEmployee ID: 818089Enterprise Services

Page 2: ZFS imp

ZFS

Introduction to the ZFS File System

Page 3: ZFS imp

Objectives• Describe the Solaris ZFS file system• Create new ZFS pools and file

systems• Modify ZFS file system properties• Mount and unmount ZFS file systems• Destroy ZFS pools and file systems

Page 4: ZFS imp

What Is ZFS?• ZFS SnapshotsZFS snapshots are read-only copies of file

systemsthat initially consume no additional space in

apool.

• Simplified AdministrationZFS uses a simplified command set, uses anhierarchical file system layout, supports file

systemproperty inheritance and automatic mount

points.

Page 5: ZFS imp

ZFS Terminology

• dataset - A generic name for the following ZFS entities:

clones, file systems, snapshots, or volumes.

• mirror - A virtual device that stores identical copies of data on two or more disks.

Page 6: ZFS imp

• pool - A logical group of devices describing the layout

and physical characteristics of the available storage.

• RAID-Z - A virtual device that stores data and parity

on multiple disks, similar to RAID-5.

• resilvering -The process of transferring data from one

device to another device is known as resilvering.

• snapshot - A read-only image of a file system orvolume at a given point in time.

• virtual device - A logical device in a pool, which can be

a physical device, a file, or a collection of devices.

• volume - A dataset used to emulate a physical device.

Page 7: ZFS imp

ZFS Component Naming RequirementsEmpty components are not allowed.Each component can only contain

alphanumeric characters in addition to the following four special characters:

• Underscore (_)• Hyphen (-)• Colon (:)• Period (.)

Page 8: ZFS imp

Pool names must begin with a letter, except that the beginning

sequence c[0-9] is not allowed. In addition, pool names that begin with mirror, raidz, or spare are not allowed as these name are reserved.

Dataset names must begin with an alphanumeric character.

Page 9: ZFS imp

• The minimum disk size is 128 Mbytes. For good ZFS performance, at least one Gbyte or

more of memory is recommended.

Page 10: ZFS imp

Creating ZFS File SystemsOne goal of the ZFS design is to reduce the number

ofcommands needed to create a usable file system.When you create a new pool, a new ZFS file system

is created and mounted automatically.Within a pool, you will probably want to create

additional file systems.In most cases, you will probably want to create and

organize a hierarchy of file systems that matches your organizationalneeds.

Page 11: ZFS imp

A storage device can be a whole disk (c1t0d0) or an

individual slice (c0t0d0s7).The recommended mode of operation

is to use an entire disk.ZFS applies an EFI label when you

create a storage pool withwhole disks

Page 12: ZFS imp

mirror c1t0d0 c2t0d0Creating a Basic Storage PoolThe following command creates a new pool named tank thatconsists of the disk c1t0d0# zpool create tank c1t0d0

Page 13: ZFS imp

You can request specific statistics by using the -o option.

For example, to list only the name and size of each pool, you use the following syntax:

# zpool list -o name,sizeNAME SIZEtank 80.0Gdozer 1.2T

Page 14: ZFS imp

• The simplest way to request a quick overview of pool health status is to use the zpool status command:

# zpool status -xall pools are healthy

Page 15: ZFS imp

• ONLINE The device is in normal working order.

• DEGRADED The virtual device has experienced failure but is still able to function.

• FAULTED The virtual device is completely inaccessible. This status typically indicates total failure of the device, such that ZFS is incapable of sending or receiving data from it.

• If a top-level virtual device is in this state, then the pool is completely inaccessible.

• OFFLINE The virtual device has been explicitly taken offline by the administrator.

• UNAVAILABLE The device or virtual device cannot be opened. In some cases, pools with UNAVAILABLE devices appear in DEGRADED mode. If a top-level virtual device

• is unavailable, then nothing in the pool can be accessed.

Page 16: ZFS imp

zfs create tank/home/bonwickZFS automatically mounts the newly

created file system if it is created successfully.

Page 17: ZFS imp

Renaming a ZFS File System (cont.)The following example uses the rename

subcommand to simply rename a file system:

# zfs rename tank/home/kustarz tank/home/kustarz_old

The following example shows how to use zfs rename to

relocate a file system.# zfs rename tank/home/maybee

tank/ws/maybee

Page 18: ZFS imp

# zfs set mountpoint=legacy tank/home/eschrock

# mount -F zfs tank/home/eschrock /mnt

Page 19: ZFS imp

The zfs mount command with no argument shows all currently mounted file systems that are managed by ZFS.

# zfs mounttank /tanktank/home /tank/hometank/home/bonwick

/tank/home/bonwick

Page 20: ZFS imp

You can use the -a option to mount all ZFS managed file

systems. For example:# zfs mount -aThis command does not mount legacy

managed file systems.

Page 21: ZFS imp

ZFS SnapshotsA snapshot is a read-only copy of a file system or

volume.Snapshots are created almost instantly, and initially

consume no additional disk space within the pool.

ZFS snapshots include the following features:• Snapshots persist across system reboots.• The theoretical maximum number of snapshots is

264.• Snapshots use no separate backing store.

Snapshotsconsume disk space directly from the same storagepool as the file system from which they were

created.

Page 22: ZFS imp

Creating and Destroying ZFS SnapshotsYou use the zfs snapshot command to create ZFSsnapshots. The zfs snapshot command takes the

name ofthe snapshot to create as its only argument.Snapshot names use the following format:filesystem@snapnamevolume@snapnameThe following example creates a snapshot of

tank/home/ahrens that is named friday.# zfs snapshot tank/home/ahrens@friday

Page 23: ZFS imp

You use the zfs destroy command to destroy a ZFS

snapshot. For example:# zfs destroy

tank/home/ahrens@fridayAdataset cannot be destroyed if

snapshots of the dataset exist.

Page 24: ZFS imp

The End