Tag: format

Solaris Volume Manager – Delete replicas of the metadevice state database

In this Solaris server, one of the disks needs replacement

root@solaris # echo | format
Searching for disks…done

AVAILABLE DISK SELECTIONS:
0. c0t2d0 <drive not available>
/pci@1f,0/pci@1,1/scsi@2/sd@2,0
1. c0t3d0 <SUN72G cyl 14087 alt 2 hd 24 sec 424>
/pci@1f,0/pci@1,1/scsi@2/sd@3,0
Specify disk (enter its number): Specify disk (enter its number):

Checking replicas of the metadevice state database

root@solaris # metadb
flags first blk block count
M p 16 unknown /dev/dsk/c0t2d0s4
M p 8208 unknown /dev/dsk/c0t2d0s4
M p 16400 unknown /dev/dsk/c0t2d0s4
M p 16 unknown /dev/dsk/c0t2d0s5
M p 8208 unknown /dev/dsk/c0t2d0s5
M p 16400 unknown /dev/dsk/c0t2d0s5
a m p lu 16 8192 /dev/dsk/c0t3d0s4
a p l 8208 8192 /dev/dsk/c0t3d0s4
a p l 16400 8192 /dev/dsk/c0t3d0s4
a p l 16 8192 /dev/dsk/c0t3d0s5
a p l 8208 8192 /dev/dsk/c0t3d0s5
a p l 16400 8192 /dev/dsk/c0t3d0s5

Deleting metadevice state database on the slices of the bad disk. First slice 4

root@solaris # metadb -d /dev/dsk/c0t2d0s4
metadb: solaris: Bad address

root@solaris # metadb
flags first blk block count
M p 16 unknown /dev/dsk/c0t2d0s5
M p 8208 unknown /dev/dsk/c0t2d0s5
M p 16400 unknown /dev/dsk/c0t2d0s5
a m p lu 16 8192 /dev/dsk/c0t3d0s4
a p l 8208 8192 /dev/dsk/c0t3d0s4
a p l 16400 8192 /dev/dsk/c0t3d0s4
a p l 16 8192 /dev/dsk/c0t3d0s5
a p l 8208 8192 /dev/dsk/c0t3d0s5
a p l 16400 8192 /dev/dsk/c0t3d0s5

And then in slice 5

root@solaris # metadb -d /dev/dsk/c0t2d0s5
metadb: solaris: Bad address

root@solaris # metadb
flags first blk block count
a m p lu 16 8192 /dev/dsk/c0t3d0s4
a p l 8208 8192 /dev/dsk/c0t3d0s4
a p l 16400 8192 /dev/dsk/c0t3d0s4
a p l 16 8192 /dev/dsk/c0t3d0s5
a p l 8208 8192 /dev/dsk/c0t3d0s5
a p l 16400 8192 /dev/dsk/c0t3d0s5

Resizing a VXFS filesystem on Solaris

I will resize a filesystem with 4 LUNs with 500GB

First, checking disk group, volume and mount point

root@solaris:/ # df -h /usr/software/documentum/engineering
Filesystem size used avail capacity Mounted on
/dev/vx/dsk/documentumdg/ged_engineeringvol
9.3T 8.8T 473G 96% /usr/software/documentum/engineering

Storage team provided these four LUN IDs
6029 / 6030 / 6031 / 6032

Verifying which HBA card is online – c3 and c5

root@solaris:/ # fcinfo hba-port | egrep ‘OS Device Name|State’
OS Device Name: /dev/cfg/c11
State: offline
OS Device Name: /dev/cfg/c12
State: offline
OS Device Name: /dev/cfg/c9
State: offline
OS Device Name: /dev/cfg/c10
State: offline
OS Device Name: /dev/cfg/c4
State: offline
OS Device Name: /dev/cfg/c5
State: online
OS Device Name: /dev/cfg/c2
State: offline
OS Device Name: /dev/cfg/c3
State: online

