Operating System - HP-UX
1833875 Members
1464 Online
110063 Solutions
New Discussion

Extend a mounted logical volume

 
SOLVED
Go to solution
Jonathan Caplette_1
Super Advisor

Extend a mounted logical volume

Hi guys,

I want to extend a logical volume that is already mounted, and I know that it can be done without unmounting the filesystem...

How can I do that???

Thanks
Jonathan
18 REPLIES 18
Pete Randall
Outstanding Contributor

Re: Extend a mounted logical volume

Jonathan,

If you have the OnlineJFS product, you can do this without unmounting the FS. Otherwise you need to:

umount /dev/vg00/lvol1

lvextend -L larger_size /dev/vg00/lvol1

extendfs -F hfs /dev/vg00/rlvol1

mount /dev/vg00/lvol1 mount_directory


Pete


Pete
Jeff Schussele
Honored Contributor
Solution

Re: Extend a mounted logical volume

Hi Jonathan,

To do this you must have the OnLine JFS product. Steps as follows:

1)Determine if free space available in the VG - if none, will need to add another disk to the VG with vgextend
2) Extend the LV with
lvextend -L XXXXM /dev/vg_name/lv_name #where XXXX=new size in MB
3)Extend the FS size with fsadm
fsadm -F vxfs -b XXXX /mnt_point #where XXXX equals the new size in sectors

Then check for the new FS size.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Jonathan Caplette_1
Super Advisor

Re: Extend a mounted logical volume

Hi Pete,

here is the result of the "swlist -l fileset | grep -i jfs" command

AdvJournalFS.AJFS-ENG-A-MAN B.11.00 AJFS-ENG-A-MAN
AdvJournalFS.AJFS-JPN-E-MAN B.11.00 AJFS-JPN-E-MAN
AdvJournalFS.AJFS-JPN-S-MAN B.11.00 AJFS-JPN-S-MAN
# JFS 3.3 JFS 3.3 base filesystem
JFS.JFS-BASE-KRN 3.3 JFS 3.3 filesystem commands
JFS.JFS-BASE2-KRN 3.3 JFS 3.3 filesystem kernel libraries - 64 bit
JFS.JFS-ENG-A-MAN 3.3 JFS 3.3 filesystem man pages
JournalFS.JFS-ENG-A-MAN B.11.00 JFS-ENG-A-MAN

Is JFS 3.3 the same thing that Online JFS???
Jonathan Caplette_1
Super Advisor

Re: Extend a mounted logical volume

How do I determine the size in sectors???

I take the SIZE / PE-SIZE???
Jeff Schussele
Honored Contributor

Re: Extend a mounted logical volume

Hi (again),

No, just do a lvdisplay /dev/vg_name_lv_name and use the value of Current LE as the sectors size.

And no, none of those are OnLine JFS - do a
swlist | grep -i online
and if you have it, it will show up then.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Steven E. Protter
Exalted Contributor

Re: Extend a mounted logical volume

You can extend the logical volume withtout unmounting it.

Its the extendfs command that won't work while its mounted. Of course the new space is pretty useless without extending the filesystem.

OnlineJFS provides a different command for extending the filesystem which does work while its mounted.

Without OnlineJFS you are out of luck.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Pete Randall
Outstanding Contributor

Re: Extend a mounted logical volume

Jonathan,

No, you're seeing the Base JFS product. The online product should look like this:

# swlist |grep -i online
B3929CA B.11.11 HP OnLineJFS


Pete


Pete
Todd McDaniel_1
Honored Contributor

Re: Extend a mounted logical volume

If you have disk space in the VG... all you have to do is this... with OnlineJFS.. If not you will have to: pvcreate/vgextend to get the disk in the VG then name it when you do the LVOL extend...

Make sure if you have Mirroring, that you have enough extents for that as well on the mirror disk...

##lvextend -L /dev/vgXX/LVOL ## size in actual MB... or GB


OR


##lvextend -l <4*4096> /dev/vgXX/LVOL ## This size is your Filesystem in 4MB extents which is the default...

THEN DO THIS:

##fsadm -F vxfs -b /mount/point/FS ## the mount point NOT the LVOL here...
Unix, the other white meat.
Francis_12
Trusted Contributor

Re: Extend a mounted logical volume

Hello,


If you have purchased OnlineJFS, you can do the following.


If, let's say i want to extend my existing lvtest (mounted on /test) of 300M to 500M.


Extending the 'container' first (LVM) :


# lvextend -L 500 /dev/vg00/lvtest
Warning: rounding up logical volume size to extent boundary at size "504" MB.

