Operating System - HP-UX
1835544 Members
2916 Online
110078 Solutions
New Discussion

Re: Building another volume or partition of space

 
Damian Gardner
Advisor

Building another volume or partition of space

Hello. I need to steal unused space from other volumes(partitions) and use it to build a testing/staging area for my database. I'm not sure how to do that, and don't know if it's safe to adjust volumes while data sits on them. Any help as to the correct steps would be very much appreciated.

Thank you,
Damian
9 REPLIES 9
baiju_3
Esteemed Contributor

Re: Building another volume or partition of space

Hi,

Free space in a VG (can be viewed vy vgdisplay) can be shared only between the LVs under same VG .

If you feel that you have enough free space in a VG , you may considering freeing up PV(disk) by using pvmove command.pvmove command can migrate LE used in that PV to the destination PV which you specify .(Note that the destination PV should be in same VG and should have free PE , check by pvdisplay)

Once al the LE from a PV are migrated then do vgreduce and remove the PV and add the PV to the VG you desire by vgextend.


Thanks,
BL.
Good things Just Got better (Plz,not stolen from advertisement -:) )
Pedro Cirne
Esteemed Contributor

Re: Building another volume or partition of space

Hi,

You can reduce filesystems/lvols on-line, only if you have On-Line JFS installed in your system. Otherwise that's not safe to reduce filesystems/lvols, even if you do it off-line.
The alternative is to make a backup of the filesystem, recreate it with a smaller size and then restore data from backup!

Do you have On-Line JFS installed? You may check using:

swlist -l product|grep -i onlinejfs

Enjoy :)

Pedro
DCE
Honored Contributor

Re: Building another volume or partition of space

Damian,

Any empty PV's in a vg can be reduced with no issue (use pvdisplay -v and lvdisplay -v to verify)

If you have on line JFS you should be able to reduce existing lvols in size. BE VERY careful nd make sure uou have good backups, because there is possibility of data corruption
Florian Heigl (new acc)
Honored Contributor

Re: Building another volume or partition of space

two things:

1.
I'd like to ask You to not mix productive and test data on the same volume group (also: disks), while everything might be fine, it's still just asking for trouble; rather get one or two additional 18-36GB disks for the test environment.

2. the procedure will differ depending on how to space You want to recycle is allocated.

The best way would to look for filesystems You no longer need and wipe them completely.

Reducing filesystems is not safe in most cases. it may be safe if You run a very current version of hp-ux, normally it isn't.
(more specifically: newest fsadm, mkfs and lvm patches, filesystem definitely has to be vxfs version 4 or 5 *and* must not be extremely fragmented)

You shouldn't even try it if it's Your database filesystems where You want to gather the space, or at least not without scheduling downtime for a full restore plus the time for problems. (You can risk a bit, but You need to plan for it.)

It's doable, and I'll gladly help You to get what You want, but when You do the math You'll see that new hardware for the test db is a lot cheaper for Your company than You working all night to fix a small unplanned issue.

If it's a private/testing system anyhow:
For my test installs of Oracle/whatever I just use two firewire harddrives which are nfs-exported from a well-performing server.
The performance is far better than that of the (old) scsi hardware I have to use for critical data.
yesterday I stood at the edge. Today I'm one step ahead.
Damian Gardner
Advisor

Re: Building another volume or partition of space

Hmm - I think I might take the suggestion to add extra disks to the system then. I can't risk the current file system - not worth it. I didn't know if it was involved or risky.

Thanks for all your suggestions, and I'll let you know when we get some new disks in there.

Thanks!
Damian
generic_1
Respected Contributor

Re: Building another volume or partition of space

your database performance is gonna suck.

fsadm -b "reduced size in KB" /mountpoint

swlist | grep -i jfs to see of you have online jfs

http://www4.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000067342554

will explain in detail.

Run backups before doing any changes.
Florian Heigl (new acc)
Honored Contributor

Re: Building another volume or partition of space

Jeff - so sharing spindles of production and test databases sucks less? interesting theory.
yesterday I stood at the edge. Today I'm one step ahead.
singvey
Frequent Advisor

Re: Building another volume or partition of space

I think that you must do:

1.backup your data on the large space vg.
2.backup your data on the small space vg.
3.get the unused pv of the large vg.
4.move pv of the large vg.
5.add pv to your current vg.
6.create new lv .
Devender Khatana
Honored Contributor

Re: Building another volume or partition of space

Hi,

Following command will give you total free space available in all the disks. If you can manage with multiple LV's of different sizes rather than one huge LV, I think you can create multiple LVs in the free spaces of different VG's if available.

#pvdisplay -v /dev/dsk/* |grep free |wc -l
This will display only free physical extents.
Apart from this you can also have free disks available as well.

Also post "strings /etc/lvmtab" & "ls -l /dev/dsk/*"

HTH,
Devender
Impossible itself mentions "I m possible"