Making the LUNs available to Solaris and Veritas Volume Manager

root@solaris:/ # cfgadm -c configure c5
root@solaris:/ # cfgadm -c configure c3
root@solaris:/ # devfsadm -C
root@solaris:/ # vxdctl enable

Searching for all 4 LUNs in Solaris

root@solaris:/ # echo | format | grep 6029
c6t6005076308FFC2A70000000000006029d0: configured with capacity of 499.98GB
4. c6t6005076308FFC2A70000000000006029d0
/scsi_vhci/ssd@g6005076308ffc2a70000000000006029

root@solaris:/ # echo | format | grep 6030
c6t6005076308FFC2A70000000000006030d0: configured with capacity of 499.98GB
9. c6t6005076308FFC2A70000000000006030d0
/scsi_vhci/ssd@g6005076308ffc2a70000000000006030

root@solaris:/ # echo | format | grep 6031
c6t6005076308FFC2A70000000000006031d0: configured with capacity of 499.98GB
11. c6t6005076308FFC2A70000000000006031d0
/scsi_vhci/ssd@g6005076308ffc2a70000000000006031

root@solaris:/ # echo | format | grep 6032
c6t6005076308FFC2A70000000000006032d0: configured with capacity of 499.98GB
10. c6t6005076308FFC2A70000000000006032d0
/scsi_vhci/ssd@g6005076308ffc2a70000000000006032

Searching for all 4 LUNs in Veritas Volume Manager

root@solaris:/ # vxdisk -o alldgs -e list | egrep ‘6029|6030|6031|6032’
ibm_ds8x000_6029 auto – – nolabel c6t6005076308FFC2A70000000000006029d0s2 std
ibm_ds8x000_6030 auto – – nolabel c6t6005076308FFC2A70000000000006030d0s2 std
ibm_ds8x000_6031 auto – – nolabel c6t6005076308FFC2A70000000000006031d0s2 std
ibm_ds8x000_6032 auto – – nolabel c6t6005076308FFC2A70000000000006032d0s2 std

Apply label on all 4 disks

root@solaris:/ # format c6t6005076308FFC2A70000000000006029d0s2

c6t6005076308FFC2A70000000000006029d0s2: configured with capacity of 499.98GB
selecting c6t6005076308FFC2A70000000000006029d0s2
[disk formatted]

FORMAT MENU:
disk – select a disk
type – select (define) a disk type
partition – select (define) a partition table
current – describe the current disk
format – format and analyze the disk
repair – repair a defective sector
label – write label to the disk
analyze – surface analysis
defect – defect list management
backup – search for backup labels
verify – read and display labels
save – save new disk/partition definitions
inquiry – show vendor, product and revision
volname – set 8-character volume name
! – execute , then return
quit
format> label
Ready to label disk, continue? y

format> q

The disks will show the status online invalid instead of nolabel

root@solaris:/ # vxdisk -o alldgs -e list | egrep ‘6029|6030|6031|6032’
ibm_ds8x000_6029 auto:none – – online invalid c6t6005076308FFC2A70000000000006029d0s2 std
ibm_ds8x000_6030 auto:none – – online invalid c6t6005076308FFC2A70000000000006030d0s2 std
ibm_ds8x000_6031 auto:none – – online invalid c6t6005076308FFC2A70000000000006031d0s2 std
ibm_ds8x000_6032 auto:none – – online invalid c6t6005076308FFC2A70000000000006032d0s2 std

I’ll be adding the LUNs to documentumdg. I follow a numerical order so I’m verifying which will be the next ones