Logical volume "/dev/vg00/lvtest" has been successfully extended.

Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.con
f


Take note that LVM has rounded the size to 504Mo (due to the PE = 4Mo unit).


Extending now the 'content' (vxfs/jfs) you can use :


# fsadm -F vxfs -b 504M /test
vxfs fsadm: /dev/vg00/rlvtest is currently 311296 sectors - size will be increas
ed


Or you can use :


# fsadm -F vxfs -b $((504*1024)) /test
vxfs fsadm: /dev/vg00/rlvtest is currently 311296 sectors - size will be increas


# bdf /test
Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvtest 516096 1229 482695 0% /test


Hope this helps, Bye.

Francis DERDEYN - HP-UX ASCE.
Jonathan Caplette_1
Super Advisor

Re: Extend a mounted logical volume

Guys,

I've look on my system, and I've got the OnlineJFS product "swlist | grep -i online". And I've installed it with a HP CodeWord.

But when I run "fsadm" command I got this error:

fsadm: You don't have a license to run this program

I register it with a Codeword....
Any idea?
Todd McDaniel_1
Honored Contributor

Re: Extend a mounted logical volume

There is a series of commands that start with vx*...

# vxlicense -p ## Shows the current licenses...

vrts:vxlicense: INFO: Feature name: HP_OnlineJFS [50]
vrts:vxlicense: INFO: Number of licenses: 1 (non-floating)
vrts:vxlicense: INFO: Expiration date: Sun Jun 24 03:00:00 2007 (1342.5 days fro
m now)
vrts:vxlicense: INFO: Release Level: 22
vrts:vxlicense: INFO: Machine Class: All
vrts:vxlicense: INFO: Site ID: 0



This should help you...

/sbin/fs/vxfs/vxenablef -a ## to activate a JFS license
Unix, the other white meat.
Jonathan Caplette_1
Super Advisor

Re: Extend a mounted logical volume

When I run "vxlicense -p" I got this:

vrts:vxlicense: INFO: No valid license installed

Where can I get a license??
Todd McDaniel_1
Honored Contributor

Re: Extend a mounted logical volume

/sbin/fs/vxfs/vxenablef -a

## to activate a JFS license. this should work.
Unix, the other white meat.
Jonathan Caplette_1
Super Advisor

Re: Extend a mounted logical volume

Todd hi,

It still gives me the same message... :S
Uday_S_Ankolekar
Honored Contributor

Re: Extend a mounted logical volume

You should get license for this product from HP. Add license vxenablef -a command ( this executable file should be in /sbin/fs/vxfs3.3)

and then exenablef -a to enable license.
look this website http://licensing.hp.com to get more information

-USA..
Good Luck..
Todd McDaniel_1
Honored Contributor

Re: Extend a mounted logical volume

Which command are you running? vxlicense or vxenablef?

vxenablef should work quoting the manpage:

"If you have valid licenses" for these features, vxenablef makes them available without rebuilding a new kernel and rebooting the system.


It sounds like you need to load the license for the advanced features...I think you said you lost your codeword? Im not sure it can be recovered...

May have to reload to reset it, but im not totally sure on that.

IF you have HPUX OS 11.11 loaded, it can be reloaded with NOREBOOT... However, if you have 11.0, it requires a reboot.

Unix, the other white meat.
system administrator_15
Frequent Advisor

Re: Extend a mounted logical volume

Jonathan you need to aquire the license from hp licensing, untill you do it will not work.
try this
/sbin/fs/vxfs3.3/vxenablef
=> should say that it's not licensed

/sbin/fs/vxfs3.3/vxlicense -c
=> and then enter the license ( if not already done )

/sbin/fs/vxfs3.3/vxenablef -a
=> to enable the license

/sbin/fs/vxfs3.3/vxenablef
=> Now, it should be enabled.
obviosly you need to get the license before doing stage two, but stage one will tell you if its been licensed and if so you probably only need to activate (stage 3)
if not licenses get licenses from
http://licensing.hp.com
hope this helps
Jonathan Caplette_1
Super Advisor

Re: Extend a mounted logical volume

Guys,

I finally solved my problem, I ordered a license from HP licensing, I installed it with

vxlicense -c

then I've activated it with

vxenablef -a

then I extended my logical volume:

lvextend -L xxxxM /dev/vg00/lvname

and finally I've been able to use fsadm:

fsadm -F vxfs -b xxxxM /fsname

It worked perfectly...
Thanks you all!!
ciao!
Jonathan