Today we are going to take a little trip into the past and learn about how to add disks to Solaris 9, put them under Veritas control, and, create a volume group and a volume. This information will come in very handy if you acidentally time travel back 10 years and are forced to get a job as a UNIX Admin.
First off note that you may not need to run the command shown directly below, as Solaris may actually see the disks without performing a lip. This was not the case for me so I needed to perform a lip on each path. First I needed to find my paths as shown below.
# luxadm -e port
Found path to 2 HBA ports
/devices/pci@1d,700000/SUNW,qlc@1/fp@0,0:devctl CONNECTED/devices/pci@1d,700000/SUNW,qlc@1,1/fp@0,0:devctl CONNECTED
Then I forcelip'd each port.
# luxadm -e forcelip /devices/pci@1d,700000/SUNW,qlc@1/fp@0,0:devctl
# luxadm -e forcelip /devices/pci@1d,700000/SUNW,qlc@1,1/fp@0,0:devctl
Then run the configuration command to find your new disks. My new luns are the ones that are unconfigured.
# cfgadm -o show_FCP_dev -alAp_Id Type Receptacle Occupant Conditionc3 fc-fabric connected configured unknownc3::50000972085ea995 disk connected unconfigured unknownc3::50060e8005be5830,0 disk connected configured unknownc3::50060e8005be5830,1 disk connected configured unknownc4 fc-fabric connected configured unknownc4::50000972085ea990 disk connected unconfigured unknownc4::50060e8005be5820,0 disk connected configured unknownc4::50060e8005be5820,1 disk connected configured unknown
Now lets configure the two disks so that we can use them
# cfgadm -c configure c3::50000972085ea99# cfgadm -c configure c4::50000972085ea9905
Now Vertias should see the disks, so lets check.
# vxdisk -e -o alldgs listDEVICE TYPE DISK GROUP STATUS OS_NATIVE_NAME ATTR disk_4 auto:none - - online invalid c1t0d0s2 - - disk_7 auto:none - - online invalid c1t1d0s2 - emc0_061a auto - - nolabel c3t50000972085EA995d5s2 tdev emc0_061b auto - - nolabel c3t50000972085EA995d6s2 tdev emc0_061c auto - - nolabel c3t50000972085EA995d7s2 tdev emc0_061d auto - - nolabel c3t50000972085EA995d8s2 tdev emc0_061e auto - - nolabel c3t50000972085EA995d9s2 tdev emc0_0616 auto - - nolabel c3t50000972085EA995d1s2 tdev emc0_0617 auto - - nolabel c3t50000972085EA995d2s2 tdev emc0_0618 auto - - nolabel c3t50000972085EA995d3s2 tdev emc0_0619 auto - - nolabel c3t50000972085EA995d4s2 tdev
Each lun that's presented above will be used for a specific filesystem/mount. In this specific instance I was given these two lun ids for a new mount 061D,061E. The rest will be used later to mirror existing mounts.
Now lets label these two luns. Using the information above from the vxdisk output, I grab the OS_NATIVE_NAME and use that for the format command.
# format c3t50000972085EA995d8s2 c3t50000972085EA995d9s2
Note how the format command prompts me to label the disks before I can format them. Note that I am not going to format them, just label them.
AVAILABLE DISK SELECTIONS: 0. c3t50000972085EA995d8s2 <EMC-SYMMETRIX-5874 cyl 54612 alt 2 hd 15 sec 128> /pci@1d,700000/SUNW,qlc@1/fp@0,0/ssd@w50000972085ea995,8 1. c3t50000972085EA995d9s2 <EMC-SYMMETRIX-5874 cyl 54612 alt 2 hd 15 sec 128> /pci@1d,700000/SUNW,qlc@1/fp@0,0/ssd@w50000972085ea995,9Specify disk (enter its number)[0]: 1selecting c3t50000972085EA995d9s2[disk formatted]Disk not labeled. Label it now? yesformat> quit
Now use vxdisksetup, option one to initialize the luns. Excerpt below.
Select disk devices to add: [<pattern-list>,all,list,q,?] emc0_061d emc0_061e Here are the disks selected. Output format: [Device_Name] emc0_061d emc0_061e
Now lets create our diskgroup – this one I shall call FDEV2_dg. Note that the format below creates the disk group adds two disks to it. We are also giving each disk an "alias".
# vxdg init FDEV2_dg FDEV2_dg_d0=emc0_061d FDEV2_dg_d1=emc0_061e
Now lets create a volume. This volume will me 99g
# vxassist -g FDEV2_dg make FDEV2_dg_v1 99g layout=stripe
Ok almost done – lets now slap a file system on that sucka.
# mkfs -F vxfs /dev/vx/rdsk/FDEV2_dg/FDEV2_dg_v1
Now lets the line below to /etc/vfstab.
/dev/vx/dsk/FDEV2_dg/FDEV2_dg_v1 /dev/vx/rdsk/FDEV2_dg/FDEV2_dg_v1 /u06 vxfs 2 yes suid
And lets mount it.
# mount /u06
Related articles