Operating System - HP-UX
1834640 Members
3279 Online
110069 Solutions
New Discussion

Re: Extension logical volume /

 
SOLVED
Go to solution
BachPhan
Occasional Advisor

Extension logical volume /

I have one RP7400 server with installed HP-UX ver 11.0. There are two VG (vg00, vg01)that include 4 harddisk (physical volume); each vg inculded 2 harddisk that is mirrored each other. pl see attached file.
Now, I want to extend /dev/vg00/lvol3 but there is not any freespace that spin roundly /dev/vg00/lvol3. u can see detail in the attached file.
Pl help me and let me see the way to do.
14 REPLIES 14
MarkSyder
Honored Contributor

Re: Extension logical volume /

I can't open the attachment, but it's probably not necessary.

The only way to increase the root filesystem is with ignite. If you have no free space, your alternatives would appear to be buying a new disc or decreasing one of the other filesystems.

Mark Syder (like the drink but spelt different)
The triumph of evil requires only that good men do nothing
Marek Smejkal
Frequent Advisor

Re: Extension logical volume /

Hi,

lvol3 is your "/" and is not easy to extend it (only use of ignite). Try to find why it is 98% full, recent bigger files copied to "/" is usual. Otherwise you do not have free space on your vg00 (Free PE = 0) you can only extend your vg00 with two new disks and than extend lvol3.
Marek
Joseph Loo
Honored Contributor

Re: Extension logical volume /

hi,

like what Mark has mentioned, extending / is not possible unless u do a make_tape_recovery (ignite) and recover it with options to extend.

u may like to search for core files or unwanted files in / instead to save u the hassle. another alternative would be to move some directories to other file systems.

regards.
(p.s. please remember to assign points.)
what you do not see does not mean you should not believe
vinod_25
Valued Contributor

Re: Extension logical volume /

hi Bachphan

this is a bit tricky...
still will make a try...analyze this solution first before applying...

first of all the root file system needs to be contigeous and it cannot span across multiple disks, so that the system can be booted in LVM maintenance mode...as per your logs there is no free space in either vgs... need to add a new harddisks for moving /dev/vg00/lvol4 the very next filesystem after / (root)in vg00...

the root filesystem has to be JFS

# fstyp /dev/vg00/lvol3
vxfs

Add a new hdds to vg00 using lvm and mirror it.
first find the disk where the root volume is on
# lvlnboot -v|grep ^Root
Root: lvol3 on: /dev/dsk/c1tXd0

then find the lv that has to be moved to accomodate space to grow root lv
# pvdisplay -v /dev/dsk/c1tXd0|more

...
0066 current /dev/vg00/lvol3 0013
0067 current /dev/vg00/lvol3 0014
0068 current /dev/vg00/lvol3 0015
0069 current /dev/vg00/lvol3 0016
0070 current /dev/vg00/lvol3 0017
0071 current /dev/vg00/lvol3 0018
0072 current /dev/vg00/lvol3 0019
0073 current /dev/vg00/lvol3 0020
0074 current /dev/vg00/lvol4 0000
0075 current /dev/vg00/lvol4 0001
0076 current /dev/vg00/lvol4 0002
0077 current /dev/vg00/lvol4 0003
0078 current /dev/vg00/lvol4 0004
0079 current /dev/vg00/lvol4 0005
0080 current /dev/vg00/lvol4 0006
0081 current /dev/vg00/lvol4 0007
0082 current /dev/vg00/lvol7 0000
0083 current /dev/vg00/lvol7 0001
0084 current /dev/vg00/lvol7 0002
0085 current /dev/vg00/lvol7 0003
0086 current /dev/vg00/lvol7 0004
...

In your case, lvol4 is after lvol3 (root) and it will have to be moved to another disk in vg00 that has been added.(check it , what is after lvol3)

use pvmove to move the lvol4 to the new disk
The command to move lvol4 is:

# pvmove -n /dev/vg00/lvol4 /dev/dsk/c1tXd0 /dev/dsk/c1tYd0

/dev/dsk/c1tXd0 is the disk that lvol4 is moving from and /dev/dsk/c1tYd0 is the disk that it's moving to since it has free space.

Verify that the lvol has been moved and there are free PEs after the root logical volume:

# pvdisplay -v /dev/dsk/c1tXd0|more

...
0066 current /dev/vg00/lvol3 0013
0067 current /dev/vg00/lvol3 0014
0068 current /dev/vg00/lvol3 0015
0069 current /dev/vg00/lvol3 0016
0070 current /dev/vg00/lvol3 0017
0071 current /dev/vg00/lvol3 0018
0072 current /dev/vg00/lvol3 0019
0073 current /dev/vg00/lvol3 0020
0074 free 0000
0075 free 0000
0076 free 0000
0077 free 0000
0078 free 0000
0079 free 0000
0080 free 0000
0081 free 0000
0082 current /dev/vg00/lvol7 0000
0083 current /dev/vg00/lvol7 0001
0084 current /dev/vg00/lvol7 0002
0085 current /dev/vg00/lvol7 0003
0086 current /dev/vg00/lvol7 0004
...

