Tag: metattach

Creating a SVM metadevice and an UFS filesystem

The storage team created new LUNs and presented them to the server. I need to check which disks doesn’t have a label yet

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

c3t5006048449AFD297d167: configured with capacity of 11.24GB
c3t5006048449AFD297d168: configured with capacity of 11.24GB
c3t5006048449AFD297d169: configured with capacity of 11.24GB
c3t5006048449AFD297d170: configured with capacity of 11.24GB
c3t5006048449AFD297d171: configured with capacity of 11.24GB
c4t5006048449AFD298d167: configured with capacity of 11.24GB
c4t5006048449AFD298d168: configured with capacity of 11.24GB
c4t5006048449AFD298d169: configured with capacity of 11.24GB
c4t5006048449AFD298d170: configured with capacity of 11.24GB
c4t5006048449AFD298d171: configured with capacity of 11.24GB
emcpower68a: configured with capacity of 11.24GB
emcpower69a: configured with capacity of 11.24GB
emcpower70a: configured with capacity of 11.24GB
emcpower71a: configured with capacity of 11.24GB
emcpower72a: configured with capacity of 11.24GB

These disks are PowerPath devices and the only thing diferenciating them are the controllers. One path comes from c3 and the other one comes from c4. After I apply a label on the PowerPath devices, I create a new Solaris Volume Manager metadevice with metainit

root@solaris:/ # metainit d74 1 1 /dev/dsk/emcpower68c
d74: Concat/Stripe is setup

I could specify the metadevice with the options 4 1 disk 1 disk 1 disk 1 disk but I find that if I attach one by one there is less chance of error

root@solaris:/ # metattach d74 /dev/dsk/emcpower69c
d74: component is attached
root@solaris:/ # metattach d74 /dev/dsk/emcpower70c
d74: component is attached
root@solaris:/ # metattach d74 /dev/dsk/emcpower71c
d74: component is attached

Checking the metadevice and which physical disks are being used

root@solaris:~ # metastat -p d74
d74 4 1 /dev/dsk/emcpower68c \
1 /dev/dsk/emcpower69c \
1 /dev/dsk/emcpower70c \
1 /dev/dsk/emcpower71c

Creating an UFS filesystem on this metadevice

root@solaris:/ # newfs /dev/md/rdsk/d74
/dev/md/rdsk/d74: Unable to find Media type. Proceeding with system determined parameters.
newfs: construct a new file system /dev/md/rdsk/d74: (y/n)? y
/dev/md/rdsk/d74: Unable to find Media type. Proceeding with system determined parameters.
Warning: 5952 sector(s) in last cylinder unallocated
/dev/md/rdsk/d74: 94261440 sectors in 15343 cylinders of 48 tracks, 128 sectors
46026,1MB in 959 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:
93297312, 93395744, 93494176, 93592608, 93691040, 93789472, 93887904,
93986336, 94084768, 94183200

Creating the mount point for the filesystem

root@solaris:/ # mkdir /mountpoint

Here I’m setting the read and browse properties for the directory to avoid problems if the umask is different than 022

root@solaris:/ # chmod 755 /mountpoint

I mount the filesystem and specify the metadevice

root@solaris:/ # mount /dev/md/dsk/d74 /mountpoint

root@solaris:/ # df -h /mountpoint
Filesystem size used avail capacity Mounted on
/dev/md/dsk/d74 44G 45M 44G 1% /mountpoint

If needed, now with the filesystem mounted you can change the owner and group of this filesystem

root@solaris:/ # ls -ld /mountpoint
drwxr-xr-x 3 root root 512 jul 22 16:19 /nfein

I made this new filesystem for the DBA to hold some files. So I’m changing the owner to oracle and group to dba

root@solaris:/ # chown oracle:dba /mountpoint

root@solaris:/ # ls -ld /mountpoint
drwxr-xr-x 3 oracle dba 512 jul 22 16:19 /nfein

Solaris SVM error when attaching a new disk – metattach I/O Error

I was trying to increase a metadevice with another disk but I was getting an I/O error

root@solaris:~ # metattach d200 /dev/rdsk/emcpower46c
metattach: solaris: /dev/dsk/emcpower46c: I/O error

Nothing strange was appearing in the emcpower disk

root@solaris:~ # powermt display dev=emcpower46
Pseudo name=emcpower46a
Symmetrix ID=000287752010
Logical device ID=01A1
state=alive; policy=SymmOpt; priority=0; queued-IOs=0
==============================================================================
—————- Host ————— – Stor – — I/O Path – — Stats —
### HW Path I/O Paths Interf. Mode State Q-IOs Errors
==============================================================================
3072 pci@8,600000/SUNW,emlxs@1/fp@0,0 c1t5006048449AFD288d18s0 FA 9aA active alive 0 0
3073 pci@8,600000/SUNW,emlxs@2/fp@0,0 c2t5006048449AFD287d18s0 FA 8aA active alive 0 0

A friend here at work asked if the disk has a label. It didn’t have one.

selecting emcpower46e
[disk formatted]
Disk not labeled. Label it now? yes

After that I was able to increase the metadevice.

root@solaris:~ # metattach d200 /dev/rdsk/emcpower46c
d200: component is attached

Growing a soft partition and resizing filesystem in Solaris Volume Manager

I need to increase the filesystem called /bkp

root@solaris:~ # df -h /bkp
Filesystem size used avail capacity Mounted on
/dev/md/dsk/d51 44G 26G 18G 60% /bkp

It’s mounted on a soft partition

root@solaris:~ # metastat d51
d51: Soft Partition
Device: d5
State: Okay
Size: 93298688 blocks (44 GB)
Extent Start Block Block count
0 20981760 10485760
1 54536288 82812928

d5: Concat/Stripe
Size: 143349312 blocks (68 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c1t2d0s2 0 No Okay Yes

Device Relocation Information:
Device Reloc Device ID
c1t2d0 Yes id1,sd@SSEAGATE_ST373307LSUN72G_3HZ9R8BN00007523GZY7

Here I attach a LUN to metadevice d5

root@solaris:~ # metattach d5 /dev/rdsk/emcpower33c
d5: component is attached

Now d5 have an internal disk and a LUN from storage

root@solaris:~ # metastat -p d5
d5 2 1 c1t2d0s2 \
1 /dev/dsk/emcpower33c

Here is the command to increase the soft partition

root@solaris:~ # metattach d51 10g
d51: Soft Partition has been grown

After you increase the soft partition, you need to increase the filesystem with growfs

root@solaris:~ # growfs -M /bkp /dev/md/rdsk/d51
/dev/md/rdsk/d51: Unable to find Media type. Proceeding with system determined parameters.
Warning: 5376 sector(s) in last cylinder unallocated
/dev/md/rdsk/d51: 116367360 sectors in 11436 cylinders of 24 tracks, 424 sectors
56820,0MB in 1144 cyl groups (10 c/g, 49,69MB/g, 6016 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
32, 102224, 204416, 306608, 408800, 510992, 613184, 715376, 817568, 919760,
Initializing cylinder groups:
………………….
super-block backups for last 10 cylinder groups at:
115401920, 115504112, 115606304, 115708496, 115810688, 115912880, 116015072,
116117264, 116219456, 116321648

root@solaris:~ # df -h /bkp
Filesystem size used avail capacity Mounted on
/dev/md/dsk/d51 55G 26G 28G 48% /bkp