Operating System - HP-UX
1834009 Members
2241 Online
110063 Solutions
New Discussion

Re: extend root file system

 
amipankaj
Frequent Advisor

extend root file system

Hello Experts,

i have one issues, hope you guys will help me.

i have swap space on lv3 and root on lv4.
lv3 is of 12gigs and root(lv4) is of 2 gigs

i want to reduce swap and add space in root.

following steps i tried.

1. hashed out swap from /etc/fstab and rebooted the machine.

2. reduced mirror of lv3 and lv4
3. reduced lv3 to 9gigs
4. tried to extend lv4 to 5gig but it was failed due to contigous problem.

i think system is looking to allocate PE to lv4 in increasing order and we got free PE after reduce pv3 thats in another side.

Please let me know to to solve this.

thanks in advance.
Roy
11 REPLIES 11
Srimalik
Valued Contributor

Re: extend root file system


Searching forums with "extend root file system " gave many results.

A few.

http://forums13.itrc.hp.com/service/forums/questionanswer.do?admit=109447627+1230632216191+28353475&threadId=865252

http://forums13.itrc.hp.com/service/forums/questionanswer.do?admit=109447627+1230632208429+28353475&threadId=97821

http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1233547


to have contiguous lvol4 do this(but this is not what people generally do extend /, please see above threads):

1. mv the lv which lies after lvol4 to some other vg.
2. extend lvol4
3. move back the lv moved in step 1.
abandon all hope, ye who enter here..
amipankaj
Frequent Advisor

Re: extend root file system

thanks sri...but in this case...i will not able to use the space in got from swap(lv3)
Robert-Jan Goossens
Honored Contributor

Re: extend root file system

Hi Roy,

I'm not trying to annoy you but extending root should be your last option.

---
i have swap space on lv3 and root on lv4.
lv3 is of 12gigs and root(lv4) is of 2 gigs
---

Root 2 GB should be more the enough. Are you sure you can't move data that does not belong in the root filesystem to its own filesystem?

Could you post the output of

# du -akx / | sort -n | more

Kind regards,
Robert-Jan
F Verschuren
Esteemed Contributor

Re: extend root file system

To find all files on vg00 please run the foloving comand
ff /dev/vg00/lvol3
When this is combined whit the du -ks, you can find the stuff that is not needed in /

ps if you have migrated/moved some vg it is whist to clean up the vg that does no longer exist in /etc/lvmconf/

Kind regards,

Freek
Ganesan R
Honored Contributor

Re: extend root file system

Hi Amipankaj,

There are many threats you can find it here related to extending the root filesystem.

The only recommanded way to extend the root filesystem is taking ignite backup and restore it with modified LV sizes. There are certain ways to extend it without ignite, but it is with your own risk.

You cannot move around the lv's to reduce the space and assign it to root lv, since root lv needs contigious space.

Best wishes,

Ganesh.
Srimalik
Valued Contributor

Re: extend root file system

>i will not able to use the space in got from swap(lv3)

by the name it seems that on the vg lv3 is placed before lv4, I have never seen a lv extending backwards, Not sure if its possible.
abandon all hope, ye who enter here..
amipankaj
Frequent Advisor

Re: extend root file system

yep shrikrishna....thats my concern.
Robert-Jan Goossens
Honored Contributor

Re: extend root file system

could you also post the output of

# bdf

# vgdisplay -v vg00

Regards,
Robert-Jan
amipankaj
Frequent Advisor

Re: extend root file system

Thanks guy...thank you for your response....its done now...i reduced mirror for all lvs. moved lv4 to another disk...extended it then moved all lvs like lv5, 6, 7and all to another disk. Then i moved back pv4 to first disk first. it works.


sujit kumar singh
Honored Contributor

Re: extend root file system

hello

the best suggested method in this case and the satndard one is to make an ignite and restore the ignite back on to the server.

the other ways possible are as follows:
if u can use additional new disks, create a new VG say rootvg then u can follow the procedure of creating new LVs on them in accordance to what u have now on the root VG and copy the data using find -xdev -depth | cpio -pdvmvx /new_mt_pt.
make sure
1)that on the new VG lvol, lvol2 and lvol3 as u have created using the desired size follow the -C y -s y that is strict and contiguous in aloocation Policy , make this time the root be larger.
2)Create the other LVs as on the original root VG.
3) on new disk at creating the rootvg make sure that u follow mkboot -e -l etc according to the Integrity Platform.
, after that doing an lvlnboot , setboot to the new boot path , reboot the system, start in LVMMaintenance mode, Export the vg00 and reimport the New disks as put into vg00, do a vgcfgbackup, setboot to this path , make the entry in /stand/bootconf and reboot with this path.


OR u can use a new disk, add to the vg00 and make this bootable,create lvol1new lvol2new lvol3new and lvol4new with the new sizes, copy the data using find -xdev -depth | cpio -pdmvx synatx and copy only lvol1 lvol2 lvol3 and lvol4 only. use lvlnboot to define the new boot swap root and dump , add entry to /stand/bbotconf and setboot to this path to boot the system.Make necessary entry changes in /etc/fstab to mount the /dev/vg00/lvol1new and /dev/vg00/lvol4new ,commenting the existing entry lvol1 and lvol4 and modifying if swap entries accordingly if anyy in the fstab.
In this thought not standardily suggested at all the System will boot from the new disk and take other /usr ,/tmp and other mt. pts from the LVs on the other disk.


note: after u have achieved this config , Plan for a down time immediately for the system and do make an Ignite Restore of the system with the deired root disk config.


Sujit
sujit kumar singh
Honored Contributor

Re: extend root file system

HI there is one way out looking at the swap space that u decreased and that has given u a 3GB of contig space just after the location of the LVOL3.Make the Pry swap still smaller to free upto 6 GB of space.

All u need to know is the start and end PEs for this space and make a note of that and create an LV in that space with -Cy and -sy options for contig and strict allocation policy and name this as /dev/vg00/newroot.

follow th efollowing seq of steps:
1) #lvcreate -L 6000 -C y -s y -n newroot /dev/vg00.

This space allocation shall auto happen from the fre PE and shall take the PEs in the free pool that u have recently freed up as allocation of PE to an LV takes palace by default like that.

2)#newfs -F vxfs -b 1092 /dev/vg00/rnewroot
3)#mkdir /newroot
4)#mount -F vxfs /dev/vg00/rnewroot /newroot
5)#cd /
6)#find . -xdev -depth | cpio -pdmvux /newroot
after the copying has been finished,
7)#lvrmboot -r /dev/vg00
8)#lvlnboot -r /dev/vg00/newroot
9)#lvlnboot -b /dev/vg00/lvol1
10)#lvlnboot -s /dev/vg00/lvol2
11)#lvlnboot -d /dev/vg00/lvol2
12)#lvlnboot -R
12)#vi /etc/fstab

to change the enries for mounting the root fs.change this from /dev/vg00/lvol4 to /dev/vg00/newroot take care of the swap lV entries in the /etc/fstab also

Shutdown and rebbot the system.

13) after the system has successfully come up and all works fine, do an lvremove for the /dev/vg00/lvol4
14)recreate an LV of reqd size with -C y and -s y option and the same space for lvol4
15) use the Lvol4 for the New additional Swap that u will require, put the entries for swap in /etc/fstab for device swap on the /dev/vg00/lvol4 and activate the same suing swapon /dev/vg00/lvol4.


This will work, if u apply with proper rules for LVM.

Still suggest u to take an Ignite for the syatem and later on amke standard LVs for the Root VG as lvol1 - boot , lvol2 -- primary swao and dump and lvol3 as root.


Regards
Sujit