Solaris 10 Administration


(Sun E10000, 64 CPUs and 64 GB RAM, 16 SBs, up to 16 domains)


Solaris Volume Manager

Metastate Database
The state database stores information on disk about the state of VM config.
Multiple copies of the database, called replicas, provide redundancy and
protect against data loss if a copy of the database is corrupted.

1 Disk - min 3 replicas
2-4 Disks - 2 replicas each disk
5 or more disks - 1 replica on each disk

Majority Consensus Alogrithm
- at least half of the replicas are available
- causes the system to panic if fewer than half of the replicas available
- won't start VM unless majority replicas are available


#metadb -a [-f] [-c n] [-l nn] disk_slice

-a adds a state database replica
-f forces the operation
-c n specifies the number of the replicas to add to the slice
-l nnn specifies the size of the new replicas, in blocks
disk_slice specifies the disk_slice will hold the replica


#metadb -a -f c0t0d0s4 c0t0d0s5 c1t0d0s1
#metadb -a -f -c 2 c3t2d0s7 c3t3d0s7

#metadb

#metainit -f name numstripes width component...

#metainit -f d0 2 1 c0t0d0s7 c3t2d0s0

#metastat

#ls -iL /dev/md/dsk

#ls -il /dev/md/rdsk

#growfs -M /export/home /dev/md/rdsk/d0


SVM Operation Examples:
------------------------------------------------------------------------------

vfstab

#device device mount FS fsck mount mount
#to mount to fsck point type pass at boot options
#
fd - /dev/fd fd - no -
/proc - /proc proc - no -
/dev/md/dsk/d1 - - swap - no -
/dev/md/dsk/d0 /dev/md/rdsk/d0 / ufs 1 no logging
/dev/md/dsk/d6 /dev/md/rdsk/d6 /zones ufs 2 yes -
/devices - /devices devfs - no -
ctfs - /system/contract ctfs - no -
objfs - /system/object objfs - no -
swap - /tmp tmpfs - yes -

------------------------------------------------------------------------------

ROOT@server1:/root # metadb
flags first blk block count
a m p luo 16 8192 /dev/dsk/c0t0d0s7
a p luo 8208 8192 /dev/dsk/c0t0d0s7
a p luo 16400 8192 /dev/dsk/c0t0d0s7

a = active
size = 8192blk = 4MB

---------------------------------------------------------------------------

layout of the disk

Part Tag Flag Cylinders Size Blocks
0 root wm 2241 - 4481 8.00GB (2241/0/0) 16780608
1 swap wu 0 - 2240 8.00GB (2241/0/0) 16780608
2 backup wm 0 - 38342 136.91GB (38343/0/0) 287112384
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 unassigned wm 4482 - 6722 8.00GB (2241/0/0) 16780608
7 unassigned wm 6723 - 6731 32.91MB (9/0/0) 67392

----------------------------------------------------------------------------


metadb - creates state db replicas

metadb -a -f c0t0d0s4 c0t0d0s5 c1t0d0s0 c1t0d0s1
metadb -a -f -c n -l nnn disk_slice
-f force operation
-c n specifies the number of replicas to add to the slice
-l nnn specifies the size of the new replica in blocks
disk_slice specifies the slice will hold the replica



metainit - creates the metadevices.

metainit -f concat/stripe numstripes witdth component

metainit -f d0 2 1 c0t0d0s7 1 c3t2d0s0




metastat - checks the metadevice configuration

ROOT@server1:/root # metastat
d6: Mirror
Submirror 0: d16
State: Okay
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 16780608 blocks (8.0 GB)

