Tag: newfs

Setting up a SVM soft partition in a mirror

This is the mirror we will be using

root@solaris:/ # metastat d80
d80: Mirror
Submirror 0: d82
State: Okay
Submirror 1: d81
State: Okay
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 96081792 blocks (45 GB)

d82: Submirror of d80
State: Okay
Size: 96081792 blocks (45 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c1t8d0s4 0 No Okay Yes

d81: Submirror of d80
State: Okay
Size: 96081792 blocks (45 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c0t10d0s4 0 No Okay Yes

Device Relocation Information:
Device Reloc Device ID
c1t8d0 Yes id1,sd@TSEAGATE_ST314670LSUN146G3KS2ZHD2
c0t10d0 Yes id1,sd@TSEAGATE_ST314670LSUN146G3KS2RP29

Creating a soft partition and instead of indicating a partition, declare the mirror

root@solaris:/ # metainit d83 -p d80 2g
d83: Soft Partition is setup

Create the filesystem

root@solaris:/ # newfs /dev/md/rdsk/d83
newfs: construct a new file system /dev/md/rdsk/d83: (y/n)? y
Warning: 18560 sector(s) in last cylinder unallocated
/dev/md/rdsk/d83: 4194304 sectors in 207 cylinders of 24 tracks, 848 sectors
2048.0MB in 42 cyl groups (5 c/g, 49.69MB/g, 12032 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
32, 102640, 205248, 307856, 410464, 513072, 615680, 718288, 820896, 923504,
3256352, 3358960, 3461568, 3564176, 3666784, 3769392, 3872000, 3974608,
4077216, 4179824

Check status

root@solaris:/ # metastat -c
d83 p 2.0GB d80
d80 m 45GB d82 d81
d82 s 45GB c1t8d0s4
d81 s 45GB c0t10d0s4
d50 m 516MB d52 d51
d52 s 516MB c1t8d0s7
d51 s 516MB c0t10d0s7
d40 m 19GB d42 d41
d42 s 19GB c1t8d0s6
d41 s 19GB c0t10d0s6
d30 m 19GB d32 d31
d32 s 19GB c1t8d0s5
d31 s 19GB c0t10d0s5
d20 m 31GB d22 d21
d22 s 31GB c1t8d0s1
d21 s 31GB c0t10d0s1
d10 m 19GB d12 d11
d12 s 19GB c1t8d0s0
d11 s 19GB c0t10d0s0

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