root@solaris:/ # vxdisk -o alldgs -e list | grep documentumdg | sort -k3
ibm_ds8x000_3134 auto:cdsdisk documentum01 documentumdg online c6t6005076308FFC2A70000000000003134d0s2 std
ibm_ds8x000_6006 auto:cdsdisk documentum02 documentumdg online c6t6005076308FFC2A70000000000006006d0s2 std
ibm_ds8x000_3136 auto:cdsdisk documentum03 documentumdg online c6t6005076308FFC2A70000000000003136d0s2 std
ibm_ds8x000_6005 auto:cdsdisk documentum04 documentumdg online c6t6005076308FFC2A70000000000006005d0s2 std
ibm_ds8x000_3133 auto:cdsdisk documentum05 documentumdg online c6t6005076308FFC2A70000000000003133d0s2 std
ibm_ds8x000_6011 auto:cdsdisk documentum06 documentumdg online c6t6005076308FFC2A70000000000006011d0s2 std
ibm_ds8x000_6012 auto:cdsdisk documentum07 documentumdg online c6t6005076308FFC2A70000000000006012d0s2 std
ibm_ds8x000_6007 auto:cdsdisk documentum08 documentumdg online c6t6005076308FFC2A70000000000006007d0s2 std
ibm_ds8x000_6008 auto:cdsdisk documentum09 documentumdg online c6t6005076308FFC2A70000000000006008d0s2 std
ibm_ds8x000_6009 auto:cdsdisk documentum10 documentumdg online c6t6005076308FFC2A70000000000006009d0s2 std
ibm_ds8x000_6010 auto:cdsdisk documentum11 documentumdg online c6t6005076308FFC2A70000000000006010d0s2 std
ibm_ds8x000_6013 auto:cdsdisk documentum12 documentumdg online c6t6005076308FFC2A70000000000006013d0s2 std
ibm_ds8x000_6014 auto:cdsdisk documentum13 documentumdg online c6t6005076308FFC2A70000000000006014d0s2 std
ibm_ds8x000_6015 auto:cdsdisk documentum14 documentumdg online c6t6005076308FFC2A70000000000006015d0s2 std
ibm_ds8x000_6016 auto:cdsdisk documentum15 documentumdg online c6t6005076308FFC2A70000000000006016d0s2 std
ibm_ds8x000_6017 auto:cdsdisk documentum16 documentumdg online c6t6005076308FFC2A70000000000006017d0s2 std
ibm_ds8x000_6018 auto:cdsdisk documentum17 documentumdg online c6t6005076308FFC2A70000000000006018d0s2 std
ibm_ds8x000_6019 auto:cdsdisk documentum18 documentumdg online c6t6005076308FFC2A70000000000006019d0s2 std
ibm_ds8x000_6020 auto:cdsdisk documentum19 documentumdg online c6t6005076308FFC2A70000000000006020d0s2 std
ibm_ds8x000_6021 auto:cdsdisk documentum20 documentumdg online c6t6005076308FFC2A70000000000006021d0s2 std
ibm_ds8x000_6022 auto:cdsdisk documentum21 documentumdg online c6t6005076308FFC2A70000000000006022d0s2 std
ibm_ds8x000_6002 auto:cdsdisk documentum22 documentumdg online c6t6005076308FFC2A70000000000006002d0s2 std
ibm_ds8x000_6004 auto:cdsdisk documentum23 documentumdg online c6t6005076308FFC2A70000000000006004d0s2 std
ibm_ds8x000_6023 auto:cdsdisk documentum24 documentumdg online c6t6005076308FFC2A70000000000006023d0s2 std
ibm_ds8x000_6024 auto:cdsdisk documentum25 documentumdg online c6t6005076308FFC2A70000000000006024d0s2 std
ibm_ds8x000_6000 auto:cdsdisk documentum26 documentumdg online c6t6005076308FFC2A70000000000006000d0s2 std
ibm_ds8x000_6001 auto:cdsdisk documentum27 documentumdg online c6t6005076308FFC2A70000000000006001d0s2 std
ibm_ds8x000_6003 auto:cdsdisk documentum28 documentumdg online c6t6005076308FFC2A70000000000006003d0s2 std
ibm_ds8x000_6027 auto:cdsdisk documentum29 documentumdg online c6t6005076308FFC2A70000000000006027d0s2 std
ibm_ds8x000_6028 auto:cdsdisk documentum30 documentumdg online c6t6005076308FFC2A70000000000006028d0s2 std

