Common Configuration Commands
This section describes how to configure SVM using the CLI.
This document only lists common maintenance commands. You can obtain more details at:
http://docs.oracle.com/cd/E18752_01/html/816-4520/tasks-basics-28.html
State Database
The SVM state database contains configuration and status information about all volumes, hot spares, and disk sets. SVM maintains multiple replicas of the state database to provide redundancy and to prevent the database from being corrupted during a system crash (at most, only one database replica will be corrupted).
The state database replicas ensure that the data in the state database is always valid. When the state database is updated, each state database replica is also updated. Only one replica is updated at a time in case of corruption of all updated replicas due to system crash.
Table 9-2 lists common maintenance commands used for managing SVM state database replicas.
Task |
Command |
---|---|
Create a state database replica. |
metadb -a -c number -f ctds-of-slice |
Check the status of a state database replica. |
metadb -i |
Delete a state database replica. |
metadb -d -f ctds-of-slice |
Do not place state database replicas on fabric-attached storage, SANs, or other storage that is not directly attached to the system. You might not be able to boot SVM. Replicas must be on storage devices that are available at the same point in the boot process as traditional SCSI or IDE drives.
For example:
bash-3.2# metadb -a -c 3 -f c1t2d0s2
bash-3.2# metadb -i
flags first blk block count
a u 16 8192 /dev/dsk/c1t2d0s2
a u 8208 8192 /dev/dsk/c1t2d0s2
a u 16400 8192 /dev/dsk/c1t2d0s2
r - replica does not have device relocation information
o - replica active prior to last mddb configuration change
u - replica is up to date
l - locator for this replica was read successfully
c - replica's location was in /etc/lvm/mddb.cf
p - replica's location was patched in kernel
m - replica is master, this is replica selected as input
W - replica has device write errors
a - replica is active, commits are occurring to this replica
M - replica had problem with master blocks
D - replica had problem with data blocks
F - replica had format problems
S - replica is too small to hold current data base
R - replica had device read errors
bash-3.2#
bash-3.2# metadb -d -f c1t2d0s2
bash-3.2#
bash-3.2# metadb -i
Volume
The Solaris operating system supports RAID-0, RAID-1, and RAID-5. Table 9-3 lists common maintenance commands for these three kinds of volumes.
Volume Name |
Command |
---|---|
RAID-0 |
metainit volume-name number-of-stripes components-per-stripe component-names |
RAID-1 |
metainit volume-name -m submirror-name metattach volume-name submirror-name |
RAID-5 |
metainit volume-name -r component component component |
In the preceding table, each parameter is defined as follows:
- volume-name: indicates the name of a volume that you need to create.
- number-of-stripes: indicates the number of stripes that you need to create.
- components-per-stripe: indicates the quantity of components included in each stripe.
- component: indicates the name of a component that you have used. You need to separate them by a space ( ) if you have used multiple components.
- submirror-name: indicates the name of a component to be used as the first submirror.
The following describes how to create the preceding three kinds of volumes:
Create a RAID-0 volume:
bash-3.00# metainit d10 1 2 c3t2200001882E6B60Bd1s5 c3t2200001882E6B60Bd2s2
d10: Concat/Stripe is setup
bash-3.00#
bash-3.00# metastat
d10: Concat/Stripe
Size: 4181760 blocks (2.0 GB)
Stripe 0: (interlace: 32 blocks)
Device Start Block Dbase Reloc
/dev/dsk/c3t2200001882E6B60Bd1s5 0 No Yes
/dev/dsk/c3t2200001882E6B60Bd2s2 1920 No Yes
Device Relocation Information:
Device Reloc Device ID
/dev/dsk/c3t2200001882E6B60Bd1 Yes id1,ssd@n6001882100e6b60b0060b97b00000005
/dev/dsk/c3t2200001882E6B60Bd2 Yes id1,ssd@n6001882100e6b60b008f84bd00000007
A RAID-0 (stripe) volume has been created by running the preceding commands.
bash-3.00# metainit d12 2 1 c3t2200001882E6B60Bd1s5 1 c3t2200001882E6B60Bd2s2
d12: Concat/Stripe is setup
bash-3.00# metastat
d12: Concat/Stripe
Size: 4189440 blocks (2.0 GB)
Stripe 0:
Device Start Block Dbase Reloc
/dev/dsk/c3t2200001882E6B60Bd1s5 0 No Yes
Stripe 1:
Device Start Block Dbase Reloc
/dev/dsk/c3t2200001882E6B60Bd2s2 1920 No Yes
Device Relocation Information:
Device Reloc Device ID
/dev/dsk/c3t2200001882E6B60Bd1 Yes id1,ssd@n6001882100e6b60b0060b97b00000005
/dev/dsk/c3t2200001882E6B60Bd2 Yes id1,ssd@n6001882100e6b60b008f84bd00000007
bash-3.00#
A RAID-0 (concatenation) volume has been created by running the preceding commands.
Create a RAID-1 volume:
bash-3.00# metainit d10 1 1 c3t2200001882E6B60Bd3s2
d10: Concat/Stripe is setup
bash-3.00# metainit d12 1 1 c3t2200001882E6B60Bd4s2
d12: Concat/Stripe is setup
bash-3.00# metastat
d12: Concat/Stripe
Size: 10481280 blocks (5.0 GB)
Stripe 0:
Device Start Block Dbase Reloc
/dev/dsk/c3t2200001882E6B60Bd4s2 0 No Yes
d10: Concat/Stripe
Size: 10481280 blocks (5.0 GB)
Stripe 0:
Device Start Block Dbase Reloc
/dev/dsk/c3t2200001882E6B60Bd3s2 0 No Yes
Device Relocation Information:
Device Reloc Device ID
/dev/dsk/c3t2200001882E6B60Bd4 Yes id1,ssd@n6001882100e6b60b00b333bf00000009
/dev/dsk/c3t2200001882E6B60Bd3 Yes id1,ssd@n6001882100e6b60b00b32e0000000008
bash-3.00#
bash-3.00# metainit d13 -m d10
d13: Mirror is setup
bash-3.00# metattach d13 d12
d13: submirror d12 is attached
bash-3.00# metastat
d13: Mirror
Submirror 0: d10
State: Okay
Submirror 1: d12
State: Resyncing
Resync in progress: 0 % done
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 10481280 blocks (5.0 GB)
d10: Submirror of d13
State: Okay
Size: 10481280 blocks (5.0 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
/dev/dsk/c3t2200001882E6B60Bd3s2 0 No Okay Yes
d12: Submirror of d13
State: Resyncing
Size: 10481280 blocks (5.0 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
/dev/dsk/c3t2200001882E6B60Bd4s2 0 No Okay Yes
Device Relocation Information:
Device Reloc Device ID
/dev/dsk/c3t2200001882E6B60Bd4 Yes id1,ssd@n6001882100e6b60b00b333bf00000009
/dev/dsk/c3t2200001882E6B60Bd3 Yes id1,ssd@n6001882100e6b60b00b32e0000000008
bash-3.00#
A RAID-1 volume has been created by running the preceding commands.
When creating a RAID-1 volume, you must note the following:
- You need to create RAID-0 (stripe or concatenation) volumes before creating a mirror.
- You need to create a one-way mirror and attach the second submirror. This policy enables re-synchronization.
- You need to use submirrors of the same size, because partial disk space may be unavailable if you use submirrors of different sizes.
- If the first submirror is not attached from cylinder 0 to a mirrored file system, all other submirrors attached also do this.
- You only need to mount a mirroring device. Do not mount any submirror unless such a mirror is in the offline state and mounted in read-only mode. Do not mount slices that are part of submirrors. To mount these disks may cause data destruction and system crash.
Create a RAID-5 volume:
bash-3.00# metainit d15 -r c3t2200001882E6B60Bd7s2 c3t2200001882E6B60Bd8s2 c3t2200001882E6B60Bd9s2
d15: RAID is setup
bash-3.00# metastat
d15: RAID
State: Initializing
Initialization in progress: 1.7% done
Interlace: 32 blocks
Size: 12566400 blocks (6.0 GB)
Original device:
Size: 12567616 blocks (6.0 GB)
Device Start Block Dbase State Reloc Hot Spare
/dev/dsk/c3t2200001882E6B60Bd7s2 2250 No Initializing Yes
/dev/dsk/c3t2200001882E6B60Bd8s2 2250 No Initializing Yes
/dev/dsk/c3t2200001882E6B60Bd9s2 2250 No Initializing Yes
Device Relocation Information:
Device Reloc Device ID
/dev/dsk/c3t2200001882E6B60Bd7 Yes id1,ssd@n6001882100e6b60b00f28b680000000c
/dev/dsk/c3t2200001882E6B60Bd8 Yes id1,ssd@n6001882100e6b60b00f291420000000d
/dev/dsk/c3t2200001882E6B60Bd9 Yes id1,ssd@n6001882100e6b60b00f297770000000e
bash-3.00#
bash-3.00# metastat
d15: RAID
State: Okay
Interlace: 32 blocks
Size: 12566400 blocks (6.0 GB)
Original device:
Size: 12567616 blocks (6.0 GB)
Device Start Block Dbase State Reloc Hot Spare
/dev/dsk/c3t2200001882E6B60Bd7s2 2250 No Okay Yes
/dev/dsk/c3t2200001882E6B60Bd8s2 2250 No Okay Yes
/dev/dsk/c3t2200001882E6B60Bd9s2 2250 No Okay Yes
Device Relocation Information:
Device Reloc Device ID
/dev/dsk/c3t2200001882E6B60Bd7 Yes id1,ssd@n6001882100e6b60b00f28b680000000c
/dev/dsk/c3t2200001882E6B60Bd8 Yes id1,ssd@n6001882100e6b60b00f291420000000d
/dev/dsk/c3t2200001882E6B60Bd9 Yes id1,ssd@n6001882100e6b60b00f297770000000e
bash-3.00#
After you create the RAID-1 and RAID-5 volumes, data synchronization is enabled. You cannot perform other volume operations until data is completely synchronized.
Soft Partition
Table 9-4 lists common maintenance commands for soft partitions.
Task |
Command |
---|---|
Create a soft partition. |
metainit [-s diskset] soft-partition -p [-e] component size |
Check a soft partition. |
metastat soft-partition |
Delete a soft partition. |
metaclear [-s diskset] component metaclear [-s diskset] -r soft-partition metaclear [-s diskset] -p component |
In the preceding table, each parameter is defined as follows:
- -s diskset: indicates a disk set that you need to use. If -s diskset is not specified, a local (default) disk set is to be used.
- -p: indicates that you need to configure a soft partition.
- -e: indicates that you must reformat the whole disk. The formatted disk contains slice 0, which occupies most disk space. In addition, it provides slice 7 whose size is at least 4 MB and the slice 7 contains state database replicas.
- soft-partition: indicates the name of a soft partition. The name is displayed in dnnn format, where nnn indicates a number that ranges from 0 to 8192.
- component: indicates a disk, slice, or logical volume where you need to create the soft partition. All existing data stored on the component is destroyed, because the soft partition headers are written at the beginning of the component.
- size: indicates the size of a soft partition.
For example:
bash-3.00# metainit d100 -p d17 2048M
d100: Soft Partition is setup
bash-3.00# metainit d101 -p d16 2048M
d101: Soft Partition is setup
bash-3.00# metainit d102 -p c3t2200001882E6B60Bd15s2 2G
d102: Soft Partition is setup
bash-3.00# metaclear d17
bash-3.00# metaclear -p c3t2200001882E6B60Bd15s2
bash-3.00# metaclear d101
Hot Spare Pool
Table 9-5 lists common maintenance commands for hot spare pools.
Task |
Command |
---|---|
Create a hot spare pool. |
metainit hot-spare-pool-name ctds-for-slice |
Add slices to a hot spare pool. |
metahs -a hot-spare-pool-name slice-to-add metahs -a -all hot-spare-pool-name slice-to-add |
Associate a hot spare pool with volumes |
metaparam -h hot-spare-pool component |
Check the states of a hot spare pool and hot spares. |
metastat hot-spare-pool-name |
Replace hot spares included in a hot spare pool. |
metahs -r hot-spare-pool-name current-hot-spare replacement-hot-spare |
Delete hot spares included in a hot spare pool. |
metahs -d hot-spare-pool-name current-hot-spare |
In the preceding table, each parameter is defined as follows:
- hot-spare-pool-name: indicates the name of a hot spare pool.
- ctds-for-slice: indicates slices that you need to add to a hot spare pool. For each slice to be added to a hot spare pool, you need to repeat this task.
- slice-to-add: indicates slices that you need to add to a hot spare pool.
- component: indicates the name of a submirror or RAID-5 volume associated with a hot spare pool.
- current-hot-spare: indicates the name of the current hot spare to be replaced.
- replacement-hot-spare: indicates the name of a slice of the current hot spare to be replaced in a specified hot spare pool.
Examples are given as follows:
Create a hot spare pool:
bash-3.00# metainit hsp001 c3t2200001882E6B60Bd16s2 c3t2200001882E6B60Bd17s2
hsp001: Hotspare pool is setup
Add slices to a hot spare pool:
bash-3.00# metastat hsp003
hsp003: 1 hot spare
Device Status Length Reloc
/dev/dsk/c3t2200001882E6B60Bd21s2 Available 2092800 blocks Yes
Device Relocation Information:
Device Reloc Device ID
/dev/dsk/c3t2200001882E6B60Bd21 Yes id1,ssd@n6001882100e6b60b04c54b6f0000001a
bash-3.00#
bash-3.00# metahs -a hsp003 c3t2200001882E6B60Bd20s2
hsp003: Hotspare is added
bash-3.00# metastat hsp003
hsp003: 2 hot spares
Device Status Length Reloc
/dev/dsk/c3t2200001882E6B60Bd21s2 Available 2092800 blocks Yes
/dev/dsk/c3t2200001882E6B60Bd20s2 Available 2092800 blocks Yes
Device Relocation Information:
Device Reloc Device ID
/dev/dsk/c3t2200001882E6B60Bd21 Yes id1,ssd@n6001882100e6b60b04c54b6f0000001a
/dev/dsk/c3t2200001882E6B60Bd20 Yes id1,ssd@n6001882100e6b60b04c545d400000019
Associate a hot spare pool with volumes:
bash-3.00# metaparam -h hsp001 d16
bash-3.00# metastat d16
d16: Concat/Stripe
Hot spare pool: hsp001
Size: 12568320 blocks (6.0 GB)
Stripe 0: (interlace: 32 blocks)
Device Start Block Dbase State Reloc Hot Spare
/dev/dsk/c3t2200001882E6B60Bd11s2 0 No Okay Yes
/dev/dsk/c3t2200001882E6B60Bd12s2 1920 No Okay Yes
Device Relocation Information:
Device Reloc Device ID
/dev/dsk/c3t2200001882E6B60Bd11 Yes id1,ssd@n6001882100e6b60b00f2a33c00000010
/dev/dsk/c3t2200001882E6B60Bd12 Yes id1,ssd@n6001882100e6b60b00f2a8d300000011
bash-3.00#
Replace hot spares included in a hot spare pool:
bash-3.00# metastat hsp002
hsp002: 2 hot spares
Device Status Length Reloc
/dev/dsk/c3t2200001882E6B60Bd18s2 Available 2092800 blocks Yes
/dev/dsk/c3t2200001882E6B60Bd19s2 Available 2092800 blocks Yes
Device Relocation Information:
Device Reloc Device ID
/dev/dsk/c3t2200001882E6B60Bd18 Yes id1,ssd@n6001882100e6b60b04c53acc00000017
/dev/dsk/c3t2200001882E6B60Bd19 Yes id1,ssd@n6001882100e6b60b04c5404b00000018
bash-3.00# metahs -r hsp002 c3t2200001882E6B60Bd18s2 c3t2200001882E6B60Bd22s2
hsp002: Hotspare c3t2200001882E6B60Bd18s2 is replaced with c3t2200001882E6B60Bd22s2
bash-3.00# metastat hsp002
hsp002: 2 hot spares
Device Status Length Reloc
/dev/dsk/c3t2200001882E6B60Bd22s2 Available 2092800 blocks Yes
/dev/dsk/c3t2200001882E6B60Bd19s2 Available 2092800 blocks Yes
Device Relocation Information:
Device Reloc Device ID
/dev/dsk/c3t2200001882E6B60Bd22 Yes id1,ssd@n6001882100e6b60b04c550fc0000001b
/dev/dsk/c3t2200001882E6B60Bd19 Yes id1,ssd@n6001882100e6b60b04c5404b00000018
bash-3.00#
Delete hot spares included in a hot spare pool:
bash-3.00# metastat hsp003
hsp003: 2 hot spares
Device Status Length Reloc
/dev/dsk/c3t2200001882E6B60Bd20s2 Available 2092800 blocks Yes
/dev/dsk/c3t2200001882E6B60Bd21s2 Available 2092800 blocks Yes
Device Relocation Information:
Device Reloc Device ID
/dev/dsk/c3t2200001882E6B60Bd20 Yes id1,ssd@n6001882100e6b60b04c545d400000019
/dev/dsk/c3t2200001882E6B60Bd21 Yes id1,ssd@n6001882100e6b60b04c54b6f0000001a
bash-3.00# metahs -d hsp003 c3t2200001882E6B60Bd20s2
hsp003: Hotspare is deleted
bash-3.00# metastat hsp003
hsp003: 1 hot spare
Device Status Length Reloc
/dev/dsk/c3t2200001882E6B60Bd21s2 Available 2092800 blocks Yes
Device Relocation Information:
Device Reloc Device ID
/dev/dsk/c3t2200001882E6B60Bd21 Yes id1,ssd@n6001882100e6b60b04c54b6f0000001a
Disk Set
Table 9-6 lists common maintenance commands for disk sets.
Task |
Command |
---|---|
Create a disk set. |
metaset -s diskset-name -a -h -M hostname |
Add disks to a disk set. |
metaset -s diskset-name -a disk-name |
Add hosts to a disk set. |
metaset -s diskset-name -a -h hostname |
Create SVM volumes in a disk set. |
command -s diskset-name |
Delete disks from a disk set. |
metaset -s diskset-name -d disk-name |
Delete a host or disk set. |
metaset -s diskset-name -d -h hostname |
In the preceding table, each parameter is defined as follows:
- diskset-name: indicates the name of a disk set for which the metaset command is executed.
- hostname: indicates a host name, which is the same as that found in the /etc/nodename file.
- disk-name: indicates a disk that you need to operate. The disk name takes the cxtxdx format. You can add a disk without the sx identifier to a disk set.
The commands for creating an SVM volume in a disk set are the same as those for creating a volume. However, each command is followed by -s diskset-name.
Examples are given as follows:
Create a disk set:
bash-3.00# metaset
bash-3.00# metaset -s blue -a -h solaris11
bash-3.00# metaset
Set name = blue, Set number = 1
Host Owner
solaris11
bash-3.00#
Add disks to a disk set:
bash-3.00# metaset -s blue -a c3t2200001882E6B60Bd18
bash-3.00# metaset -s blue -a c3t2200001882E6B60Bd24 c3t2200001882E6B60Bd23
bash-3.00# metaset
Set name = blue, Set number = 1
Host Owner
solaris11 Yes
Drive Dbase
/dev/dsk/c3t2200001882E6B60Bd18 Yes
/dev/dsk/c3t2200001882E6B60Bd24 Yes
/dev/dsk/c3t2200001882E6B60Bd23 Yes
Multi-owner Set name = red, Set number = 2, Master =
Host Owner Member
solaris11 Yes
bash-3.00#
Add hosts to a disk set:
bash-3.00# metaset -s blue -a -h host2
bash-3.00# metaset
Set name = blue, Set number = 1
Host Owner
host1 Yes
host2
Drive Dbase
c1t6d0 Yes
c2t6d0 Yes
Create SVM volumes in a disk set:
bash-3.00# metainit -s blue d11 1 1 c1t6d0s0
blue/d11: Concat/Stripe is setup
bash-3.00# metainit -s blue d12 1 1 c2t6d0s0
blue/d12: Concat/Stripe is setup
bash-3.00# metainit -s blue d10 -m d11
blue/d10: Mirror is setup
bash-3.00# metattach -s blue d10 d12
blue/d10: submirror blue/d12 is attached
bash-3.00#
bash-3.00#
bash-3.00# metastat -s blue
blue/d10: Mirror
Submirror 0: blue/d11
State: Okay
Submirror 1: blue/d12
State: Resyncing
Resync in progress: 0 % done
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 17674902 blocks
blue/d11: Submirror of blue/d10
State: Okay
Size: 17674902 blocks
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c1t6d0s0 0 No Okay
blue/d12: Submirror of blue/d10
State: Resyncing
Size: 17674902 blocks
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c2t6d0s0 0 No Okay
Delete disks from a disk set:
bash-3.00# metaset -s blue -d c3t2200001882E6B60Bd23
Delete a host or disk set:
bash-3.00# metaset -s blue -d c3t2200001882E6B60Bd23
bash-3.00# metaset -s blue -d c3t2200001882E6B60Bd18
metaset: solaris11: Must specify -f option to delete all drives from set
bash-3.00# metaset -s blue -f -d c3t2200001882E6B60Bd18
bash-3.00# metaset -s blue
Set name = blue, Set number = 1
Host Owner
solaris11
bash-3.00# metaset -s blue -d -h solaris11
bash-3.00# metaset
Multi-owner Set name = red, Set number = 2, Master = solaris11
Host Owner Member
solaris11 multi-owner Yes
Drive Dbase
/dev/dsk/c3t2200001882E6B60Bd25 Yes
/dev/dsk/c3t2200001882E6B60Bd26 Yes