Saturday, August 22, 2009

REDUCING A LOGICAL VOLUME

REDUCING A LOGICAL VOLUME

[CAUTION : DATA LOSS WILL OCCUR]

Step 1: Check the current size of the Logical Volume

# lvdisplay /dev/vg01/lvol01

--- Logical volumes ---

LV Name /dev/vg01/lvol01

VG Name /dev/vg01

LV Permission read/write

LV Status available/syncd

Mirror copies 0

Consistency Recovery MWC

Schedule parallel

LV Size (Mbytes) 120

Current LE 30

Allocated PE 30

Stripes 0

Stripe Size (Kbytes) 0

Bad block on

Allocation strict

IO Timeout (Seconds) default


# bdf /dev/vg01/lvol01

Filesystem kbytes used avail %used Mounted on

/dev/vg01/lvol01

122880 1133 114145 1% /opt/test

^

|

# fsadm -b 100m -F vxfs /opt/test

fsadm: /dev/vg01/rlvol01 is currently 122880 sectors - size will be reduced

# lvreduce -L 100 /dev/vg01/lvol01

When a logical volume is reduced useful data might get lost;

do you really want the command to proceed (y/n) : y

Logical volume "/dev/vg01_renamed/lvol01" has been successfully reduced.

Volume Group configuration for /dev/vg01_renamed has been saved in /etc/lvmconf/vg01_renamed.conf

# bdf /opt/test

Filesystem kbytes used avail %used Mounted on

/dev/vg01_renamed/lvol01

102400 1133 94945 1% /opt/test

^


# lvdisplay /dev/vg01/lvol01

--- Logical volumes ---

LV Name /dev/vg01/lvol01

VG Name /dev/vg01

LV Permission read/write

LV Status available/syncd

Mirror copies 0

Consistency Recovery MWC

Schedule parallel

LV Size (Mbytes) 100

Current LE 25

Allocated PE 25

Stripes 0

Stripe Size (Kbytes) 0

Bad block on

Allocation strict

IO Timeout (Seconds) default

No comments:

Post a Comment