Operating System - HP-UX
1748224 Members
4563 Online
108759 Solutions
New Discussion юеВ

Re: Can we extend LVM root Filesystem in HP-UX

 
BVB KUMAR
New Member

Can we extend LVM root Filesystem in HP-UX

Hi,

Can we extend LVM root filesystem in HP-UX. If it is possible, tell me how to do.

regards
BVB Kumar
9 REPLIES 9
Geoff Wild
Honored Contributor

Re: Can we extend LVM root Filesystem in HP-UX

Possible yes.

With Online JFS - difficult.

Offline - easy - with ignite - just use it to resize your volumes.

That said - here is my tried tested and true online way:

Not for the faint of heart.

No outage required , if you have online jfs.
If you do not have online jfs , do all the following in LVM maintenance mode.
Note: this will only work if SWAP is NOT the next lvol after /

a. Login as root.
b. Find out a free disk / un mirror the rootvg and make that disk free.
c. find out the next logical volume after lvol3(assumed lvol3 is root)
d. pvmove that logical volume onto the newly added disk
[ pvmove -n /dev/vg00/lvol4 /dev/dsk/CURRENT /dev/dsk/NEW]
e. now you should be able to increase root filesystem to an additional `size_of_the_lvol4`.
f. pvmove the lvol4 back to root vg ( vg00)

boot,swap and root are the only lvols that needs a contegeous policy. so , it does not matter where lvol4 is.

Example, move lvol4 away from lvol3 , thus creating a contegeous space right after lvol3. If you need more space on "/" you will be able to move lvol5 ...6 to the next disk and do the stuff. Do remember to migrate them back to the original disk.

Now, if you have mirrored root vg, then break the mirror before you do this.


Practical Example (actual test)

# bdf |grep vg00
/dev/vg00/lvol3 204800 151616 53184 74% /
/dev/vg00/lvol1 125808 49064 64160 43% /stand
/dev/vg00/lvol7 4194304 2501208 1680472 60% /var
/dev/vg00/lvol6 3145728 1856304 1279456 59% /usr
/dev/vg00/lvol5 524288 160992 361104 31% /tmp
/dev/vg00/lvol4 2097152 1833496 261656 88% /opt
/dev/vg00/lvol8 1048576 622656 422632 60% /home
/dev/vg00/lvol10 2097152 1270980 774595 62% /app


Find a spare disk:

strings /etc/lvmtab |grep c7t0d6
pvcreate -f /dev/rdsk/c7t0d6
vgextend /dev/vg00 /dev/dsk/c7t0d6
lvdisplay -v /dev/vg00/lvol4 |more
lvreduce -m 0 /dev/vg00/lvol4
lvdisplay -v /dev/vg00/lvol4 |more
pvmove -n /dev/vg00/lvol4 /dev/dsk/c0t6d0 /dev/dsk/c7t0d6

lvextend -L 1024 /dev/vg00/lvol3
fsadm -b 1024M /

pvmove -n /dev/vg00/lvol4 /dev/dsk/c7t0d6 /dev/dsk/c0t6d0
vgreduce /dev/vg00 /dev/dsk/c7t0d6

lvextend -m 1 /dev/vg00/lvol4


# bdf |grep vg00
/dev/vg00/lvol3 1048576 151640 890456 15% /
/dev/vg00/lvol1 125808 49064 64160 43% /stand
/dev/vg00/lvol7 4194304 2506048 1675672 60% /var
/dev/vg00/lvol6 3145728 1856304 1279456 59% /usr
/dev/vg00/lvol5 524288 160992 361104 31% /tmp
/dev/vg00/lvol4 2097152 1833552 261600 88% /opt
/dev/vg00/lvol8 1048576 622656 422632 60% /home
/dev/vg00/lvol10 2097152 1270980 774595 62% /app



Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Steven E. Protter
Exalted Contributor

Re: Can we extend LVM root Filesystem in HP-UX

Shalom,

Can not do this. / must be contiguous.

make_tape_recovery

boot off tape

intervene during restore, make root larger.

This will work.

Can also be done with make_net_recovery(harder)

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Tim Nelson
Honored Contributor

Re: Can we extend LVM root Filesystem in HP-UX

As Steven mentioned, extending / and /stand must be done with a rebuild. Using Ignite is clean, simple and reliable.

Extending /tmp, /opt, /var, /usr can be done in single user or with onlineJFS.

melvyn burnard
Honored Contributor

Re: Can we extend LVM root Filesystem in HP-UX

If you are running HP-UX 11iV2, you could take a look at Dynamic Root Disk (DRD)
http://h20293.www2.hp.com/portal/swdepot/displayProductInfo.do?productNumber=DynRootDisk
My house is the bank's, my money the wife's, But my opinions belong to me, not HP!
Hein van den Heuvel
Honored Contributor

Re: Can we extend LVM root Filesystem in HP-UX

Check out the recent similar and pertinent discussion in:

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1096861

Check out Geoff's reply on how you might be able to extent / contigeously if you are lucky.

Hein.
MarkSyder
Honored Contributor

Re: Can we extend LVM root Filesystem in HP-UX

I'm surprised no one's asked why you want to do this. / usually doesn't need to grow so it's possible you've got stuff in there that should be in a filesystem of its own. Check that before taking any drastic action.

Mark Syder (like the drink but spelt different)
The triumph of evil requires only that good men do nothing
Indrajit_1
Valued Contributor

Re: Can we extend LVM root Filesystem in HP-UX

Hi;

i am agree with Mark Syder. Extending root filesystem is something like u are re-igniting ur box.

Please find out the root cause why do u need to extend your root filesystem. Usually we don't extend root filesystem if u have standard root filesystem as per HP docs.

Cheers;
Indrajit Roy
Never Ever Give Up
Geoff Wild
Honored Contributor

Re: Can we extend LVM root Filesystem in HP-UX

Actually, root needs to increase in size - usually when you want to apply patches (one that bit me was a patch that changed /etc/vx - and dumped 56 MB into it!) or O/S upgrades or OE upgrades.

Yes, with an O/S upgrade you have the opportunity to resize then.

My standard build is now 1GB for /

The reason I have done it the way above - I just hate being like Micro$oft and having to take a system down for any reason...

Rgds...Geoff (I'm hoping that swap can be turned off on the fly in 11.31!!!!)
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
abhishekjain_48
Advisor

Re: Can we extend LVM root Filesystem in HP-UX

can you tell how can i extend /tmp present at /dev/vx/dsk/rootdg/tmpvol in single user mode??
give steps please..