Provision SAN storage
Provision from an array, then detect the device in Solaris, and add a disk label.
$ devfsadm –c disk ; cfgadm –lav ; format
I generally write SMI labels with slice 0 named "usr" having the whole disk size (0 to $). The rest are unassigned, except slice 2 which we leave as is.
Veritas Volume Management
Have the VxVM daemon also see it:
$ vxdctl enable
Configure the disk using the interactive vxdiskadd, or like in this example where we create a new disk group using the disk,
$ vxdisk –e list
$ vxdisksetup -i df8000_73
$ vxdg init datadg disk=df8000_73
$ vxedit -g datadg rename disk array0-1
$ vxedit -g datadg set nohotuse=on array0-1
If a suitable disk group already exists, add the disk as shown below. Check the disk size, then create a volume with it, format it VxFS, in this case with the largefiles parameter,
$ vxdg free
$ vxassist -g datadg make u01 209559808 array0-1
$ vxprint –Ath u01
$ mkfs -F vxfs -o largefiles=yes /dev/vx/rdsk/datadg/u01
Add it to vfstab, and mount it, you can start using the volume now,
$ vi /etc/vfstab
$ mkdir /u01 && mount /u01
Add another disk to be used in a mirrored volume, which is a good way to migrate between storage arrays online,
$ vxdisksetup -i df8000_74
$ vxdg -g datadg adddisk array1-1=df8000_74
$ vxedit -g datadg set nohotuse=on array1-1
$ vxdg free
Make a plex, attach to the volume,
$ vxmake sd array1-1-01 array1-1,0,209559808
$ vxmake plex u01-02 sd=array1-1-01
$ vxplex att u01 u01-02
$ vxtask list
Remove a plex, subdisk and disk if necessary like this,
$ vxplex det u01-01
$ vxplex -o rm dis u01-01
$ vxdg rmdisk array0-1
$ vxdisk rm df8000_73
After the disk is removed from VxVM, un-provision it at the array, and cleanup,
$ devfsadm -C
$ echo | format
Use vxresize to extend or shrink a volume (concatentation).
TROUBLESHOOTING:
Incompatible Solaris Label – write SMI or EFI label as required using “format –e”.
Select the disk, choose type, select SMI, choose the label command.
Incompatiable disk format – during vxdisksetup pass the “format=sliced” or “format=cdsdisk”.
Choose the format that is suitable for the disk group.
This is just a primer, there is a lot more you can do with VxVM and VxFS.
Solaris Volume Manager
In earlier versions of Solaris I would mirror internal disk slices using SVM. Firstly, display the partition table of the disk you installed Solaris onto (c1t0d0):
# prtvtoc /dev/rdsk/c1t0d0s2
You will need a small slice for the "State DB replica", 10MB or so in size. Use the "format" command if required to create the small slice. Create the ufs/zfs boot block onto the alternate disk, and then duplicate the original partition table:
# installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk /dev/rdsk/c1t1d0s0
# installboot -F zfs /usr/platform/`uname -i`/lib/fs/zfs/bootblk \
/dev/rdsk/c1t1d0s0
# prtvtoc /dev/rdsk/c1t0d0s2 | fmthard -s - /dev/rdsk/c1t1d0s2
# prtvtoc /dev/rdsk/c1t1d0s2
To split root mirrors for software updates,
$ metadetach d20 d22
$ metaroot c1t0d0s0
$ reboot
< upgrades >
$ metaroot d20
$ metaattach d20 d22
< reboot again after sync >
# prtvtoc /dev/rdsk/c1t0d0s2
You will need a small slice for the "State DB replica", 10MB or so in size. Use the "format" command if required to create the small slice. Create the ufs/zfs boot block onto the alternate disk, and then duplicate the original partition table:
# installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk /dev/rdsk/c1t1d0s0
# installboot -F zfs /usr/platform/`uname -i`/lib/fs/zfs/bootblk \
/dev/rdsk/c1t1d0s0
# prtvtoc /dev/rdsk/c1t0d0s2 | fmthard -s - /dev/rdsk/c1t1d0s2
# prtvtoc /dev/rdsk/c1t1d0s2
Create state database replicas for Solaris Volume Manager on both 15MB slices, in this case "s4":
# metadb -a -c 3 -f c1t0d0s4
# metadb -a -c 3 c1t1d0s4
# metadb -i
# metadb -a -c 3 -f c1t0d0s4
# metadb -a -c 3 c1t1d0s4
# metadb -i
In this example, s0 is root, s1 is swap, s3 is /var. Create the sub-mirrors for the original disk (c1t0d0), then the alternate disk (c1t1d0):
# metainit -f d11 1 1 c1t0d0s1
# metainit -f d21 1 1 c1t0d0s0
# metainit -f d31 1 1 c1t0d0s3
# metainit d12 1 1 c1t1d0s1
# metainit d22 1 1 c1t1d0s0
# metainit d32 1 1 c1t1d0s3
Build logical mirrors using the original plexes only:
# metainit d10 -m d11
# metainit d20 -m d21
# metainit d30 -m d31
Save a copy of /etc/vfstab and /etc/system and then open /etc/vfstab for edit:
# cp /etc/system /etc/system.orig
# cp /etc/vfstab /etc/vfstab.orig
# vi /etc/vfstab
Update vfstab to use the new logical metadevices (With the exception of root. Do not modify root!). An example of the updated entries is shown here:
/dev/md/dsk/d10 - - swap - no -
/dev/md/dsk/d30 /dev/md/rdsk/d30 /var ufs 1 no logging
Make the root filesystem vfstab change, and then reboot (this might be a good time to create an altbootpath boot alias in the PROM):
# metaroot d20
# lockfs –fa
# reboot
After booting Solaris, attach the second plex and monitor the resync operations
# metattach d10 d12
# metattach d20 d22
# metattach d30 d32
# metastat -c | grep "^d"
# metaclear d12
# metadb -f -d c1t0d0s4
# metainit -f d11 1 1 c1t0d0s1
# metainit -f d21 1 1 c1t0d0s0
# metainit -f d31 1 1 c1t0d0s3
# metainit d12 1 1 c1t1d0s1
# metainit d22 1 1 c1t1d0s0
# metainit d32 1 1 c1t1d0s3
# metainit d10 -m d11
# metainit d20 -m d21
# metainit d30 -m d31
Save a copy of /etc/vfstab and /etc/system and then open /etc/vfstab for edit:
# cp /etc/system /etc/system.orig
# cp /etc/vfstab /etc/vfstab.orig
# vi /etc/vfstab
Update vfstab to use the new logical metadevices (With the exception of root. Do not modify root!). An example of the updated entries is shown here:
/dev/md/dsk/d10 - - swap - no -
/dev/md/dsk/d30 /dev/md/rdsk/d30 /var ufs 1 no logging
Make the root filesystem vfstab change, and then reboot (this might be a good time to create an altbootpath boot alias in the PROM):
# metaroot d20
# lockfs –fa
# reboot
After booting Solaris, attach the second plex and monitor the resync operations
# metattach d10 d12
# metattach d20 d22
# metattach d30 d32
# metastat -c | grep "^d"
To increase a SVM volume and grow the filesystem, configure the slices, then (example s6),
To add a new concatented volume,
# metattach d30 c0t0d0s6
# growfs -M /var /dev/md/rdsk/d30
To add a new concatented volume,
# mkdir /u05 # metainit d105 1 1 c0t0d0s5
# newfs /dev/md/rdsk/d105 # echo "/dev/md/dsk/d105 /dev/md/rdsk/d105 /u05 ufs 2 yes -" >> /etc/vfstab
# mount /u05To remove SVM logical volumes and state database replica, use these commands:
# metaclear d12
# metadb -f -d c1t0d0s4
To split root mirrors for software updates,
$ metadetach d20 d22
$ metaroot c1t0d0s0
$ reboot
< upgrades >
$ metaroot d20
$ metaattach d20 d22
< reboot again after sync >
Other Volume Managers (coming soon)
No comments:
Post a Comment