X86 Mirroring

Published on June 2016 | Categories: Documents | Downloads: 27 | Comments: 0 | Views: 258
of 13
Download PDF   Embed   Report

Comments

Content

Preface
This document is directed to give idea how to create mirroring of root filesystem in Solaris x86 with the help of Solaris Volume Manager. Here will be used already installed OS and all the work will be done without need of reinstall

Prerequisites
1. First we should be sure have two identical harddisks in the server
# format Searching for disks...done AVAILABLE DISK SELECTIONS: 0. c0d0 <DEFAULT cyl 1563 alt 2 hd 255 sec 63> /pci@0,0/pci-ide@7,1/ide@0/cmdk@0,0 1. c0d1 <DEFAULT cyl 1563 alt 2 hd 255 sec 63> /pci@0,0/pci-ide@7,1/ide@0/cmdk@1,0 Specify disk (enter its number): ^C

2. Its need to create small slice for metadb information (usually slice 7) like:
partition> p Current partition table (unnamed): Total disk cylinders available: 1563 + 2 (reserved cylinders) Part Tag 0 root 1 swap 2 backup 3 unassigned 4 unassigned 5 unassigned 6 unassigned 7 unassigned 8 boot 9 alternates Flag wm wu wm wm wm wm wm wm wu wu Cylinders 518 - 1562 3 - 133 0 - 1562 0 0 0 0 134 - 135 0 0 1 2 Size 8.01GB 1.00GB 11.97GB 0 0 0 0 15.69MB 7.84MB 15.69MB Blocks (1045/0/0) 16787925 (131/0/0) 2104515 (1563/0/0) 25109595 (0/0/0) 0 (0/0/0) 0 (0/0/0) 0 (0/0/0) 0 (2/0/0) 32130 (1/0/0) 16065 (2/0/0) 32130

3. Next step is to create the same partitions on the second disk. To avoid human error it is much better to use some kind of automations:
prtvtoc /dev/rdsk/c0d0s2 > /tmp/c0d0s2.toc fmthard -s /tmp/c0d0s2.toc /dev/rdsk/c0d1s2

4. Then we should identify the partitions need to be mirrored:
# egrep "ufs|swap" /etc/vfstab|grep "/dev/dsk" /dev/dsk/c0d0s1 swap /dev/dsk/c0d0s0 /dev/rdsk/c0d0s0 / no ufs 1

no

-

LVM

1. Let¶s create few copies of metadb on the partitions we create for this puspose:
# metadb -a -f -c 2 c0d0s7 c0d1s7

2. It¶s time to put our disks where OS reside under management of SVM
# metainit -f d10 1 1 d10: Concat/Stripe is # metainit -f d11 1 1 d11: Concat/Stripe is # metainit d0 -m d10 d0: Mirror is setup # metainit d1 -m d11 d1: Mirror is setup # metaroot d0 c0d0s0 setup c0d0s1 setup

3. Check newly created devices:
# ls -l /dev/md/rdsk total 8 lrwxrwxrwx 1 root root ../../../devices/pseudo/md@0:0,0,raw lrwxrwxrwx 1 root root ../../../devices/pseudo/md@0:0,1,raw lrwxrwxrwx 1 root root ../../../devices/pseudo/md@0:0,10,raw lrwxrwxrwx 1 root root ../../../devices/pseudo/md@0:0,11,raw # ls -l /dev/md/dsk total 8 lrwxrwxrwx 1 root root ../../../devices/pseudo/md@0:0,0,blk lrwxrwxrwx 1 root root ../../../devices/pseudo/md@0:0,1,blk lrwxrwxrwx 1 root root ../../../devices/pseudo/md@0:0,10,blk lrwxrwxrwx 1 root root ../../../devices/pseudo/md@0:0,11,blk

36 Aug 30 18:29 d0 -> 36 Aug 30 18:29 d1 -> 37 Aug 30 18:28 d10 -> 37 Aug 30 18:28 d11 ->

