- •Alexandre Borges
- •Credits
- •Free access for Packt account holders
- •Instant updates on new Packt books
- •Table of Contents Preface 1 Chapter 1: ips and Boot Environments 7
- •Introduction 8
- •Installing a package, verifying its content, and fixing the package corruption 13
- •In an inactive boot environment 64
- •Chapter 2: zfs 73
- •Introduction 74
- •Chapter 3: Networking 159
- •Chapter 4: Zones 235
- •Preface
- •Questions
- •Ips and Boot
- •In this chapter, we will cover the following topics:
- •Introduction
- •Determining the current package publisher
- •Getting ready
- •Installing a package, verifying its content, and fixing the package corruption
- •Getting ready
- •Interface
- •Getting ready
- •Listing and renaming a boot environment
- •Getting ready
- •Configuring an ips local repository
- •Getting ready
- •Configuring a secondary ips local repository
- •Getting ready
- •Publishing packages into a repository
- •Getting ready
- •Adding big applications into a repository
- •Getting ready
- •Creating your own package and publishing it
- •Getting ready
- •Managing an ips publisher on Solaris 11
- •Getting ready
- •Pinning publishers
- •Getting ready
- •Getting ready
- •Creating a mirror repository
- •Getting ready
- •Getting ready
- •Listing and creating a boot environment
- •Getting ready
- •Getting ready
- •Activating a boot environment
- •Getting ready
- •Getting ready
- •References
- •Introduction
- •Creating zfs storage pools and filesystems
- •Getting ready
- •Playing with zfs faults and properties
- •Getting ready
- •Creating a zfs snapshot and clone
- •Getting ready
- •Performing a backup in a zfs filesystem
- •Getting ready
- •Handling logs and caches
- •Getting ready
- •Managing devices in storage pools
- •Getting ready
- •Configuring spare disks
- •Getting ready
- •Handling zfs snapshots and clones
- •Getting ready
- •Playing with comstar
- •Getting ready
- •Mirroring the root pool
- •Getting ready
- •Zfs shadowing
- •Getting ready
- •Configuring zfs sharing with the smb share
- •Getting ready
- •Setting and getting other zfs properties
- •Getting ready
- •Playing with the zfs swap
- •Getting ready
- •References
- •Networking
- •Introduction
- •Playing with Reactive Network Configuration
- •Getting ready
- •Internet Protocol Multipathing
- •Getting ready
- •Setting the link aggregation
- •Getting ready
- •Configuring network bridging
- •Getting ready
- •Getting ready
- •Configuring the dhcp server
- •Getting ready
- •Configuring Integrated Load Balancer
- •Getting ready
- •IPv4 forwarding enabled enabled
- •References
- •Introduction
- •Getting ready
- •Id name status path brand ip
- •Getting ready
- •Value is basic (only the owner can modify it).
- •22:52:06 5849 Rcapd
- •Implementing a flow control
- •Getting ready
- •Getting ready
- •Installing: This may take several minutes...
- •References
- •Playing with Oracle
- •Introduction
- •Reviewing smf operations
- •Getting ready
- •Its dependencies
- •Handling manifests and profiles
- •Getting ready
- •Creating smf services
- •Getting ready
- •Getting ready
- •Troubleshooting Oracle Solaris 11 services
- •Getting ready
- •References
- •Configuring and
- •Introduction
- •Getting ready
- •References
- •Configuring and
- •Introduction
- •Configuring and using rbac
- •Getting ready
- •Playing with least privileges
- •Getting ready
- •References
- •Administering and
- •Introduction
- •Monitoring and handling process execution
- •Getting ready
- •2014 May 4 19:25:10, load average: 0.38, 0.30, 0.28 syscalls: 12648
- •Managing processes' priority on Solaris 11
- •Getting ready
- •Configuring fss and applying it to projects
- •Getting ready
- •References
- •Isbn-13: 978-0131568198
- •Configuring the
- •Introduction
- •Configuring the syslog
- •Getting ready
- •Getting ready
- •References
- •Aggregation 191
- •Identifier (fmri) 294 faults, zfs
- •(Trill) 198
- •Values, l4 (Communication)
- •Virtual ip address (vip address) 228 virtual memory size (vsz) 396 virtual network interface (vnic) 238 virtual network, zone
- •Virtual to virtual (v2v) migration 280
- •About Packt Enterprise
- •Writing for Packt
Creating zfs storage pools and filesystems
To start playing with ZFS, the first step is to create a storage pool, and afterwards, all filesystems will be created inside these storage pools. To accomplish the creation of a storage pool, we have to decide which raid configuration we will use (stripe, mirror, or RAID-Z) to create the storage pool and, afterwards, the filesystems on it.
Getting ready
To follow this recipe, it is necessary to use a virtual machine (VMware or VirtualBox) that runs Oracle Solaris 11 with 4 GB RAM and eight 4 GB disks. Once the virtual machine is up and running, log in as the root user and open a terminal.
How to do it…
A storage pool is a logical object, and it represents the physical characteristics of the storage and must be created before anything else. To create a storage pool, the first step is to list all the available disks on the system and choose what disks will be used by running the following command as the root role:
root@solaris11-1:~# format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
c8t0d0 <VBOX-HARDDISK-1.0-80.00GB>
Chapter 2
/pci@0,0/pci1000,8000@14/sd@0,0
c8t1d0 <VBOX-HARDDISK-1.0-16.00GB>
/pci@0,0/pci1000,8000@14/sd@1,0
c8t2d0 <VBOX-HARDDISK-1.0-4.00GB>
/pci@0,0/pci1000,8000@14/sd@2,0
c8t3d0 <VBOX-HARDDISK-1.0 cyl 2046 alt 2 hd 128 sec 32>
/pci@0,0/pci1000,8000@14/sd@3,0
c8t4d0 <VBOX-HARDDISK-1.0 cyl 2046 alt 2 hd 128 sec 32>
/pci@0,0/pci1000,8000@14/sd@4,0
c8t5d0 <VBOX-HARDDISK-1.0 cyl 2046 alt 2 hd 128 sec 32>
/pci@0,0/pci1000,8000@14/sd@5,0
c8t6d0 <VBOX-HARDDISK-1.0 cyl 2046 alt 2 hd 128 sec 32>
/pci@0,0/pci1000,8000@14/sd@6,0
c8t8d0 <VBOX-HARDDISK-1.0 cyl 2046 alt 2 hd 128 sec 32>
/pci@0,0/pci1000,8000@14/sd@8,0
c8t9d0 <VBOX-HARDDISK-1.0 cyl 2046 alt 2 hd 128 sec 32>
/pci@0,0/pci1000,8000@14/sd@9,0
c8t10d0 <VBOX-HARDDISK-1.0 cyl 2046 alt 2 hd 128 sec 32>
/pci@0,0/pci1000,8000@14/sd@a,0
c8t11d0 <VBOX-HARDDISK-1.0 cyl 2046 alt 2 hd 128 sec 32>
/pci@0,0/pci1000,8000@14/sd@b,0 Specify disk (enter its number):
Following the selection of disks, create a zpool create storage pool and verify the information about this pool using the zpool list and zpool status commands. Before these steps, we have to decide the pool configuration: stripe (default), mirror, raidz, raidz2, or raidz3. If the configuration isn't specified, stripe (raid0) will be assumed as default. Then, a pool is created by running the following command:
root@solaris11-1:~# zpool create oracle_stripe_1 c8t3d0 c8t4d0
'oracle_stripe_1' successfully created, but with no redundancy; failure of one device will cause loss of the pool
To list the pool, execute the following commands:
root@solaris11-1:~# zpool list oracle_stripe_1
NAME SIZE ALLOC FREE CAP DEDUP HEALTH ALTROOT
oracle_stripe_1 7.94G 122K 7.94G 0% 1.00x ONLINE -
ZFS
To verify the status of the pool, run the following commands:
root@solaris11-1:~# zpool status oracle_stripe_1
pool: oracle_stripe_1 state: ONLINE
scan: none requested config:
-
NAME
STATE
READ
WRITE
CKSUM
oracle_stripe_1
ONLINE
0
0
0
c8t3d0
ONLINE
0
0
0
c8t4d0
ONLINE
0
0
0
errors: No known data errors
Although it's out of the scope of this chapter, we can list some related performance information by running the following command:
root@solaris11-1:~# zpool iostat -v oracle_stripe_1
capacity operations bandwidth
-
pool
alloc
free
read
write
read
write
----------------
-----
-----
-----
-----
-----
-----
oracle_stripe_1
128K
7.94G
0
0
794
56
c8t3d0
53K
3.97G
0
0
391
24
c8t4d0
74.5K
3.97G
0
0
402
32
----------------
-----
-----
-----
-----
-----
-----
If necessary, a second and third storage pool can be created using the same commands but taking different disks and, in this case, by changing to the mirror and raidz configurations, respectively. This task is accomplished by running the following commands:
root@solaris11-1:~# zpool create oracle_mirror_1 mirror c8t5d0 c8t6d0
root@solaris11-1:~# zpool list oracle_mirror_1
NAME SIZE ALLOC FREE CAP DEDUP HEALTH ALTROOT
oracle_mirror_1 3.97G 85K 3.97G 0% 1.00x ONLINE - root@solaris11-1:~# zpool status oracle_mirror_1
pool: oracle_mirror_1 state: ONLINE
scan:
none requested
config:
Chapter 2
-
NAME
STATE
READ
WRITE
CKSUM
oracle_mirror_1
ONLINE
0
0
0
mirror-0
ONLINE
0
0
0
c8t5d0
ONLINE
0
0
0
c8t6d0
ONLINE
0
0
0
errors: No known data errors
root@solaris11-1:~# zpool create oracle_raidz_1 raidz c8t8d0 c8t9d0 c8t10d0
root@solaris11-1:~# zpool list oracle_raidz_1
NAME SIZE ALLOC FREE CAP DEDUP HEALTH ALTROOT
oracle_raidz_1 11.9G 176K 11.9G 0% 1.00x ONLINE - root@solaris11-1:~# zpool status oracle_raidz_1
pool: oracle_raidz_1 state: ONLINE
scan: none requested config:
-
NAME
STATE
READ
WRITE
CKSUM
oracle_raidz_1
ONLINE
0
0
0
raidz1-0
ONLINE
0
0
0
c8t8d0
ONLINE
0
0
0
c8t9d0
ONLINE
0
0
0
c8t10d0
ONLINE
0
0
0
errors: No known data errors
Once the storage pools are created, it's time to create filesystems in these pools. First, let's create a filesystem named zfs_stripe_1 in the oracle_stripe_1 pool. Execute the following command:
root@solaris11-1:~# zfs create oracle_stripe_1/zfs_stripe_1
Repeating the same syntax, it's easy to create two new filesystems named zfs_mirror_1
and zfs_raidz_1 in oracle_mirror_1 and oracle_raidz_1, respectively:
root@solaris11-1:~# zfs create oracle_mirror_1/zfs_mirror_1
root@solaris11-1:~# zfs create oracle_raidz_1/zfs_raidz_1
ZFS
The listing of recently created filesystems is done by running the following command:
-
root@solaris11-1:~# zfs list
NAME
USED
AVAIL
REFER MOUNTPOINT
(truncated output)
oracle_mirror_1
124K
3.91G
32K /oracle_mirror_1
oracle_mirror_1/zfs_mirror_1 mirror_1
31K
3.91G
31K /oracle_mirror_1/zfs_
oracle_raidz_1
165K
7.83G
36.0K /oracle_raidz_1
oracle_raidz_1/zfs_raidz_1 zfs_raidz_1
34.6K
7.83G
34.6K /oracle_raidz_1/
oracle_stripe_1
128K
7.81G
32K /oracle_stripe_1
oracle_stripe_1/zfs_stripe_1 stripe_1
31K
7.81G
31K /oracle_stripe_1/zfs_
(truncated output)
root@solaris11-1:~# zfs list oracle_stripe_1 oracle_mirror_1 oracle_ raidz_1
NAME USED AVAIL REFER MOUNTPOINT
oracle_mirror_1 124K 3.91G 32K /oracle_mirror_1 oracle_raidz_1 165K 7.83G 36.0K /oracle_raidz_1 oracle_stripe_1 128K 7.81G 32K /oracle_stripe_1
The ZFS engine has automatically created the mount-point directory for all the created filesystems, and it has been mounted on them. This can also be verified by executing the following command:
root@solaris11-1:~# zfs mount
rpool/ROOT/solaris /
rpool/ROOT/solaris/var /var
rpool/VARSHARE /var/share
rpool/export /export
rpool/export/home /export/home
oracle_mirror_1 /oracle_mirror_1 oracle_mirror_1/zfs_mirror_1 /oracle_mirror_1/zfs_mirror_1 oracle_stripe_1 /oracle_stripe_1
Chapter 2
oracle_stripe_1/zfs_stripe_1 /oracle_stripe_1/zfs_stripe_1 rpool /rpool
oracle_raidz_1 /oracle_raidz_1 oracle_raidz_1/zfs_raidz_1 /oracle_raidz_1/zfs_raidz_1
The last two lines confirm that the ZFS filesystems that we created are already mounted and
ready to use.
An overview of the recipe
This recipe has taught us how to create a storage pool with different configurations such as stripe, mirror, and raidz. Additionally, we learned how to create filesystems in these pools.
