Operating System - HP-UX
1825793 Members
2263 Online
109687 Solutions
New Discussion

how to lvreduce so that also mounted filesystem is reduced

 
SOLVED
Go to solution
Frank de Vries
Respected Contributor

how to lvreduce so that also mounted filesystem is reduced

On hpux 11.00
I have lvextend a FS (/opt) but I mistook a digit.
Instead of lvextend -l 125 I did lvextend 1250
and ran fsadm accordingly, without realising
my error. Until I did bdf and saw it was a bit
bigger then expected - oops.

Since it happened only seconds ago I think
I can still do lvreduce.
I ran the command lvreduce -l 200
(A bit more so to have some margin, with hindsight). I received the error:
" The Logical Volume has a mounted filesystem on it.
Logical volume "/dev/vg00/lvol6" is not reduced."

I have two questions:
1) How is it technically possible to reduce it,
knowing that I cannot unmount /opt at the
present time (Yes we have MirrorDisk/UX software)
2) Can it be considered safe given that is
so shortly after the lvextend
(Yes, I have a fs backup from today)

I am curious to the replies.
Cheers

Look before you leap
4 REPLIES 4
Senthil Kumar .A_1
Honored Contributor
Solution

Re: how to lvreduce so that also mounted filesystem is reduced

Hi,

Since you have Online JFS, The steps to reduce the FS is as follows.

1) You need to reduce the filesystem size first.

fsadm -b 200m /usr

Note: here I have assumed the size to be 200MB, if u do not specify "m" it will default to kb.

2) Now reduce the LV

lvreduce -L 200 /dev/vg00/lvol6


NOTE: Before you do this activity, it is better you defragment the /usr FS.

fsadm -d -e /usr

Regards,
Senthil Kumar .A
Let your effort be such, the very words to define it, by a layman - would sound like a "POETRY" ;)
Victor BERRIDGE
Honored Contributor

Re: how to lvreduce so that also mounted filesystem is reduced

Hi
As already mentionned,
To be safe (well if you can...) pass this command first
fsadm -F vxfs -D -d -E -e -s /opt

It will reorganize the file system leaving the empty blocks at the end...

It is no reason to Not make a safe backup before...

All the best
Victor
Zeev Schultz
Honored Contributor

Re: how to lvreduce so that also mounted filesystem is reduced

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=975400
So computers don't think yet. At least not chess computers. - Seymour Cray
Frank de Vries
Respected Contributor

Re: how to lvreduce so that also mounted filesystem is reduced

It worked,
thanks a million
Look before you leap