System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

To extend root FS in preceding lvols

 

To extend root FS in preceding lvols

hi alll

I have a problem that my root fs is on lvol4 and swap is on lvol3 so I accidently increased the lvol3 to lvol4 which has no problems but now I want that space back on to root FS which is lvol4 but since it has contiguous policy so its not taking the space from the lvols preceding to the lvol4 rather its trying to take sapce from the next lvols e.g 5,6,7. Can anybody through light so that I can recover the free space from lvol3 and increase the root lvol4.

Your suggestions will be appreciated.

Thanks in Advance!!!
Insanity is often the logic of mind overtasked!!!
12 REPLIES
sujit kumar singh
Honored Contributor

Re: To extend root FS in preceding lvols

it is amazing can u please immediately post the vgdisplay -v vg00 , lvlnboot -v and bdf O/ps of the server. That will really be Helpful.
also what is the OS Version is this 11.31 of HP-UX?

Re: To extend root FS in preceding lvols

Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol4 2097152 335048 1748424 16% /
/dev/vg00/lvol1 1835008 229048 1593504 13% /stand
/dev/vg00/lvol16 1048576 26025 958692 3% /volumes/v1
/dev/vg00/lvol15 1048576 231712 765881 23% /volumes/tsu
/dev/vg00/lvol14 524288 20590 472343 4% /volumes/nsr
/dev/vg00/lvol13 1048576 389758 617684 39% /volumes/gems
/dev/vg00/lvol12 524288 183123 319943 36% /volumes/esm
/dev/vg00/lvol10 8388608 3310456 5039032 40% /var
/dev/vg00/lvol11 10485760 19106 9812560 0% /var/adm/crash
/dev/vg00/lvol9 10485760 2730416 7694832 26% /usr
/dev/vg00/lvol8 1048576 20288 1021024 2% /tmp
/dev/vg00/lvol7 10485760 4967904 5474768 48% /opt
/dev/vg00/lvol6 131072 8680 121544 7% /home
/dev/vg00/lvol5 131072 1144 121810 1% /appl



HP-UX B.11.23 U ia64 3734274597


Insanity is often the logic of mind overtasked!!!
sujit kumar singh
Honored Contributor

Re: To extend root FS in preceding lvols

suggested to take an Ignite backup of the system and then do a Ignite restore to Reinstall on the system with the desired root disk configuration.

Re: To extend root FS in preceding lvols

I dont think so!!!
Insanity is often the logic of mind overtasked!!!
sujit kumar singh
Honored Contributor

Re: To extend root FS in preceding lvols

sorry wriring all these to an expert.

Re: To extend root FS in preceding lvols

no id didnt mean that ... I wanted to say I cant ignite for this system now...
Insanity is often the logic of mind overtasked!!!
Ganesan R
Honored Contributor

Re: To extend root FS in preceding lvols

Hi Saurabh,

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.

Hope this helps..
Best wishes,

Ganesh.
sujit kumar singh
Honored Contributor

Re: To extend root FS in preceding lvols

r u using lvol2 and lvol3 both as swap?
if yes what are the sizes of them?
Pete Randall
Outstanding Contributor

Re: To extend root FS in preceding lvols

Could you post the output of "lvdisplay /dev/vg00/lvol3",please. I don't see how you could have extended it if it was defined as strict/contiguous as it should have been.


Pete

Pete
sujit kumar singh
Honored Contributor

Re: To extend root FS in preceding lvols

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.
Ivan Krastev
Honored Contributor

Re: To extend root FS in preceding lvols

You can dynamically extend root (/) with the next logical volume (lvol4,5) - http://www.symmetricwebsites.com/articles/HP-UX/hpuxDynamicallyExtendSlashAndOrStand.php

See the requirements - MirrorDisk, OnlineJFS ...

regards,
ivan
sujit kumar singh
Honored Contributor

Re: To extend root FS in preceding lvols

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