Practices for Lesson 6: Managing Data by Using ZFS
Practice 6-1: Administering ZFS Storage Pools
Overview
In this practice, you work with ZFS storage pools in the following tasks: • Creating different types of ZFS pools
• Querying pool attributes
Tasks
1. Verify that the Sol11-Server1 and Sol11-Desktop VMs are running. If they are not, start them now.
2. Determine whether any ZFS pools exist already. root@s11-desktop:~# zpool list
NAME SIZE ALLOC FREE CAP DEDUP HEALTH ALTROOT rpool 39.5G 6.68G 32.8G 16% 1.00x ONLINE -
root@s11-desktop:~#
Note: rpool is the default ZFS pool that is created during OS installation. The
purpose of this pool is to provide ZFS as the root file system.
3. To determine the local disks that are available for new pools, display all the mount points. root@s11-desktop:~# df -h
Filesystem Size Used Available Capacity Mounted on rpool/ROOT/solaris 39G 4.3G 32G 12% / /devices 0K 0K 0K 0% /devices /dev 0K 0K 0K 0% /dev ctfs 0K 0K 0K 0% /system/contract proc 0K 0K 0K 0% /proc mnttab 0K 0K 0K 0% /etc/mnttab swap 886M 1.6M 885M 1% /system/volatile objfs 0K 0K 0K 0% /system/object sharefs 0K 0K 0K 0% /etc/dfs/sharetab /usr/lib/libc/libc_hwcap1.so.1 36G 4.3G 32G 12% /lib/libc.so.1 fd 0K 0K 0K 0% /dev/fd rpool/ROOT/solaris/var 39G 205M 32G 1% /var swap 949M 64M 885M 7% /tmp rpool/VARSHARE 39G 50K 32G 1% /var/share ora 426G 124G 302G 30% /opt/ora rpool/export 39G 32K 32G 1% /export rpool/export/home 39G 37K 32G 1% /export/home rpool/export/home/jholt 39G 35K 32G 1% /export/home/jholt rpool/export/home/jmoose 39G 35K 32G 1% /export/home/jmoose rpool/export/home/oracle 39G 102M 32G 1% /export/home/oracle rpool/export/home/panna 39G 35K 32G 1% /export/home/panna rpool/export/home/sstudent 39G 35K 32G 1% /export/home/sstudent rpool 39G 5.0M 32G 1% /rpool rpool/VARSHARE/zones 39G 31K 32G 1% /rpool/zones
ora 426G 124G 302G 30% /mnt/sf_ora rpool/VARSHARE/pkg 39G 32K 32G 1% /var/share/pkg rpool/VARSHARE/pkg/repositories 39G 31K 32G 1% /var/share/pkg/repositories
root@s11-desktop:~#
Note: The output may vary from system to system.
4. Check the disk being used by rpool.
root@s11-desktop:~# zpool status pool: rpool
state: ONLINE
scan: none requested config:
NAME STATE READ WRITE CKSUM rpool ONLINE 0 0 0 c1t0d0 ONLINE 0 0 0 errors: No known data errors
root@s11-desktop:~#
Notice that slice 0 of the disk c1t0d0 is being used by rpool. So you can assume that this disk is in use.
5. You now find out which storage disks are available on your system. root@s11-desktop:~# format
Searching for disks...done AVAILABLE DISK SELECTIONS:
0. c1t0d0 <ATA-VBOX HARDDISK-1.0-40.00GB> /pci@0,0/pci8086,2829@d/disk@0,0
1. c1t2d0 <ATA-VBOX HARDDISK-1.0 cyl 1022 alt 2 hd 64 sec 32> /pci@0,0/pci8086,2829@d/disk@2,0
2. c1t3d0 <ATA-VBOX HARDDISK-1.0 cyl 1022 alt 2 hd 64 sec 32> /pci@0,0/pci8086,2829@d/disk@3,0
3. c1t4d0 <ATA-VBOX HARDDISK-1.0 cyl 1022 alt 2 hd 64 sec 32> /pci@0,0/pci8086,2829@d/disk@4,0
4. c1t5d0 <ATA-VBOX HARDDISK-1.0 cyl 1022 alt 2 hd 64 sec 32> /pci@0,0/pci8086,2829@d/disk@5,0
5. c1t6d0 <ATA-VBOX HARDDISK-1.0 cyl 1022 alt 2 hd 64 sec 32> /pci@0,0/pci8086,2829@d/disk@6,0
6. c1t7d0 <ATA-VBOX HARDDISK-1.0 cyl 1022 alt 2 hd 64 sec 32> /pci@0,0/pci8086,2829@d/disk@7,0
7. c1t8d0 <ATA-VBOX HARDDISK-1.0 cyl 1022 alt 2 hd 64 sec 32> /pci@0,0/pci8086,2829@d/disk@8,0
8. c1t9d0 <ATA-VBOX HARDDISK-1.0 cyl 1022 alt 2 hd 64 sec 32> /pci@0,0/pci8086,2829@d/disk@9,0
Specify disk (enter its number): ^C
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Practices for Lesson 6: Managing Data by Using ZFS
Because the format command lists all the local hard disks that are available, you can choose any disk except c1t0d0 (because you determined it is being used by rpool).
Note: The disk addresses on your virtual machine may differ from the ones shown in
this example.
6. Now you are ready to create some ZFS pools. Using the disk c1t2d0, create a simple pool with one disk.
root@s11-desktop:~# zpool create oraclehr c1t2d0 root@s11-desktop:~# zpool status oraclehr
pool: oraclehr state: ONLINE
scan: none requested config:
NAME STATE READ WRITE CKSUM oraclehr ONLINE 0 0 0 c1t2d0 ONLINE 0 0 0 errors: No known data errors
As demonstrated by the display, you can tell that the oraclehr pool is using the disk c1t2d0.
7. Create a ZFS mirror pool by using the disks c1t3d0 and c1t4d0 if they are available. Note that you determined in step 8 that these disks are available.
root@s11-desktop:~# zpool create oracledocs mirror c1t3d0 c1t4d0 root@s11-desktop:~# zpool status oracledocs
pool: oracledocs state: ONLINE
scan: none requested config:
NAME STATE READ WRITE CKSUM oracledocs ONLINE 0 0 0 mirror-0 ONLINE 0 0 0 c1t3d0 ONLINE 0 0 0 c1t4d0 ONLINE 0 0 0
errors: No known data errors root@s11-desktop:~#
Note: The purpose of creating a mirror pool is to provide data redundancy.
8. Check the input/output activity of the oraclehr pool.
root@s11-desktop:~# zpool iostat oraclehr
capacity operations bandwidth
pool alloc free read write read write --- --- --- --- --- --- --- oraclehr 85K 1008M 0 3 5.47K 48.1K root@s11-desktop:~#
Here you see the total storage for the pool, as well as the read/write operation information.
9. Create a raidz pool called oraclereq by using the next three available disks. Then view the status of the new pool.
root@s11-desktop:~# zpool create oraclereq raidz c1t5d0 c1t6d0 c1t7d0
root@s11-desktop:~# zpool status oraclereq pool: oraclereq
state: ONLINE
scan: none requested config:
NAME STATE READ WRITE CKSUM oraclereq ONLINE 0 0 0 raidz1-0 ONLINE 0 0 0 c1t5d0 ONLINE 0 0 0 c1t6d0 ONLINE 0 0 0 c1t7d0 ONLINE 0 0 0 errors: No known data errors
root@s11-desktop:~#
Here, you created the raidz pool, as indicated by the status command. The display shows raidz1-0 as the name of the virtual device in the pool. The redundancy is raidz1, meaning that raidz level 1 is maintaining single parity. The digit 0 represents the first virtual device.
The reason your HR analyst wanted you to create a raidz pool as opposed to a mirror pool is that raidz can provide redundancy at a lower cost compared to a mirrored pool. Note that writing to a raidz pool is slower because of calculating and writing parity data compared to mirroring.
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Practices for Lesson 6: Managing Data by Using ZFS