36 Aug 30 18:29 d0 -> 36 Aug 30 18:29 d1 -> 37 Aug 30 18:28 d10 -> 37 Aug 30 18:28 d11 ->

4. Make appropriate changes in /etc/vfstab to get boot from mirror, not standard disks
# egrep "ufs|swap" /etc/vfstab|grep "/dev/md/dsk" /dev/md/dsk/d1 swap no /dev/md/dsk/d0 /dev/md/rdsk/d0 / ufs 1 no

-

5. The next step is to flush cache buffers and reboot
# sync;sync;sync # reboot

6. It is time to put second disk under management of SVN
# metainit -f d20 1 1 c0d1s0

d20: Concat/Stripe is setup # metainit -f d21 1 1 c0d1s1 d21: Concat/Stripe is setup

7. And to add them to created previously mirrors. Be aware process of synchronisation will continue in background and you can check the process
# metattach d0 d20 d0: submirror d20 is attached # metattach d1 d21 d1: submirror d21 is attached

8. Check the process of building mirrors and wait till they finnish
# metastat d1: Mirror Submirror 0: d11 State: Okay Submirror 1: d21 State: Resyncing Resync in progress: 96 % done Pass: 1 Read option: roundrobin (default) Write option: parallel (default) Size: 2104515 blocks (1.0 GB) d11: Submirror of d1 State: Okay Size: 2104515 blocks (1.0 GB) Stripe 0: Device Start Block Dbase c0d0s1 0 No d21: Submirror of d1 State: Resyncing Size: 2104515 blocks (1.0 GB) Stripe 0: Device Start Block Dbase c0d1s1 0 No d0: Mirror Submirror 0: d10 State: Okay Submirror 1: d20 State: Resyncing Resync in progress: 13 % done Pass: 1 Read option: roundrobin (default) Write option: parallel (default) Size: 16787925 blocks (8.0 GB) d10: Submirror of d0 State: Okay

State Reloc Hot Spare Okay Yes

State Reloc Hot Spare Okay Yes

Size: 16787925 blocks (8.0 GB) Stripe 0: Device Start Block Dbase c0d0s0 0 No d20: Submirror of d0 State: Resyncing Size: 16787925 blocks (8.0 GB) Stripe 0: Device Start Block Dbase c0d1s0 0 No

State Reloc Hot Spare Okay Yes

State Reloc Hot Spare Okay Yes

Device Relocation Information: Device Reloc Device ID c0d1 Yes id1,cmdk@AVMware_Virtual_IDE_Hard_Drive=01000000000000000001 c0d0 Yes id1,cmdk@AVMware_Virtual_IDE_Hard_Drive=00000000000000000001

Boot
1. Next step is to check if partition on second disk is active
# fdisk /dev/rdsk/c0d1p0 Total disk size is 1566 cylinders Cylinder size is 16065 (512 byte) blocks Partition ========= 1 Status ====== Active Type ============ Solaris2 Cylinders Start End Length ===== === ====== 1 1565 1565 % === 100

SELECT ONE OF THE FOLLOWING: 1. Create a partition 2. Specify the active partition 3. Delete a partition 4. Change between Solaris and Solaris2 Partition IDs 5. Exit (update disk configuration and exit) 6. Cancel (exit without updating disk configuration) Enter Selection: 5

2. And to add boot record to the second disk to make it bootable
# /sbin/installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c0d1s0 stage1 written to partition 0 sector 0 (abs 16065) stage2 written to partition 0, 233 sectors starting at 50 (abs 16115)

3. Add new item in the boot menu (/boot/grub/menu.lst) to have alternative way to boot
title Alternate boot

root (hd1,0,a) kernel /platform/i86pc/multiboot module /platform/i86pc/boot_archive

4. Check if the new item is added to the boot menu
# bootadm list-menu The location for the active GRUB menu is: /boot/grub/menu.lst default 0 timeout 10 0 Solaris 10 5/08 s10x_u5wos_10 X86 1 Solaris failsafe 2 Alternate boot

5. That¶s all, you have already mirrored root partition (plus swap)

