Showing posts with label Solaris Volume Manager. Show all posts
Showing posts with label Solaris Volume Manager. Show all posts

Tuesday, June 22, 2010

How to expand an existing metadevice and file system

1.       Attach another slice to existing metadevice
# metattach d0 c1t2d0s2
2.       # growfs –M /home2 /dev/md/rdsk/d0

Sunday, February 17, 2008

Replace failed drives in SVM

Suppose we have two internal disks in a system mirrored with SVM and which are being monitored by Nagios/BB/sitescope or a script. When a drive fails we get a message meta devices (drives) “Needs Maintenance”.

We can try reparing the drive if its not Production system.

# metareplace -e d10 c1t2d0s0

where d10 is mirror having d11 and d12 metadevices, d12 (c1t2d0s0) is on the disk which went bad.

If Resynching starts and completes without error disk is fine otherwise we have to replace disk. Below is the process to do that.

1. Detach all metadevices existing on failed disk.
# metadetach -f d10 d12
# metadetach -f d20 d22
# metadetach -f d30 d32

2. Remove the metadevices.

# metaclear d12 d22 d32

3. use metadb -d command to delete metadb existing on failed drive

4. Replace the disk

5. Copy the partition table form disk under SVM to new disk

6. use metadb to create meta database on new disk.

7. Create metadevices again on new disk.

8. Attach the metadevices to create mirror which will also sync them.

Important files in SVM

# more /etc/lvm/mddb.cf -> (DO NO EDIT) records the locations of state database replicas

# more /etc/lvm/md.cf -> (DO NO EDIT) contains auto generated config info for the default (unspecified or local) disk set

# /kernel/drv/md.conf -> (DO NO EDIT) contains the state database replica config info and is read by SVM at startup

# /etc/lvm/md.tab -> contains SVM config info that can be used to reconstruct your SVM config (Manually)







Wednesday, June 7, 2006

How to mirror disk using SVM

1. Make sure that there is atleast one free partition for meta database in disk where solaris is installed. Minimum 10MB of free space is required.

2. Create partition for meta database and label the disk.

3. make second drive partition table same as this one.
# prtvtoc /dev/rdsk/c0t1d0s2 | fmthard -s - /dev/rdsk/c0t2d0s2

4. Create metastat database
# metadb -a -c 3 -f c0t1d0s7 c0t2d0s7
-------c 3 creates three copies of the metastat database in this space

5. Initialize the root partition
# metainit -f d11 1 1 c0t1d0s0
# metainit -f d12 1 1 c0t2d0s0

6. Create the mirror
# metainit d10 -m d11

7. Update /etc/system and /etc/vfstab using metaroot
# metaroot d10

8. Reboot the system

9. Attach the other half of mirror
# metattach d10 d12

10. Change eeprom values for boot-device and use-nvramrc

11. If two internal drives are mirrored then modify /etc/system to bypass SVM Quorum rule
set md:mirrored_root_flag = 1

12. Install boot blocks on mirrored disk.
installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk /dev/rdsk/c0t2d0s0

13. Now in the same way mirror other partitions.

14. Keep a copy of configuration after all partitions are mirrored.
# metastat -p > /etc/lvm/md.tab