Operating System - HP-UX
1752793 Members
6220 Online
108789 Solutions
New Discussion юеВ

Re: Remove lvol and assign space to diff lvol

 
SOLVED
Go to solution
OFC_EDM
Respected Contributor

Remove lvol and assign space to diff lvol

Hi,
The system is 11.11 and has Online JFS.
I want to move the space
from /dev/vg01/lvol6 (/USRM) (7500 PE's)
to /dev/vg01/lvol3. (/AM)

Do I simply do
1) umount /USRM
2) lvremove -A -f /dev/vg01/lvol6
3) Remove entry for lvol6 from /etc/fstab
4) lvextend -l 7500 /dev/vg01/lvol3
5) fsadm -F vxfs -b 7500 ?? (is there a conversion here from PE to Sectors??)

Can i do this live without affecting other mountpoints on /dev/vg01?

Also, what can I do to backup configuration in order to restore...and how to restore afterwards.
The Devil is in the detail.
12 REPLIES 12
Torsten.
Acclaimed Contributor

Re: Remove lvol and assign space to diff lvol

Sounds good in general.

2)lvremove -A [y|n] /dev/vg01/lvol6

"-A y" is the default
use "-f" only if needed

4) lvextend -l 7500 /dev/vg01/lvol3

"-l 7500" is the new *total* size - you may adjust this value

If needed, you can re-create the old LVOL. If you don't autobackup the new config, the backup and the current config will be different. But the system preserve a second backup with the previous config y default. see man vgcfgbackup.


Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Kapil Jha
Honored Contributor

Re: Remove lvol and assign space to diff lvol

first of all take backup and vgcfgbackup.(on safer side)
umount /USRM
lvremove -f /dev/vg01/lvol6
edit fstab
lvextend -l 7500 /dev/vg01/lvol3
fsadm -F vxfs -b (7500*PEsize)M /AM

Looks fine....will work.
BR,
Kapil
I am in this small bowl, I wane see the real world......
OFC_EDM
Respected Contributor

Re: Remove lvol and assign space to diff lvol

is the number after the -l option for lvextend the TOTAL number. Or just the amount to increase.

If I'm adding 50 PE's and the lvol is already 50 PEs do i put -l 100 or -l 50.

i think it's -l 100.
The Devil is in the detail.
Patrick Wallek
Honored Contributor
Solution

Re: Remove lvol and assign space to diff lvol

The number after the '-l' (# of extents) or the '-L' (# of MB) in the lvextend command is the TOTAL size.

Using your example (extending a 50 extent LV by 50 for a total of 100 extents) you would do 'lvextend -l 100 /dev/vg??/lvol??'.

For your '/dev/vg01/lvol3' you would need to specify the TOTAL (current # of /dev/vg01/lvol3 extents + the 7500 extents from lvol6).
Torsten.
Acclaimed Contributor

Re: Remove lvol and assign space to diff lvol

As mentioned earlier in this thread, it is the total number, see

http://docs.hp.com/en/B2355-90691/lvextend.1M.html

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
TwoProc
Honored Contributor

Re: Remove lvol and assign space to diff lvol

I'd use the big L "-L" option - that way you don't specify in Meg, but in extents.

So, it would be "-L 100" to specify that the total new size is 100 extents.

The "-l" is to indicated in MB you large you want the new file system to be (not how much bigger, it's not relative, it's a total).

I don't use the "-l" in MB because if, for example, I've got 521 extents remaining to use in a vg, I'll allocate by hard numbers PE, not try to figure out in MB what will use all or part of that number that I'm trying to go for.

Of course, you have to know how many MB your PEs are, to get an idea of what you're allocating - so you've still got to do both.
We are the people our parents warned us about --Jimmy Buffett
Patrick Wallek
Honored Contributor

Re: Remove lvol and assign space to diff lvol

TwoProc -- You actually have that backwards. The '-L' option specifies in MB. The '-l' option specifies in extents.

Have a look at the lvextend man page for confirmation.
Torsten.
Acclaimed Contributor

Re: Remove lvol and assign space to diff lvol

usage:

/usr/sbin/lvextend [-A autobackup] {-l le_number | -L lv_size | -m mirror_copies} lv_path [pv_path ... | pvg_name ...]

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
OFC_EDM
Respected Contributor

Re: Remove lvol and assign space to diff lvol

HELP!!

I successfully removed lvol6 and extended those PE's onto lvol3.

The fsadm command failed. No licensing.

So I went to my test system and the issue duplicates there.

I wanted to try extendfs on my test system.

this happened:
extendfs -F vxfs /kju
vxfs extendfs: /kju wrong file type
cannot open device /kju

The fstab for kju is
/dev/vg01/lvtest1 /kju vxfs delaylog 0 1

BUT I do an fstype on the disk for lvtest1 and get:
/ =>fstyp /dev/dsk/c0t5d0
unknown_fstyp (no matches)

So now I have on my production box and LV with 12500 extents but only 5000 are part of the filesystem. And I cannot extend it with fsadm.

What do I do? I'm stuck. I don't even know if I blow away the whole lvol if I'll be able to recreate it as vxfs...(I'm thinking this because of the failure of fsadm and the unknown value returned from fstyp).

I'm stuck. We only have hardware support and not software support on this system.

The Devil is in the detail.