d16: Submirror of d6
State: Okay
Size: 16780608 blocks (8.0 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c0t0d0s6 0 No Okay Yes


d1: Mirror
Submirror 0: d11
State: Okay
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 16780608 blocks (8.0 GB)

d11: Submirror of d1
State: Okay
Size: 16780608 blocks (8.0 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c0t0d0s1 0 No Okay Yes


d0: Mirror
Submirror 0: d10
State: Okay
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 16780608 blocks (8.0 GB)

d10: Submirror of d0
State: Okay
Size: 16780608 blocks (8.0 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c0t0d0s0 0 No Okay Yes


Device Relocation Information:
Device Reloc Device ID
c0t0d0 Yes id1,sd@SFUJITSU_MAW3147NC_______DAF4P7400LPR


ROOT@server1:/root # ls -lL /dev/md/dsk
total 0
brw-r----- 1 root sys 85, 0 Jul 19 16:39 d0
brw-r----- 1 root sys 85, 1 Jul 20 06:12 d1
brw-r----- 1 root sys 85, 10 Jul 20 06:12 d10
brw-r----- 1 root sys 85, 11 Jul 20 06:12 d11
brw-r----- 1 root sys 85, 16 Jul 20 06:12 d16
brw-r----- 1 root sys 85, 6 Jul 19 16:40 d6



Create a swap and a dump fs:

1. create partition 3 and 4: (using the number and lable command in format)
partition> p
Current partition table (unnamed):
Total disk cylinders available: 38343 + 2 (reserved cylinders)

Part Tag Flag Cylinders Size Blocks
0 root wm 2241 - 4481 8.00GB (2241/0/0) 16780608
1 swap wu 0 - 2240 8.00GB (2241/0/0) 16780608
2 backup wm 0 - 38342 136.91GB (38343/0/0) 287112384
3 unassigned wm 6732 - 22415 56.00GB (15684/0/0) 117441792
4 unassigned wm 22416 - 26897 16.00GB (4482/0/0) 33561216
5 unassigned wm 0 0 (0/0/0) 0
6 unassigned wm 4482 - 6722 8.00GB (2241/0/0) 16780608
7 unassigned wm 6723 - 6731 32.91MB (9/0/0) 67392


2. Create the meta device d3 and d4

/usr/sbin/metainit -f d3 1 1 c0t0d0s3

/usr/sbin/metainit -f d4 1 1 c0t0d0s4


3. check:

metastat

d4: Concat/Stripe
Size: 33561216 blocks (16 GB)
Stripe 0:
Device Start Block Dbase Reloc
c0t0d0s4 0 No Yes

d3: Concat/Stripe
Size: 117441792 blocks (56 GB)
Stripe 0:
Device Start Block Dbase Reloc
c0t0d0s3 0 No Yes

Device Relocation Information:
Device Reloc Device ID
c0t0d0 Yes id1,sd@SFUJITSU_MAW3147NC_______DAF4P7400LPR

-----------------------------------------------------------------------------------------
ROOT@server1:/root # newfs -N -v /dev/md/rdsk/d4
mkfs -F ufs -o N /dev/md/rdsk/d4 33561216 -1 -1 8192 1024 155 1 167 8192 t 0 -1 8 16 n
Warning: 3456 sector(s) in last cylinder unallocated
/dev/md/rdsk/d4: 33561216 sectors in 5463 cylinders of 48 tracks, 128 sectors
16387.3MB in 342 cyl groups (16 c/g, 48.00MB/g, 5824 i/g)
Warning: 0 sector(s) in last cylinder unallocated
/dev/md/rdsk/d4: 33561216 sectors in 4482 cylinders of 8 tracks, 936 sectors
16387.3MB in 321 cyl groups (14 c/g, 51.19MB/g, 6208 i/g)
Error determining alternate superblock locations
-------------------------------------------------------------------------------------------


ROOT@server1:/root # newfs -v /dev/md/rdsk/d4
newfs: construct a new file system /dev/md/rdsk/d4: (y/n)? y
mkfs -F ufs /dev/md/rdsk/d4 33561216 -1 -1 8192 1024 155 1 167 8192 t 0 -1 8 16 n
Warning: 3456 sector(s) in last cylinder unallocated
/dev/md/rdsk/d4: 33561216 sectors in 5463 cylinders of 48 tracks, 128 sectors
16387.3MB in 342 cyl groups (16 c/g, 48.00MB/g, 5824 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
32, 98464, 196896, 295328, 393760, 492192, 590624, 689056, 787488, 885920,
Initializing cylinder groups:
......
super-block backups for last 10 cylinder groups at:
32638496, 32736928, 32835360, 32933792, 33032224, 33130656, 33229088,
33327520, 33425952, 33524384

copy rootdisk's vtoc to second disk

ROOT@server1:/root # prtvtoc -h /dev/dsk/c0t0d0s2 fmthard -s - /dev/rdsk/c2t0d0s2


create the replica of metadb c2t0d0 disk on slice 7
ROOT@server1:/root # metadb -a -c 3 c2t0d0s7
ROOT@server1:/root # metadb
flags first blk block count
a m p luo 16 8192 /dev/dsk/c0t0d0s7
a p luo 8208 8192 /dev/dsk/c0t0d0s7
a p luo 16400 8192 /dev/dsk/c0t0d0s7
a u 16 8192 /dev/dsk/c2t0d0s7
a u 8208 8192 /dev/dsk/c2t0d0s7
a u 16400 8192 /dev/dsk/c2t0d0s7

2. Mirror existing meta devices:

a. create submirror meta devices
metainit -f d26 1 1 c2t0d0s6
metainit -f d21 1 1 c2t0d0s1
metainit -f d20 1 1 c2t0d0s0


b. metastat shows current meta device d1 has only one submirror md d11 -

ROOT@server1:/root # metastat d1
d1: Mirror
Submirror 0: d11
State: Okay
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 16780608 blocks (8.0 GB)

d11: Submirror of d1
State: Okay
Size: 16780608 blocks (8.0 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c0t0d0s1 0 No Okay Yes


Device Relocation Information:
Device Reloc Device ID
c0t0d0 Yes id1,sd@SFUJITSU_MAW3147NC_______DAF4P7400LPR


c. attach one submirror md - d21

ROOT@server1:/root # metattach d1 d21
d1: submirror d21 is attached


d. metastat shows d21 is attached to d1 as a submirror.
now, d1 has two submirror mds d11 and 21

ROOT@server1:/root # metastat d1
d1: Mirror
Submirror 0: d11
State: Okay
Submirror 1: d21
State: Resyncing
Resync in progress: 0 % done
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 16780608 blocks (8.0 GB)

d11: Submirror of d1
State: Okay
Size: 16780608 blocks (8.0 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c0t0d0s1 0 No Okay Yes


d21: Submirror of d1
State: Resyncing
Size: 16780608 blocks (8.0 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c2t0d0s1 0 No Okay Yes


Device Relocation Information:
Device Reloc Device ID
c0t0d0 Yes id1,sd@SFUJITSU_MAW3147NC_______DAF4P7400LPR
c2t0d0 Yes id1,sd@SFUJITSU_MAW3147NC_______DAF4P7400M19


Create a md mirror from slice - d13 and d23 are submirrors of d3

a. create md from slices
metainit -f d13 1 1 c0t0d0s3
metainit -f d23 1 1 c0t1d0s3

b. link d13 as the first submirror of d3
metainit d3 -m d13

c. link d23 as submirror of d3
metattach d3 d23