There is free space so the root lvol can be extended.

Important Note: On 11.00 [PHKL_19202/PACHRDME/English] must be loaded or the system will panic.If all of these criteria are not met, this procedure will fail and could leave the system in an unusable state.

lvextend the lvol3 to the free PE size or as reqd....

use fsadm to create filesystem

Good Luck

Vinod K





BachPhan
Occasional Advisor

Re: Extension logical volume /

There are only 4 slot for 4 harddisk, and current full 4 harddisk was installed on the server. So, I cann't install another harddisk. I have only been reducing other logical volume in order to have free space for extension /. Pl help me if u can do it then u will what to do. (u need to read a carefully attached file)
Marek Smejkal
Frequent Advisor

Re: Extension logical volume /

Generaly do not place any other files to "/" than from installation. The best solution for you is find why is 98% full, this will not require system down as other options and is the most easy.
Marek
Mahesh Kumar Malik
Honored Contributor

Re: Extension logical volume /

Hi

1. If you have Online JFS installed, reduce /home size and use the free space to increase / size ONLINE

2. If Online JFS is not available, try moving non system files from / to another file system and create symolic links if required.

3. Another option is to create recovery tape and restore system with modified / size and then restore data

Regards
Mahesh
BachPhan
Occasional Advisor

Re: Extension logical volume /

I had Online JFS installed. I haven't known that 208 MB for logical volume lvol3 / is an enough, isn't it ? Remember that i istalled Oracle database on the HP-UX server. Pl let me see i should have how many capacity for /.
Until now, I still haven't received any step so i can fix that problem. Help me if u are able to fix it.
Devender Khatana
Honored Contributor

Re: Extension logical volume /

Hi,

This is the default size for the / file system selected during install. You have online JFS installed. Your lvol4 followed by lvol3 is 4GB with only 1% used. If this contains no important data & only keeps some user .profiles and all, I would suggest when all users are logged out except you as root, your /home (lvol4) will not be used, if used move root's home directory to / or somewhere else outside /home. You can mount /home on some other path say /home1 & copy all its contents to some other path in some free file system. Once done remove lvol4 & online extend lvol3 to desired size say 1GB or so. Then on the balance space recreate the lvol4 LVOL & file system. Mount it on /home & copy back data onto it. Insure that your /home does is not used during these changes. If your application users do not have their home directories in /home they can still be functioning.

I could also thought of online reducing /home & then online extending / but I am not certain that in reducing it will remove extents from the starting for that file system.

Another option is to reduce LVOL4 to somewhere around 2GB & then recreate a file system of 2GB copy data from LVOL4 to new file system & then remove lvol4 & mount new file system to /home. Now you can extend / as you have 2 gb of free space followed by your /.

But keeping /tmp , /home ,/var & /opt around 4GB & giving 200MB for / is surely a result of poor planning.

HTH,
Devender
Impossible itself mentions "I m possible"
Robert Bennett_3
Respected Contributor
Solution

Re: Extension logical volume /

I just had to come up with a way to do this the other day - and it worked! Check these steps out.

1. bdf - note the lvol that / is mounted on (normally /dev/vg00/lvol3)
note the next mount point that is mounted on the next lvol (ex. /tmp - lvol4)

2. vgdisplay -v vg00 - note the number of lvol's and the physical volumes of vg00.

ex. 8 lvol's

--- Physical volumes ---
PV Name /dev/dsk/c0t5d0
PV Status available
Total PE 2169
Free PE 447
Autoswitch On

PV Name /dev/dsk/c0t8d0
PV Status available
Total PE 2169
Free PE 447
Autoswitch On

3. Remove the mirrors off the second physical volume.

for i in 1 2 3 4 5 6 7 8
do
lvreduce -m 0 /dev/vg00/lvol$i /dev/dsk/c0t8d0
done

4. Move the next contiguous lvol from primary OS disk to "mirror" disk

pvmove -n /dev/vg00/lvol4 /dev/dsk/c0t5d0 /dev/dsk/c0t8d0

5. Ensure that you have freed up the logical extents after the / lvol. (ex. lvol3 )

pvdisplay -v /dev/dsk/c0t5d0 | more

01563 current /dev/vg00/lvol3 00020
01564 current /dev/vg00/lvol3 00021
01565 current /dev/vg00/lvol3 00022
01566 current /dev/vg00/lvol3 00023
01567 current /dev/vg00/lvol3 00024
01568 free 00000
01569 free 00000
01570 free 00000
01571 free 00000
01572 free 00000
01573 free 00000
01574 free 00000
01575 free 00000

