Pages

Sunday, January 16, 2011

How to create mirror

You can mirror two disk partition with Solaris Volume manager. Steps for do mirror is very simple like below.

  1. Create metadevice that you will use for build mirror. In this example you create d11 and d12
    bash-3.00# metainit d11 1 1 c3t2d0s0
d11: Concat/Stripe is setup
bash-3.00# metainit d12 1 1 c3t3d0s0
d12: Concat/Stripe is setup
  1. Create the mirror. In this example you create mirror d1 use metadevice d11 as sub mirror
    bash-3.00# metainit d1 -m d11
d1: Mirror is setup
  1. Attach the other submirror. In this example you use d12 as the other submirrror
    bash-3.00# metattach d1 d12
d1: submirror d12 is attached
  1. Check the mirror configuration
bash-3.00# metastat
d1: Mirror
Submirror 0: d11
State: Okay
Submirror 1: d12
State: Resyncing
Resync in progress: 2 % done
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 2048000 blocks (1000 MB)

d11: Submirror of d1
State: Okay
Size: 2048000 blocks (1000 MB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c3t2d0s0 0 No Okay Yes


d12: Submirror of d1
State: Resyncing
Size: 2048000 blocks (1000 MB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c3t3d0s0 0 No Okay Yes


Device Relocation Information:
Device Reloc Device ID
c3t3d0 Yes id1,sd@SATA_____VBOX_HARDDISK____VB5c17d304-00de27e4
c3t2d0 Yes id1,sd@SATA_____VBOX_HARDDISK____VB08da0d81-38b71174



  1. Create file system on the mirror
    bash-3.00# newfs /dev/md/rdsk/d1
/dev/md/rdsk/d1: Unable to find Media type. Proceeding with system determined parameters.
newfs: construct a new file system /dev/md/rdsk/d1: (y/n)? y
/dev/md/rdsk/d1: 2048000 sectors in 1000 cylinders of 64 tracks, 32 sectors
1000.0MB in 63 cyl groups (16 c/g, 16.00MB/g, 7680 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
32, 32832, 65632, 98432, 131232, 164032, 196832, 229632, 262432, 295232,
1738432, 1771232, 1804032, 1836832, 1869632, 1902432, 1935232, 1968032,
2000832, 2033632
  1. Check new file system that you just have created
    bash-3.00# fsck /dev/md/rdsk/d1
** /dev/md/rdsk/d1
** Last Mounted on
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3a - Check Connectivity
** Phase 3b - Verify Shadows/ACLs
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cylinder Groups
2 files, 9 used, 962486 free (14 frags, 120309 blocks, 0.0% fragmentation)
  1. Mount the file system
    bash-3.00# mount /dev/md/dsk/d10 /sample
bash-3.00# df -k
Filesystem kbytes used avail capacity Mounted on
/dev/dsk/c0d0s0 15133279 9349803 5632144 63% /
/devices 0 0 0 0% /devices
ctfs 0 0 0 0% /system/contract
proc 0 0 0 0% /proc
mnttab 0 0 0 0% /etc/mnttab
swap 2712956 936 2712020 1% /etc/svc/volatile
objfs 0 0 0 0% /system/object
sharefs 0 0 0 0% /etc/dfs/sharetab
/usr/lib/libc/libc_hwcap1.so.1
15133279 9349803 5632144 63% /lib/libc.so.1
fd 0 0 0 0% /dev/fd
swap 2712056 36 2712020 1% /tmp
swap 2712048 28 2712020 1% /var/run
/dev/dsk/c0d1s0 10275725 7438965 2734003 74% /u01
/dev/dsk/c3t0d0s0 5153886 223930 4878418 5% /disk01
/dev/dsk/c3t1d0s0 5153886 678049 4424299 14% /disk02
/dev/dsk/c0d0s7 3448584 3441 3410658 1% /export/home
/dev/md/dsk/d1 962495 1041 903705 1% /sample

No comments:

Post a Comment