From Wiki-UX.info

Wiki-UX / Dynamic Root Disk / How to extend vg00 logical volumes using Dynamic Root Disk
Jump to: navigation, search

How to extend vg00 logical volumes using Dynamic Root Disk

Contents

Abstract

HP Dynamic Root Disk can be used to perform changes on the file system sizes of LVM boot volume /dev/vg00 logical volumes corresponding to stand (lvol1), swap (lvol2) and root (lvol3) without affecting the active image.

The underlaying concept is to use a DRD inactive image volume group as a basis to extent the file system, and an additional drive as stepping stone to temporary allocate the non-boot logical volumes. Additional licensed OnlineJFS is not required to complete the task, because only cold volume groups are used.

The article discusses how to extend the file systems using the standard LVM command extenfs. Reducing filesystem can also be acomplished without OnlineJFS, but that requires data backup.

The following examples use the same layout of the DRD inactive image presented on the How to clone vg00 using Dynamic Root Disk article.

Extending root filesystem

# bdf
Filesystem          kbytes    used   avail %used Mounted on
'''/dev/vg00/lvol3    1572864  341256 1222048   22% /'''
/dev/vg00/lvol1    1522232  111336 1258672    8% /stand
/dev/vg00/lvol7    6291456 2051120 4210152   33% /var
/dev/vg00/lvol6    3145728 2151096  986912   69% /usr
/dev/vg00/lvol5     524288   53192  467480   10% /tmp
/dev/vg00/lvol4    6291456 2895256 3369712   46% /opt
/dev/vg00/lvol8     106496    5856   99856    6% /home
/dev/vg01/lvol1    35561472 4647809 28981591   14% /depots
/dev/vg00/lvol9    4194304 2205342 1864667   54% /depot
DevFS                    3       3       0  100% /dev/deviceFileSystem
# cat /etc/fstab
 # System /etc/fstab file.  Static information about the file systems
 # See fstab(4) and sam(1M) for further details on configuring devices.
 /dev/vg00/lvol3 / vxfs delaylog 0 1
 /dev/vg00/lvol1 /stand hfs defaults 0 1
 /dev/vg00/lvol4 /opt vxfs delaylog 0 2
 /dev/vg00/lvol5 /tmp vxfs delaylog 0 2
 /dev/vg00/lvol6 /usr vxfs delaylog 0 2
 /dev/vg00/lvol7 /var vxfs delaylog 0 2
 /dev/vg00/lvol8 /home vxfs delaylog 0 2
 /dev/vg00/lvol9 /depot vxfs largefiles,delaylog 0 2
# lvdisplay /dev/vg00/lvol3
--- Logical volumes ---
LV Name                     /dev/vg00/lvol3
VG Name                     /dev/vg00
LV Permission               read/write
LV Status                   available/syncd
Mirror copies               1
Consistency Recovery        MWC
Schedule                    parallel
LV Size (Mbytes)            1536
Current LE                  192
Allocated PE                384
Stripes                     0
Stripe Size (Kbytes)        0
Bad block                   off
Allocation                  strict/contiguous
IO Timeout (Seconds)        default
# lvdisplay /dev/vg00/lvol4
--- Logical volumes ---
LV Name                     /dev/vg00/lvol4
VG Name                     /dev/vg00
LV Permission               read/write
LV Status                   available/syncd
Mirror copies               1
Consistency Recovery        MWC
Schedule                    parallel
LV Size (Mbytes)            6144
Current LE                  768
Allocated PE                1536
Stripes                     0
Stripe Size (Kbytes)        0
Bad block                   on
Allocation                  strict
IO Timeout (Seconds)        default

The disk /dev/disk/disk9 is available for usage as a stepping stone. In this example, the logical volume /dev/vg03/lvol3 will be extended to 8 additional physical extents.

To acomplish this, we move the data of volume group /dev/vg00/lvol4 from the DRD volume group on disk /dev/disk/disk10 to the spare disk /dev/disk/disk9. After that, we increase /dev/vg03/lvol3. Finally, the logical volume /dev/vg00/lvol4 will return to disk /dev/disk/disk10.

1. Mount the DRD volume group to enable /dev/drd00 volume group.

# mkdir /dev/drd00
# mknod /dev/drd00/group c 64 0x030000
# vgimport /dev/drd00 /dev/disk/disk10
vgimport: Volume group "/dev/drd00" has been successfully created.
Warning: A backup of this volume group may not exist on this machine.
Please, remember to take a backup using the vgcfgbackup command after activating the volume group.
Also, upon first activation of an imported bootable volume group, make
sure to run lvlnboot(1M) command in recovery mode (-R option) to resync
the information on the disk
 
# ll /dev/drd00
total 0
crw-rw-rw-   1 root       sys         64 0x030000 Dec 11 14:13 group
brw-r-----   1 root       sys         64 0x030001 Dec 11 14:13 lvol1
brw-r-----   1 root       sys         64 0x030002 Dec 11 14:13 lvol2
brw-r-----   1 root       sys         64 0x030003 Dec 11 14:13 lvol3
brw-r-----   1 root       sys         64 0x030004 Dec 11 14:13 lvol4
brw-r-----   1 root       sys         64 0x030005 Dec 11 14:13 lvol5
brw-r-----   1 root       sys         64 0x030006 Dec 11 14:13 lvol6
brw-r-----   1 root       sys         64 0x030007 Dec 11 14:13 lvol7
brw-r-----   1 root       sys         64 0x030008 Dec 11 14:13 lvol8
brw-r-----   1 root       sys         64 0x030009 Dec 11 14:13 lvol9
crw-r-----   1 root       sys         64 0x030001 Dec 11 14:13 rlvol1
crw-r-----   1 root       sys         64 0x030002 Dec 11 14:13 rlvol2
crw-r-----   1 root       sys         64 0x030003 Dec 11 14:13 rlvol3
crw-r-----   1 root       sys         64 0x030004 Dec 11 14:13 rlvol4
crw-r-----   1 root       sys         64 0x030005 Dec 11 14:13 rlvol5
crw-r-----   1 root       sys         64 0x030006 Dec 11 14:13 rlvol6
crw-r-----   1 root       sys         64 0x030007 Dec 11 14:13 rlvol7
crw-r-----   1 root       sys         64 0x030008 Dec 11 14:13 rlvol8
crw-r-----   1 root       sys         64 0x030009 Dec 11 14:13 rlvol9