All the disks in the disk group are formatted as cdsdisk. Configuring the disks to be used by Veritas Volume Manager

root@solaris:/ # vxdisksetup -i ibm_ds8x000_6029
root@solaris:/ # vxdisksetup -i ibm_ds8x000_6030
root@solaris:/ # vxdisksetup -i ibm_ds8x000_6031
root@solaris:/ # vxdisksetup -i ibm_ds8x000_6032

Checking the disks

root@solaris:/ # vxdisk -o alldgs -e list | egrep ‘6029|6030|6031|6032’
ibm_ds8x000_6029 auto:cdsdisk – – online c6t6005076308FFC2A70000000000006029d0s2 std
ibm_ds8x000_6030 auto:cdsdisk – – online c6t6005076308FFC2A70000000000006030d0s2 std
ibm_ds8x000_6031 auto:cdsdisk – – online c6t6005076308FFC2A70000000000006031d0s2 std
ibm_ds8x000_6032 auto:cdsdisk – – online c6t6005076308FFC2A70000000000006032d0s2 std

Adding them to documentumdg disk group

root@solaris:/ # vxdg -g documentumdg adddisk documentum31=ibm_ds8x000_6029
root@solaris:/ # vxdg -g documentumdg adddisk documentum32=ibm_ds8x000_6030
root@solaris:/ # vxdg -g documentumdg adddisk documentum33=ibm_ds8x000_6031
root@solaris:/ # vxdg -g documentumdg adddisk documentum34=ibm_ds8x000_6032