Mis-configurations found in Servers. 1. Diagnostic partion present in one disk and not in other
login: root Password: Last login: Sun Apr 24 02:28:02 from 10.89.41.142 Oracle Corporation SunOS 5.10 Generic Patch January 2005 # bash bash-3.00# fdisk /dev/rdsk/c0t0d0p0 Total disk size is 17750 cylinders Cylinder size is 16065 (512 byte) blocks Cylinders Partition Status Type Start End Length % ========= ====== ============ ===== === ====== === 1 Diagnostic 1 7 7 0 2 Active Solaris2 8 17737 17730 100

SELECT ONE OF THE FOLLOWING: 1. Create a partition 2. Specify the active partition 3. Delete a partition 4. Change between Solaris and Solaris2 Partition IDs

5. Exit (update disk configuration and exit) 6. Cancel (exit without updating disk configuration) Enter Selection: ^C bash-3.00# fdisk /dev/rdsk/c0t1d0p0 Total disk size is 17750 cylinders Cylinder size is 16065 (512 byte) blocks Cylinders Partition Status Type Start End Length % ========= ====== ============ ===== === ====== === 1 Active Solaris2 1 17749 17749 100

SELECT ONE OF THE FOLLOWING: 1. Create a partition 2. Specify the active partition 3. Delete a partition 4. Change between Solaris and Solaris2 Partition IDs 5. Exit (update disk configuration and exit) 6. Cancel (exit without updating disk configuration) Enter Selection:

bash-3.00# prtvtoc /dev/rdsk/c0t1d0s0 * /dev/rdsk/c0t1d0s0 partition map * * Dimensions: * 512 bytes/sector * 63 sectors/track * 255 tracks/cylinder * 16065 sectors/cylinder * 17749 cylinders * 17747 accessible cylinders * * Flags: * 1: unmountable * 10: read-only * * Unallocated space: * First Sector Last * Sector Count Sector * 0 16065 16064 * 272912220 12193335 285105554 * * First Sector Last

* Partition Tag Flags Sector Count Sector Mount Directory 0 2 00 16065 62926605 62942669 1 3 01 62942670 104872320 167814989 2 5 00 0 284800320 284800319 3 0 00 167814990 104872320 272687309 7 0 00 272687310 208845 272896154 8 1 01 0 16065 16064 bash-3.00# prtvtoc /dev/rdsk/c0t0d0s0 * /dev/rdsk/c0t0d0s0 partition map * * Dimensions: * 512 bytes/sector * 63 sectors/track * 255 tracks/cylinder * 16065 sectors/cylinder * 17730 cylinders * 17728 accessible cylinders * * Flags: * 1: unmountable * 10: read-only * * Unallocated space: * First Sector Last * Sector Count Sector * 0 16065 16064 * 272912220 11888100 284800319 * * First Sector Last * Partition Tag Flags Sector Count Sector Mount Directory 0 2 00 16065 62926605 62942669 1 3 01 62942670 104872320 167814989 2 5 00 0 284800320 284800319 3 0 00 167814990 104872320 272687309 7 0 00 272687310 208845 272896154 8 1 01 0 16065 16064 bash-3.00#

Delete the diagnostic partition using fdisk option 3
bash-3.00# prtvtoc /dev/rdsk/c0t1d0s2 |fmthard -s - /dev/rdsk/c0t0d0s2 fmthard: Partition 2 specifies the full disk and is not equal full size of disk. The full disk capacity is 285105555 sectors. fmthard: New volume table of contents now in place. 0s0h-3.00# /sbin/installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c0t1d

