Operating System - HP-UX
1834149 Members
2158 Online
110064 Solutions
New Discussion

Re: Extend Logical Volume

 
SOLVED
Go to solution
John_44
Advisor

Extend Logical Volume

Hi, I have a file system that is close to being full but in the same VG I have an LV that is barely used. I am going to delete the LV that is barely used and then extend the LV that is close to being full onto the reclaimed space. I know very, very little about HP-UX. Is this something I can do through SAM? Are there any downsides to doing it through SAM. Can someone point me in the right direction as far as the commands I should use? Any help would be appreciated. Many thanks in advance.

John
7 REPLIES 7
harry d brown jr
Honored Contributor

Re: Extend Logical Volume


(1) Can you tell us what "filesystem" you are talking about?

(2) do you have online jfs installed?

(3) What OS level are you running?

(4) is your system up-to-date in patches?

live free or die
harry
Live Free or Die
Sridhar Bhaskarla
Honored Contributor
Solution

Re: Extend Logical Volume

Hi John,

Since you are new to HP-UX, i suggest you make sure you have good backup.

vg01 - your volume group
lvol1 - logical volume that is completely full
lvol2 - logical volume that is empty.

1. Stop the app so that it won't access the filesystems.
2. Unmount lvol2.

umount /dev/vg01/lvol2

3. lvremove /dev/vg01/lvol2

This will free up lvol2.

4. Unmount lvol1

umount /dev/vg01/lvol1

5. Now increase lvol1 to + the size of lvol2. new_size = (size of lvol1 + size of lvol2 ) in MB

lvextend -L new_size /dev/vg01/lvol1
extendfs /dev/vg01/lvol1

6. Edit /etc/fstab. Comment out the entry that has lvol2

7. Mount lvol1 back

mount -a

If you have online-jfs, you can do it online. In that case you dn't need to unmount lvol1. While it is still mounted do

#lvextend -L new_size /dev/vg01/lvol
#fsadm -b new_size*1024 /mountpoint_of_lvol1


-Sri
You may be disappointed if you fail, but you are doomed if you don't try
John_44
Advisor

Re: Extend Logical Volume

(1) Filesystem is vxfs

(2) No online jfs

(3) 10.20

(4) I do not believe this system has had many patches installed since Y2K
Michael Tully
Honored Contributor

Re: Extend Logical Volume

You can use 'sam', or you can use the command line.

# vgdisplay /dev/myvg (substitute your volume group name)
This will tell you how many extents are available.

# lvremove /dev/myvg/mylvol (will remove the logical volume and release the space.

To extend the other filsystem we need to know if you have the on-line JFS product installed.
generally speaking if not, you can unmount the filsystem and do this. You could attempt to do this through 'sam'. If you have the on-line JFS installed, then 'sam' can do this.

# umount /myfs
# lvextend /dev/myvg/mylvol
# extendfs /dev/myvg/rmylvol
# mount /myfs
Anyone for a Mutiny ?
Helen French
Honored Contributor

Re: Extend Logical Volume

You can do these tasks with SAM. There is no downside to do it with SAM. If you are not familiar with command line, SAM will be the best bet for you.
1) Do a good backup of both file systems. Find out which logical volumes holds these file systems.
2) Unmount both file systems:
# umount /fs1
# umount /fs2
3) Execute SAM and select "disk and file systems"
4) Select logical volumes. Select the one which you want to remove and remove it.
5) Select the logical volume you want to extend and then choose extend from Actions menu.
6) Input the NEW FS size while prompted and select to extend it.
7) Exit from SAM and mount the FS back:
# mount /dev/vg_name/lv_name /fs2
# rmdir /fs1
# bdf
Life is a promise, fulfill it!
Ian Kidd_1
Trusted Contributor

Re: Extend Logical Volume

John,

the only question now if whether or not you're trying to extend a contiguous mount point. which mount point is the logical volume mounted? You stated that you are new to HP-UX, so to determine if the logical volume is contiguous or not use sfu lvdisplay -v /dev/vg00/lvol1 | grep -i allocation

does the output have the word contiguous in it?
If at first you don't succeed, go to the ITRC
Ian Kidd_1
Trusted Contributor

Re: Extend Logical Volume

John, ignore the sfu in front of
lvdisplay -v /dev/vg00/lvol1 | grep -i allocation

sfu is a product that allows the issuance of commands as root. you probably don't have it, so issue the command above ...

... or just let us know what mount point your're dealing with.
If at first you don't succeed, go to the ITRC