Solaris Volume Manager(SVM): Setup with an example
File System layout before
do any change:
Filesystem size used
avail capacity Mounted on
/dev/dsk/c1t0d0s0 2.0G
104M 1.8G 6%
/
/dev/dsk/c1t0d0s5 5.9G
1.8G 4.0G 32%
/usr
/proc 0K 0K
0K 0% /proc
mnttab 0K 0K
0K 0% /etc/mnttab
fd 0K 0K
0K 0% /dev/fd
/dev/dsk/c1t0d0s3 4.9G
172M 4.7G 4%
/var
swap 2.6G 112K
2.6G 1% /var/run
swap 2.6G 64K
2.6G 1% /tmp
/dev/dsk/c1t0d0s4 2.0G
2.0M 1.9G 1%
/admin
/dev/dsk/c1t0d0s6 9.8G
455M 9.3G 5%
/opt
/dev/dsk/c1t0d0s7 2.0G
236M 1.7G 13%
/export/home
All the available disks:
AVAILABLE DISK SELECTIONS:
0. c1t0d0 <SUN36G cyl 24620 alt 2 hd
27 sec 107>
/pci@1f,0/pci@1/scsi@8/sd@0,0
1. c1t1d0 <SUN36G cyl 24620 alt 2 hd
27 sec 107>
/pci@1f,0/pci@1/scsi@8/sd@1,0
Boot disk layout:
Current partition table
(original):
Total disk cylinders
available: 24620 + 2 (reserved cylinders)
Part Tag
Flag Cylinders Size Blocks
0
root wm 7925 -
9376 2.00GB (1452/0/0)
4194828
1
swap wu 0 -
1451 2.00GB (1452/0/0)
4194828
2
backup wm 0 - 24619 33.92GB (24620/0/0) 71127180
3
var wm 9377 - 13005 5.00GB (3629/0/0)
10484181
4 admin
wm 6473 - 7924
2.00GB (1452/0/0) 4194828
5
usr wm 13006 - 17360 6.00GB (4355/0/0)
12581595
6 opt
wm 17361 - 24619 10.00GB (7259/0/0)
20971251
7 unassigned wm
5021 - 6472 2.00GB (1452/0/0)
4194828
Note: We must have a partition has been set aside as
a spare partition, which we need to use it for meta database. Here the slice 7
is unassigned. So, we can use it for meta database
Steps to follow to create
mirrors:
1) To copy the partition
table of the boot drive to its mirror.
#prtvtoc
/dev/rdsk/c1t0d0s2 |fmthard -s - /dev/rdsk/c1t1d0s2
Fmthard: New volume table of
contents now in place.
2) Create the meta database.
#metadb –a –f –c 2
/dev/dsk/c1t0d0s7 /dev/dsk/c1t1d0s7
3) Mirror for root (/) file
system
#metainit –f d10 1 1
c1t0d0s0
d10: Concat/Stripe is setup
#metainit d20 1 1 c1t1d0s0
d20: Concat/Stripe is setup
#metainit d0 –m d10
d0: Mirror is setup
# metaroot d0
4) Mirror for swap
#metainit –f d11 1 1
c1t0d0s1
d11: Concat/Stripe is setup
#metainit d21 1 1 c1t1d0s1
d21: Concat/Stripe is setup
#metainit d1 –m d11
d1: Mirror is setup
5 ) Mirror for /var
filesystem
#metainit –f d13 1 1
c1t0d0s3
d13: Concat/Stripe is setup
#metainit d23 1 1 c1t1d0s3
d23: Concat/Stripe is setup
#metainit d3 –m d13
d3: Mirror is setup
6) Mirror for /admin
filesystem
#metainit –f d14 1 1
c1t0d0s4
d14: Concat/Stripe is setup
#metainit d24 1 1 c1t1d0s4
d24: Concat/Stripe is setup
#metainit d4 –m d14
d4: Mirror is setup
7) Mirror for /usr
filesystem
#metainit –f d15 1 1
c1t0d0s5
d15: Concat/Stripe is setup
#metainit d25 1 1 c1t1d0s5
d25: Concat/Stripe is setup
#metainit d5 –m d15
d5: Mirror is setup
8) Mirror for /opt
filesystem
#metainit –f d16 1 1
c1t0d0s6
d16: Concat/Stripe is setup
#metainit d26 1 1 c1t1d0s3
d26: Concat/Stripe is setup
#metainit d6 –m d16
d6: Mirror is setup
Now, reboot the box once. Sub mirrors to be attached
after reboot only.
9) Now, edit /etc/vfstab.
The entry for / will have already been changed by the DiskSuite software.
Do the following changes
with mentioned with arrow mark.
fd
- /dev/fd fd -
no -
/proc -
/proc proc -
no -
/dev/dsk/c1t0d0s1 -
- swap -
no -
à /dev/md/dsk/d1 -
- swap -
no -
/dev/dsk/c1t0d0s0 /dev/rdsk/c1t0d0s0 /
ufs 1 no
-
à /dev/md/dsk/d0 /dev/md/rdsk/d0 /
ufs 1 no
-
/dev/dsk/c1t0d0s5 /dev/rdsk/c1t0d0s5 /usr
ufs 1 no
-
à /dev/dsk/d5 /dev/rdsk/d5 /usr
ufs 1 no
-
/dev/dsk/c1t0d0s3 /dev/rdsk/c1t0d0s3 /var
ufs 1 no
-
à /dev/md/dsk/d3 /dev/md/rdsk/d3 /var
ufs 1 no
-
/dev/dsk/c1t0d0s4 /dev/rdsk/c1t0d0s4 /admin
ufs 2 yes
-
à /dev/md/dsk/d4 /dev/md/rdsk/d4 /admin
ufs 2 yes
-
/dev/dsk/c1t0d0s6 /dev/rdsk/c1t0d0s6 /opt
ufs 2 yes
-
à /dev/md/dsk/d6 /dev/md/rdsk/d6 /opt
ufs 2 yes
swap -
/tmp tmpfs -
yes -
10) Now, attach all the
second sub mirrors to respective mirror. This will cause the data from boot device
to be synchronized with the mirrored drive.
# metattach d0 d20
d0: Submirror d20 is
attached
# metattach d1 d21
d1: Submirror d21 is
attached
# metattach d3 d23
d3: Submirror d23 is
attached
# metattach d4 d24
d4: Submirror d24 is
attached
# metattach d5 d25
d5: Submirror d25 is
attached
# metattach d6 d26
d6: Submirror d26 is
attached
Note: Don’t reboot the box until the synchronization
completed. Issue the command
“metastat” to track the sync.
#metastat | grep State:
11) Making Mirrored disk
bootable
# installboot
/usr/platform/`uname -i`/lib/fs/ufs/bootblk /dev/rdsk/c1t1d0s0
12) Creating alternate name
for Mirrored boot disk
a) find physical path for
second boot disk
# ls -l /dev/rdsk/c1t1d0s0
bash-2.05# ls -l
/dev/rdsk/c1t1d0s0
lrwxrwxrwx 1 root
root 48 Jul 1 08:13 /dev/rdsk/c1t1d0s0 -> ../../devices/pci@1f,0/pci@1/scsi@8/sd@1,0:a,raw
b) ok> nvalias bootdisk2 pci@1f,0/pci@1/scsi@8/sd@1,0:a
13) Boot from boot disk2
Ok> boot bootdisk2
You can also try booting
from alternate disk directly by using the path directly.
Ok>boot pci@1f,0/pci@1/scsi@8/sd@1,0:a
14)Verify the system to
confirm system booted with second disk.
bash-2.05# prtconf -vp|grep
bootpath
bootpath: '/pci@1f,0/pci@1/scsi@8/disk@1,0:a'
à which is secondary
disk
Here the acual disk paths
are as follows
bash-2.05# ls -l
/dev/rdsk/c1t1d0s0
lrwxrwxrwx 1 root
root 48 Jul 1 08:13 /dev/rdsk/c1t1d0s0 ->
../../devices/pci@1f,0/pci@1/scsi@8/sd@1,0:a,raw
bash-2.05#
bash-2.05# ls -l
/dev/rdsk/c1t0d0s0
lrwxrwxrwx 1 root
root 48 Jul 1 08:13 /dev/rdsk/c1t0d0s0 ->
../../devices/pci@1f,0/pci@1/scsi@8/sd@0,0:a,raw
Comments
Post a Comment