6. Ensure that the / lvol is strict and contiguous.

lvdisplay /dev/vg00/lvol3

--- Logical volumes ---
LV Name /dev/vg00/lvol3
VG Name /dev/vg00
LV Permission read/write
LV Status available/syncd
Mirror copies 1
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 200
Current LE 50
Allocated PE 110
Stripes 0
Stripe Size (Kbytes) 0
Bad block off
Allocation strict/contiguous
IO Timeout (Seconds) default

7. lvextend the / filesystem to the desired size as needed as long as there are enough free extents available.

lvextend -l 55 /dev/vg00/lvol3
fsadm -F vxfs -b 220M /

8. Move the previously moved lvol back from the mirrored disk to the primary disk.

pvmove -n /dev/vg00/lvol4 /dev/dsk/c0t8d0 /dev/dsk/c0t5d0

9. vgdisplay -v vg00 - ensure that everything is mounted on the primary OS disk and that the mirror disk is empty

--- Physical volumes ---
PV Name /dev/dsk/c0t5d0
PV Status available
Total PE 2169
Free PE 447
Autoswitch On

PV Name /dev/dsk/c0t8d0
PV Status available
Total PE 2169
Free PE 2169
Autoswitch On

10. Mirror all the lvol's back to the mirrored disk.

for i in 1 2 3 4 5 6 7 8
do
lvextend -m 1 /dev/dsk/lvol$i /dev/dsk/c0t8d0
done

11. vgdisplay -v vg00 - ensure that all lvol s are mirrored.

--- Physical volumes ---
PV Name /dev/dsk/c0t5d0
PV Status available
Total PE 2169
Free PE 447
Autoswitch On

PV Name /dev/dsk/c0t8d0
PV Status available
Total PE 2169
Free PE 447
Autoswitch On
"All there is to thinking is seeing something noticeable which makes you see something you weren't noticing which makes you see something that isn't even visible." - Norman Maclean
generic_1
Respected Contributor

Re: Extension logical volume /

/opt/ignite/bin/make_tape_recovery -a /dev/rmt/0mn -I -v -x inc_entire=vg00

Backup your OS using that and reinstall. There are workarounds, but this is the simplist, and the quickest.

Another suggestion is during this change have new/bigger disks avaiable since you do not have more slots, This would be an awesome time to replace those small drives, hint hint.

Be sure and remirror after the rebuild.

Lastly Enjoy your weekend because you just saved the day in only about an Hour :)
Bill Hassell
Honored Contributor

Re: Extension logical volume /

There is NOTHING in / except /etc, /dev and /sbin (and ideally, /root where you moved root's $HOME). So something has been misplaced. It could be a misspelled tape device name or a massive core dump, lots of possibilities. 203 megs is plenty of space since you need only 80-100 megs.

So, DON'T look for big files. Look for misplaced directories. Use the directory usage command (du) like this:

du -kx / | sort -rn | head

and you'll see something like this:

95344 /
48696 /sbin
42832 /etc
26680 /etc/vx
21656 /etc/vx/type
14992 /sbin/fs
10504 /etc/opt
8776 /sbin/fs/vxfs3.5
8616 /etc/vx/type/static
6344 /etc/vx/type/gen
5488 /etc/opt/resmon
5120 /etc/vx/type/raid5
4560 /etc/opt/wbem
4544 /etc/opt/wbem/mof
4008 /etc/vx/static.d
3864 /etc/opt/resmon/lbin

Note that /sbin is the biggest directory in / and that the total usage in / is 95megs. If you see a much larger usage in / (with /sbin second), then / has got major junk in it. There should be *NO* files at all in /, only directories. But because it is the default home for root (yuk!), then root-droppings end up there. Use this command to see large files in /:

ll -d /* | sort -rnk5

Actualy, you can use that command set for any directory to sort by size.

Or, there is some large directory in your list that does not appear in the above example. That's the culprit. Move that directory to where it belongs. Keep / static in size.


Bill Hassell, sysadmin
Devender Khatana
Honored Contributor

Re: Extension logical volume /

Robert,

You are extending a file system & still accomodating it within a disk which do not have any space. Atleat one LVOL would be required to be reduced by atleast the increased size of /.

Also lvol4 is /home which is default as well & not /tmp.


Bill's suggestion is appropriate. It always has nothing much except user file which generally fills it. These I think can be easily moved.
I have around 30 odd server running HPUx and allthough we have allocated around 500MB -1GB for root in all of them but still in all of them the usage of / is only between 80-120MB.

HTH,
Devender
Impossible itself mentions "I m possible"
BachPhan
Occasional Advisor

Re: Extension logical volume /

I did as the following attached file. There is one error while extension /
Let me know how to repair that error.
Now, my server don't mount lvol4(/home) and lvol5 (/opt). I don't know my data in these lvol that will get back or not. Pl help me mount these lvol.
Thanks for any help.