Operating System - HP-UX
1753727 Members
4622 Online
108799 Solutions
New Discussion юеВ

Re: How to correct mistake of lvextend cmd ?

 
SOLVED
Go to solution
Jerry_109
Super Advisor

How to correct mistake of lvextend cmd ?

Hello All,

Quick question, how can I correct a mistake I made. I extended the wrong logical volume ( /dev/vg00/usr ). Now the lv shows 5000, but the extendfs cmd was never entered, so bdf still shows 4096000 ?

#########################
HP-UX fdhp31 B.11.23 U /A500-7X
#########################
root@fdhp31[/root]
# bdf /usr
Filesystem kbytes used avail %used Mounted on
/dev/vg00/usr 4096000 1700040 2377272 42% /usr
root@fdhp31[/root]
# lvdisplay /dev/vg00/usr
--- Logical volumes ---
LV Name /dev/vg00/usr
VG Name /dev/vg00
LV Permission read/write
LV Status available/syncd
Mirror copies 0
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 5000
Current LE 625
Allocated PE 625
Stripes 0
Stripe Size (Kbytes) 0
Bad block on
Allocation strict
IO Timeout (Seconds) default
6 REPLIES 6
Murat SULUHAN
Honored Contributor
Solution

Re: How to correct mistake of lvextend cmd ?

Hi Jerry

lvreduce command will help you

http://docs.hp.com/en/B3921-60631/lvreduce.1M.html

Best Regards
Murat
Murat Suluhan
David Bellamy
Respected Contributor

Re: How to correct mistake of lvextend cmd ?

Jerry if you have OnLineJFS look at the fsadm command.
Jerry_109
Super Advisor

Re: How to correct mistake of lvextend cmd ?

I ran the following command. Was it the wrong cmd to enter? :

lvreduce -L 4096 /dev/vg00/usr

##################################
root@fdhp31[/root]
# lvdisplay /dev/vg00/usr
--- Logical volumes ---
LV Name /dev/vg00/usr
VG Name /dev/vg00
LV Permission read/write
LV Status available/syncd
Mirror copies 0
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 4096
Current LE 512
Allocated PE 512
Stripes 0
Stripe Size (Kbytes) 0
Bad block on
Allocation strict
IO Timeout (Seconds) default

root@fdhp31[/root]
#
root@fdhp31[/root]
#
root@fdhp31[/root]
# lvdisplay -v /dev/vg00/usr | grep -i stale
root@fdhp31[/root]
Murat SULUHAN
Honored Contributor

Re: How to correct mistake of lvextend cmd ?

Hi Jerry

There is no error
You entered
lvreduce -L 4096 /dev/vg00/usr

and now LV size as follows

LV Size (Mbytes) 4096

David fsadm is filesystem utility and it can't help this problem

Best Regards
Murat

Murat Suluhan
Sandman!
Honored Contributor

Re: How to correct mistake of lvextend cmd ?

>I ran the following command. Was it the wrong cmd to enter? :

>lvreduce -L 4096 /dev/vg00/usr

Since you extended /dev/vg00/usr from 500 to 625 LEs you should reduce it to the same size viz.,

-- Num of LEs before lvextend'ing.
# echo (4096000/(1024*8)) | bc
500
-- Reduce the lvol from 625 to 500 LEs.
# lvreduce -l 500 /dev/vg00/usr
OR
-- Shrink it in size from 5000 to 4000 Mbytes.
# lvreduce -L 4000 /dev/vg00/usr

~hope it helps
James R. Ferguson
Acclaimed Contributor

Re: How to correct mistake of lvextend cmd ?

Hi Jerry:

Since you enlarged the logical volume but not the filesystem within, simply 'lvreduce' the logical volume to its original size.

The logical volume is only a container for the filesystem in this case. While you increased the size of the container, you didn't increase its contents. Shrink the container to fit the contents.

Regards!

...JRF...