root@solaris:/ # vxdisk -o alldgs -e list | grep documentumdg | sort -k3
ibm_ds8x000_3134 auto:cdsdisk documentum01 documentumdg online c6t6005076308FFC2A70000000000003134d0s2 std
ibm_ds8x000_6006 auto:cdsdisk documentum02 documentumdg online c6t6005076308FFC2A70000000000006006d0s2 std
ibm_ds8x000_3136 auto:cdsdisk documentum03 documentumdg online c6t6005076308FFC2A70000000000003136d0s2 std
ibm_ds8x000_6005 auto:cdsdisk documentum04 documentumdg online c6t6005076308FFC2A70000000000006005d0s2 std
ibm_ds8x000_3133 auto:cdsdisk documentum05 documentumdg online c6t6005076308FFC2A70000000000003133d0s2 std
ibm_ds8x000_6011 auto:cdsdisk documentum06 documentumdg online c6t6005076308FFC2A70000000000006011d0s2 std
ibm_ds8x000_6012 auto:cdsdisk documentum07 documentumdg online c6t6005076308FFC2A70000000000006012d0s2 std
ibm_ds8x000_6007 auto:cdsdisk documentum08 documentumdg online c6t6005076308FFC2A70000000000006007d0s2 std
ibm_ds8x000_6008 auto:cdsdisk documentum09 documentumdg online c6t6005076308FFC2A70000000000006008d0s2 std
ibm_ds8x000_6009 auto:cdsdisk documentum10 documentumdg online c6t6005076308FFC2A70000000000006009d0s2 std
ibm_ds8x000_6010 auto:cdsdisk documentum11 documentumdg online c6t6005076308FFC2A70000000000006010d0s2 std
ibm_ds8x000_6013 auto:cdsdisk documentum12 documentumdg online c6t6005076308FFC2A70000000000006013d0s2 std
ibm_ds8x000_6014 auto:cdsdisk documentum13 documentumdg online c6t6005076308FFC2A70000000000006014d0s2 std
ibm_ds8x000_6015 auto:cdsdisk documentum14 documentumdg online c6t6005076308FFC2A70000000000006015d0s2 std
ibm_ds8x000_6016 auto:cdsdisk documentum15 documentumdg online c6t6005076308FFC2A70000000000006016d0s2 std
ibm_ds8x000_6017 auto:cdsdisk documentum16 documentumdg online c6t6005076308FFC2A70000000000006017d0s2 std
ibm_ds8x000_6018 auto:cdsdisk documentum17 documentumdg online c6t6005076308FFC2A70000000000006018d0s2 std
ibm_ds8x000_6019 auto:cdsdisk documentum18 documentumdg online c6t6005076308FFC2A70000000000006019d0s2 std
ibm_ds8x000_6020 auto:cdsdisk documentum19 documentumdg online c6t6005076308FFC2A70000000000006020d0s2 std
ibm_ds8x000_6021 auto:cdsdisk documentum20 documentumdg online c6t6005076308FFC2A70000000000006021d0s2 std
ibm_ds8x000_6022 auto:cdsdisk documentum21 documentumdg online c6t6005076308FFC2A70000000000006022d0s2 std
ibm_ds8x000_6002 auto:cdsdisk documentum22 documentumdg online c6t6005076308FFC2A70000000000006002d0s2 std
ibm_ds8x000_6004 auto:cdsdisk documentum23 documentumdg online c6t6005076308FFC2A70000000000006004d0s2 std
ibm_ds8x000_6023 auto:cdsdisk documentum24 documentumdg online c6t6005076308FFC2A70000000000006023d0s2 std
ibm_ds8x000_6024 auto:cdsdisk documentum25 documentumdg online c6t6005076308FFC2A70000000000006024d0s2 std
ibm_ds8x000_6000 auto:cdsdisk documentum26 documentumdg online c6t6005076308FFC2A70000000000006000d0s2 std
ibm_ds8x000_6001 auto:cdsdisk documentum27 documentumdg online c6t6005076308FFC2A70000000000006001d0s2 std
ibm_ds8x000_6003 auto:cdsdisk documentum28 documentumdg online c6t6005076308FFC2A70000000000006003d0s2 std
ibm_ds8x000_6027 auto:cdsdisk documentum29 documentumdg online c6t6005076308FFC2A70000000000006027d0s2 std
ibm_ds8x000_6028 auto:cdsdisk documentum30 documentumdg online c6t6005076308FFC2A70000000000006028d0s2 std
ibm_ds8x000_6029 auto:cdsdisk documentum31 documentumdg online c6t6005076308FFC2A70000000000006029d0s2 std
ibm_ds8x000_6030 auto:cdsdisk documentum32 documentumdg online c6t6005076308FFC2A70000000000006030d0s2 std
ibm_ds8x000_6031 auto:cdsdisk documentum33 documentumdg online c6t6005076308FFC2A70000000000006031d0s2 std
ibm_ds8x000_6032 auto:cdsdisk documentum34 documentumdg online c6t6005076308FFC2A70000000000006032d0s2 std

Checking available disk group space

root@solaris:/ # vxassist -g documentumdg maxsize
Maximum volume size: 4193908736 (2047807Mb)

Resizing volume and filesystem space

root@solaris:/ # vxresize -g documentumdg ged_engenhariavol +2047807M

root@solaris:/ # df -h /usr/software/documentum/fs_ged_engenharia_01
Filesystem size used avail capacity Mounted on
/dev/vx/dsk/documentumdg/ged_engineeringvol
11T 8.8T 2.4T 79% /usr/software/documentum/engineering

Setup a SVM mirror in Solaris 10

In a Solaris server there are two local disks

root@solaris10:~ # echo | format
Searching for disks…done

AVAILABLE DISK SELECTIONS:
0. c0t0d0
/pci@0,600000/pci@0/scsi@1/sd@0,0
1. c0t1d0
/pci@0,600000/pci@0/scsi@1/sd@1,0
Specify disk (enter its number): Specify disk (enter its number):

Specify disk (enter its number): 1

Verify partition table

selecting c0t1d0
[disk formatted]

