Configuration instances for Solaris ZFS file systems

Source: Internet
Author: User
Tags file system joins

ZFS file systems are an important feature of Solaris 10, and instance configurations can be more capacity-aware of ZFS file system configurations.

One, Solaris Disk basics

1. Disk View method

# format
AVAILABLE DISK Selections:
0. c0d1 <xxx cyl 6524 alt 2 HD 255 sec 63>
/pci@0,0/pci-ide@7,1/ide@1/cmdk@1,0
1. c1t0d0 <vmware,-vmwarevirtuals-1.0 cyl 1302 alt 2 HD 255 sec 63>
/pci@0,0/pci15ad,1976@10/sd@0,0
2. c1t1d0 <vmware,-vmware Virtual s-1.0-10.00gb>
/pci@0,0/pci15ad,1976@10/sd@1,0
3. c1t2d0 <vmware,-vmware Virtual-1.0 cyl 1303 alt 2 HD 255 sec 63>
/pci@0,0/pci15ad,1976@10/sd@2,0
4. c1t3d0 <vmware,-vmware Virtual s-1.0-10.00gb>
/pci@0,0/pci15ad,1976@10/sd@3,0

Specify disk (enter its number): 3
# Quit Quit

See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/OS/unix/

2. Disk capacity View method

# IOSTAT-E

Second, ZFS file system configuration

1. Create Zpool (RAID0)

Create a ZFS file system named a

# zpool create-f c1t0d0 c1t1d0 c1t2d0

' A ' successfully created, but with no redundancy; Failure of one
Device would cause loss of the pool

Description
# Tip Three disk does not do redundancy, bad a disk is all bad.
# The hard disk that joins pool is the whole disk, which makes it easy for the pool to manage the hard disk.
# because a UFS has been used before the disk that joins the pool, the-f option is required during the creation process to ignore the UFS file format to force the hard drive into the pool.

Expansion of Pool

# Zpool Add-c1t3d0

-N Simulation results after the expansion
-F Enforcement

# Zpool Add-n-F-c1t3d0
Would update ' the following configuration:
The
C1t0d0
C1t1d0
C1t3d0

2. Create mirrored pool, usually two pieces of disk size (RAID1)
# zpool Create-f Mirror c1t0d0 c1t1d0

3. Create Mirror Pool (RAID 10)
# zpool Create-f Mirror c1t0d0 c1t1d0 Mirror c1t2d0 c1t3d0

4. Create Raidz Zpool (RAID5)
# Zpool Create a raidz2 c1t0d0 c1t1d0 c1t2d0 c1t3d0

5. Create Raidz Zpool and add a hot spare
# Zpool Create raidz2 c1t0d0 c1t1d0 c1t2d0 Spare c1t3d0

(1) The addition of hot spare plate
# Zpool Add-Spare c1t3d0

(2) The removal of hot spare plate
# Zpool Remove-c1t3d0

6. Mirroring and splitting mirrors

(1) Create mirror
If you create a zpool, the physical disk is a single, you can mirror it, and the command format is
# Zpool Attach the new disk of the old disk

# Zpool Attach c1t0d0 c1t1d0

(2) split mirror (contrary to the image process because of impact data)
# Zpool Detach, c1t1d0

7. Delete Zpool

# Zpool Destroy Poolname
# Zpool Destroy-f poolname

8. View Zpool list, status

# Zpool List
# Zpool status [-x][-v]
# The purpose of the checksum
# Zpool Scrub poolname

# The purpose of the checksum, which typically takes a long time,
# Zpool Status View the verification progress, preferably in the hardware problems, after the solution is verified to ensure that everything is normal.

9. Create a file system

Classic usage examples

1) Create U01 file system
# ZFS Create first/u01

2) mount to the/u01 directory, not mount can also be used directly
# ZFS Set mountpoint=/u01 first/u01

3) Set disk quotas
# ZFS Set quota=20g first/u01

Creating snapshots

1) Create snapshots
# ZFS Snapshot First/u01@ok

2) Restore the snapshot
# ZFS Rollback First/u01@ok

3 Delete snapshots and ZFS file systems

Note: When deleting a u01 snapshot, the Add-r parameter is deleted with the same origin and used with caution.
# ZFS Destroy-r First/u01@ok

To create a ZFS clone:

Create a ZFS directory from a snapshot

# ZFS Clone First/u01@ok First/bak

This article is from "Koumm Linux Technology blog" blog, please be sure to keep this source http://koumm.blog.51cto.com/703525/1250917

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.