stage1h-3.00# /sbin/installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c0t0sh-3.00# /sbin/installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c0t0d0s0.00# /sbin/installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c0td0s0 stage1 written to partition 0 sector 0 (abs 16065)ot/grub/stage2 /dev/rdsk/c0t1d0 stage2 written to partition 0, 273 sectors starting at 50 (abs 16115) bash-3.00# metastat |grep replace Invoke: metareplace d130 c0t0d0s3 <new device> Invoke: metareplace d120 c0t0d0s1 <new device> Invoke: metareplace d110 c0t0d0s0 <new device> bash-3.00# metareplace -e d130 c0t0d0s3 d130: device c0t0d0s3 is enabled bash-3.00# metareplace -e d130 c0t0d0s3 bash-3.00# metareplace -e d120 c0t0d0s1 d120: device c0t0d0s1 is enabled bash-3.00# metareplace -e d110 c0t0d0s0 d110: device c0t0d0s0 is enabled bash-3.00# metastat |grep main bash-3.00# metastat |grep % Resync in progress: 0 % done Resync in progress: 0 % done Resync in progress: 0 % done bash-3.00# metastat |grep % Resync in progress: 0 % done Resync in progress: 0 % done Resync in progress: 0 % done bash-3.00# metastat |grep % Resync in progress: 0 % done Resync in progress: 0 % done Resync in progress: 0 % done bash-3.00# metadb -i flags first blk block count Wm p l 16 8192 /dev/dsk/c0t0d0s7 W p l 8208 8192 /dev/dsk/c0t0d0s7 W p l 16400 8192 /dev/dsk/c0t0d0s7 a p luo 16 8192 /dev/dsk/c0t1d0s7 a p luo 8208 8192 /dev/dsk/c0t1d0s7 a p luo 16400 8192 /dev/dsk/c0t1d0s7 r - replica does not have device relocation information o - replica active prior to last mddb configuration change u - replica is up to date l - locator for this replica was read successfully c - replica's location was in /etc/lvm/mddb.cf p - replica's location was patched in kernel m - replica is master, this is replica selected as input W - replica has device write errors a - replica is active, commits are occurring to this replica M - replica had problem with master blocks D - replica had problem with data blocks

F - replica had format problems S - replica is too small to hold current data base R - replica had device read errors bash-3.00# metadb -d /dev/dsk/c0t0d0s7 bash-3.00# metadb -i flags first blk block count a p luo 16 8192 /dev/dsk/c0t1d0s7 a p luo 8208 8192 /dev/dsk/c0t1d0s7 a p luo 16400 8192 /dev/dsk/c0t1d0s7 r - replica does not have device relocation information o - replica active prior to last mddb configuration change u - replica is up to date l - locator for this replica was read successfully c - replica's location was in /etc/lvm/mddb.cf p - replica's location was patched in kernel m - replica is master, this is replica selected as input W - replica has device write errors a - replica is active, commits are occurring to this replica M - replica had problem with master blocks D - replica had problem with data blocks F - replica had format problems S - replica is too small to hold current data base R - replica had device read errors bash-3.00# metadb -ac3 /dev/dsk/c0t0d0s7 bash-3.00# metadb -i flags first blk block count a u 16 8192 /dev/dsk/c0t0d0s7 a u 8208 8192 /dev/dsk/c0t0d0s7 a u 16400 8192 /dev/dsk/c0t0d0s7 a p luo 16 8192 /dev/dsk/c0t1d0s7 a p luo 8208 8192 /dev/dsk/c0t1d0s7 a p luo 16400 8192 /dev/dsk/c0t1d0s7 r - replica does not have device relocation information o - replica active prior to last mddb configuration change u - replica is up to date l - locator for this replica was read successfully c - replica's location was in /etc/lvm/mddb.cf p - replica's location was patched in kernel m - replica is master, this is replica selected as input W - replica has device write errors a - replica is active, commits are occurring to this replica M - replica had problem with master blocks D - replica had problem with data blocks F - replica had format problems S - replica is too small to hold current data base R - replica had device read errors bash-3.00# metastat |grep % Resync in progress: 0 % done

Resync in progress: 0 % done Resync in progress: 0 % done bash-3.00# metastat |grep % bash-3.00# init 6 updating /platform/i86pc/boot_archive bash-3.00#