2. Extend the /dev/drd00 with the spare drive /dev/disk/disk/disk9.

# pvcreate -f /dev/rdisk/disk9
Physical volume "/dev/rdisk/disk9" has been successfully created.
 
# vgchange -a y /dev/drd00
Activated volume group
Volume group "/dev/drd00" has been successfully changed.
 
# vgextend /dev/drd00 /dev/disk/disk9
Volume group "/dev/drd00" has been successfully extended.
Volume Group configuration for /dev/drd00 has been saved in /etc/lvmconf/drd00.conf

3. Use pvmove command to move /dev/drd00/lvol4 from /dev/disk/disk10 to /dev/disk/disk9

# pvmove -n /dev/drd00/lvol4 /dev/disk/disk10 /dev/disk/disk9
Transferring logical extents of logical volume "/dev/drd00/lvol4"...
Physical volume "/dev/disk/disk10" has been successfully moved.
Volume Group configuration for /dev/drd00 has been saved in /etc/lvmconf/drd00.conf
 
# lvdisplay -v /dev/drd00/lvol4 | pg
--- Logical volumes ---
LV Name                     /dev/drd00/lvol4
VG Name                     /dev/drd00
LV Permission               read/write
LV Status                   available/syncd
Mirror copies               0
Consistency Recovery        MWC
Schedule                    parallel
LV Size (Mbytes)            6144
Current LE                  768
Allocated PE                768
Stripes                     0
Stripe Size (Kbytes)        0
Bad block                   on
Allocation                  strict
IO Timeout (Seconds)        default
 
   --- Distribution of logical volume ---
   PV Name                 LE on PV  PE on PV
   /dev/disk/disk9         768       768
...

4. Extend root logical volume and extend the filesystem (/) to 200 Physical Extends (PE).

# lvextend -l 200 /dev/drd00/lvol3
Logical volume "/dev/drd00/lvol3" has been successfully extended.
Volume Group configuration for /dev/drd00 has been saved in /etc/lvmconf/drd00.conf
 
# extendfs -F vxfs /dev/drd00/rlvol3

5. Reallocate /dev/drd00/lvol4 to /dev/disk/disk10.

# pvmove -n /dev/drd00/lvol4 /dev/disk/disk9 /dev/disk/disk10
Transferring logical extents of logical volume "/dev/drd00/lvol4"...
Physical volume "/dev/disk/disk9" has been successfully moved.
Volume Group configuration for /dev/drd00 has been saved in /etc/lvmconf/drd00.conf
You have mail in /var/mail/root

6. Reduce /dev/disk/disk9 from the volume group.

# vgreduce /dev/drd00 /dev/disk/disk9
Volume group "/dev/drd00" has been successfully reduced.
Volume Group configuration for /dev/drd00 has been saved in /etc/lvmconf/drd00.conf

7. Remove volume group /dev/drd00.

# vgchange -a n /dev/drd00
Volume group "/dev/drd00" has been successfully changed.
 
# vgexport /dev/drd00
vgexport: Volume group "/dev/drd00" has been successfully removed.

8. Boot from the alternate disk.

# /opt/drd/bin/drd activate -x reboot=true
 
=======  12/12/07 10:39:52 CST  BEGIN Activate Inactive System Image
         (user=root)  (jobid=delta)
 
       * Checking for Valid Inactive System Image
       * Reading Current System Information
       * Locating Inactive System Image
       * Determining Bootpath Status
       * Primary bootpath : 0/1/1/0.0x1.0x0 (/dev/rdisk/disk12) before
         activate.
       * Primary bootpath : 0/1/1/1.0xd.0x0 after activate.
       * Alternate bootpath : 0/1/1/1.0x0.0x0 (/dev/rdisk/disk7) before
         activate.
       * Alternate bootpath : 0/1/1/1.0x0.0x0 (/dev/rdisk/disk7) after
         activate.
       * Activating Inactive System Image
       * Rebooting System

9. Verify the status of the system after reboot.

# strings /etc/lvmtab
/dev/vg01
/dev/disk/disk8
/dev/vg00
/dev/disk/disk10
 
# bdf
Filesystem          kbytes    used   avail %used Mounted on
'''/dev/vg00/lvol3    1638400  340112 1288168   21% /'''
/dev/vg00/lvol1    1522232  107432 1262576    8% /stand
/dev/vg00/lvol7    6291456 2026632 4231528   32% /var
/dev/vg00/lvol6    3145728 2149296  988696   68% /usr
/dev/vg00/lvol5     524288   53112  467560   10% /tmp
/dev/vg00/lvol4    6291456 2876872 3387952   46% /opt
/dev/vg00/lvol8     106496    5848   99864    6% /home
/dev/vg01/lvol1    35561472 4647809 28981591   14% /depots
/dev/vg00/lvol9    4194304 2206071 1863983   54% /depot
DevFS                    3       3       0  100% /dev/deviceFileSystem

The new size of the root file system (/) is now 1638400 (previous 1572864).

Authors

Editor

This page was last modified on 30 April 2011, at 00:30. This page has been accessed 3,347 times.