FORMAT MENU:
disk – select a disk
type – select (define) a disk type
partition – select (define) a partition table
current – describe the current disk
format – format and analyze the disk
repair – repair a defective sector
label – write label to the disk
analyze – surface analysis
defect – defect list management
backup – search for backup labels
verify – read and display labels
save – save new disk/partition definitions
inquiry – show vendor, product and revision
volname – set 8-character volume name
!<cmd> – execute , then return
quit
format> p

Display disk partitions

PARTITION MENU:
0 – change `0′ partition
1 – change `1′ partition
2 – change `2′ partition
3 – change `3′ partition
4 – change `4′ partition
5 – change `5′ partition
6 – change `6′ partition
7 – change `7′ partition
select – select a predefined table
modify – modify a predefined partition table
name – name the current table
print – display the current table
label – write partition map and label to the disk
!<cmd> – execute , then return
quit
partition> p

Partition 0 is /
Partition 1 is swap
Partition 3 is /var
Partition 7 is where metadevice state database

Current partition table (original):
Total disk cylinders available: 14087 + 2 (reserved cylinders)

Part Tag Flag Cylinders Size Blocks
0 root wm 2061 – 4121 20.00GB (2061/0/0) 41945472
1 swap wu 4122 – 10716 64.00GB (6595/0/0) 134221440
2 backup wm 0 – 14086 136.71GB (14087/0/0) 286698624
3 var wm 0 – 2060 20.00GB (2061/0/0) 41945472
4 unassigned wm 10717 – 11026 3.01GB (310/0/0) 6309120
5 unassigned wm 11027 – 11233 2.01GB (207/0/0) 4212864
6 usr wm 11234 – 11749 5.01GB (516/0/0) 10501632
7 unassigned wm 11750 – 11755 59.62MB (6/0/0) 122112

partition>

Checking metadevice state database

root@solaris10:~ # metadb
metadb: solaris10: there are no existing databases

In the example below I’m going to create three copies on partition 7 of disk c0t1d0

root@solaris10:~ # metadb -a -f -c3 /dev/dsk/c0t1d0s7

Checking metadevice state database

root@solaris10:~ # metadb
flags first blk block count
a u 16 8192 /dev/dsk/c0t1d0s7
a u 8208 8192 /dev/dsk/c0t1d0s7
a u 16400 8192 /dev/dsk/c0t1d0s7

Creating the metadevice with disk partitions

root@solaris10:~ # metainit -f d12 1 1 c0t1d0s0
d12: Concat/Stripe is setup
root@solaris10:~ # metainit -f d22 1 1 c0t1d0s1
d22: Concat/Stripe is setup
root@solaris10:~ # metainit -f d32 1 1 c0t1d0s3
d32: Concat/Stripe is setup

Metadevices created

root@solaris10:~ # metastat -p
d32 1 1 c0t1d0s3
d22 1 1 c0t1d0s1
d12 1 1 c0t1d0s0

Setting up Solaris Volume Manager mirror.

root@solaris10:~ # metainit d10 -m d12
d10: Mirror is setup

Setting up to boot with the mirror

root@solaris10:~ # metaroot d10

Setting up the rest of metadevices as mirror as well

root@solaris10:~ # metainit d30 -m d32
d30: Mirror is setup

root@solaris10:~ # metainit d20 -m d22
d20: Mirror is setup

Checking the status

root@solaris10:~ # metastat -p
d20 -m d22 1
d22 1 1 c0t1d0s1
d30 -m d32 1
d32 1 1 c0t1d0s3
d10 -m d12 1
d12 1 1 c0t1d0s0

root@solaris10:~ # shutdown -y -g0 -i0

After the reboot, check if the server is using the metadevice using df -h

Then create the metadevices for the other side of the mirror and attach them

metainit -f d11 1 1 c0t0d0s0
metainit -f d21 1 1 c0t0d0s1
metainit -f d31 1 1 c0t0d0s3

metattach d10 d11
metattach d20 d21
metattach d30 d31

Create the database replicas on the other disk as well

metadb -a -f -c3 /dev/dsk/c0t0d0s7