2. Partion not active
bash-3.00# fdisk /dev/rdsk/c0t0d0p0 Total disk size is 17750 cylinders Cylinder size is 16065 (512 byte) blocks Cylinders Partition Status Type Start End Length % ========= ====== ============ ===== === ====== === 1 Active Solaris2 1 17749 17749 100

SELECT ONE OF THE FOLLOWING: 1. Create a partition 2. Specify the active partition 3. Delete a partition 4. Change between Solaris and Solaris2 Partition IDs 5. Exit (update disk configuration and exit) 6. Cancel (exit without updating disk configuration) Enter Selection: 6

bash-3.00# fdisk /dev/rdsk/c0t1d0p0 Total disk size is 17750 cylinders Cylinder size is 16065 (512 byte) blocks Cylinders Partition Status Type Start End Length % ========= ====== ============ ===== === ====== === 1 Solaris2 1 17749 17749 100

SELECT ONE OF THE FOLLOWING:

1. Create a partition 2. Specify the active partition 3. Delete a partition 4. Change between Solaris and Solaris2 Partition IDs 5. Exit (update disk configuration and exit) 6. Cancel (exit without updating disk configuration) Enter Selection: 6 bash-3.00# fdisk /dev/rdsk/c0t1d0p0 Total disk size is 17750 cylinders Cylinder size is 16065 (512 byte) blocks Cylinders Partition Status Type Start End Length % ========= ====== ============ ===== === ====== === 1 Solaris2 1 17749 17749 100

SELECT ONE OF THE FOLLOWING: 1. Create a partition 2. Specify the active partition 3. Delete a partition 4. Change between Solaris and Solaris2 Partition IDs 5. Exit (update disk configuration and exit) 6. Cancel (exit without updating disk configuration) Enter Selection: 2 Total disk size is 17750 cylinders Cylinder size is 16065 (512 byte) blocks Cylinders Partition Status Type Start End Length % ========= ====== ============ ===== === ====== === 1 Active Solaris2 1 17749 17749 100

SELECT ONE OF THE FOLLOWING: 1. Create a partition 2. Specify the active partition 3. Delete a partition 4. Change between Solaris and Solaris2 Partition IDs 5. Exit (update disk configuration and exit)

6. Cancel (exit without updating disk configuration) Enter Selection: 5

bash-3.00# fdisk /dev/rdsk/c0t0d0p0 Total disk size is 17750 cylinders Cylinder size is 16065 (512 byte) blocks Cylinders Partition Status Type Start End Length % ========= ====== ============ ===== === ====== === 1 Active Solaris2 1 17749 17749 100

SELECT ONE OF THE FOLLOWING: 1. Create a partition 2. Specify the active partition 3. Delete a partition 4. Change between Solaris and Solaris2 Partition IDs 5. Exit (update disk configuration and exit) 6. Cancel (exit without updating disk configuration) Enter Selection: ^C bash-3.00# fdisk /dev/rdsk/c0t1d0p0 Total disk size is 17750 cylinders Cylinder size is 16065 (512 byte) blocks Cylinders Partition Status Type Start End Length % ========= ====== ============ ===== === ====== === 1 Active Solaris2 1 17749 17749 100

SELECT ONE OF THE FOLLOWING: 1. Create a partition 2. Specify the active partition 3. Delete a partition 4. Change between Solaris and Solaris2 Partition IDs 5. Exit (update disk configuration and exit) 6. Cancel (exit without updating disk configuration) Enter Selection: 5

bash-3.00# /sbin/installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c0t0 d0s0 stage1 written to partition 0 sector 0 (abs 16065) stage2 written to partition 0, 273 sectors starting at 50 (abs 16115) bash-3.00# /sbin/installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c0t1 d0s0 stage1 written to partition 0 sector 0 (abs 16065) stage2 written to partition 0, 273 sectors starting at 50 (abs 16115) bash-3.00#

Sponsor Documents

Or use your account on DocShare.tips

Hide

Forgot your password?

Or register your new account on DocShare.tips

Hide

Lost your password? Please enter your email address. You will receive a link to create a new password.

Back to log-in

Close