- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Extending secondary swap
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2008 08:06 AM
01-21-2008 08:06 AM
# swapinfo -atm
Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 1504 0 1504 0% 0 - 1 /dev/vg00/lvol2
dev 16384 0 16384 0% 0 - 1 /dev/vg00/lvswap2
reserve - 17861 -17861
memory 24563 11263 13300 46%
total 42451 29124 13327 69% - 0 -
I'm trying to extend secondary swap space by 8 GB (we recently added more memory to this server and I want swap space to equal physical memory - which is now 24 GB).
I issued the following command to extend the logical volume used for secondary swap space:
#lvextend -L 24576 /dev/vg00/lvswap2
I issued the swapon -a command hoping that would update the swapinfo but it's still only showing 16 GB of secondary swap instead of 24.
How can I update swapinfo WITHOUT a reboot?
Did I go about this the wrong way?
Should I have instead created another logical volume that was 8 GB in size?
Please offer advice on this issue.
Thank you.
Tom Wolf
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2008 08:13 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2008 08:16 AM
01-21-2008 08:16 AM
Re: Extending secondary swap
Swap space has to be contiguous disk space so you can extend your existing swap if and only if it can be extended contiguously.
Basically, if you have any other LVs defined after the swap lv, you're not going to be able to extend it.
You can generate another swap lv though, assuming you have the disk space.
lvcreate -L ${size} -C y -n swap3 vg00
swapon -p 1 /dev/vg00/swap3
should do the trick.
HTH;
Doug
------
Senior UNIX Admin
O'Leary Computers Inc
linkedin: http://www.linkedin.com/dkoleary
Resume: http://www.olearycomputers.com/resume.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2008 08:25 AM
01-21-2008 08:25 AM
Re: Extending secondary swap
Now I'm trying to reduce the secondary swap space logcal volume back to 16 GB so I can reclaim that space and create another logical volume for secondary swap.
Right now, secondary swap space is 24 GB:
LV Name /dev/vg00/lvswap2
LV Status available/syncd
LV Size (Mbytes) 24576
Current LE 1536
Allocated PE 3072
Used PV 2
When I try reduce it back to 16 GB I get the following message:
# lvreduce -L 16384 /dev/vg00/lvswap2
The Logical Volume is used as a swap device.
Logical volume "/dev/vg00/lvswap2" is not reduced.
Any suggestions on how to reclaim that space without a reboot?
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2008 08:50 AM
01-21-2008 08:50 AM
Re: Extending secondary swap
Although you've extended your swap space illegally your probably not in bad shape as far as corrupting the O/S and causing some immediate major damage. But I'd plan on fixing this problem at the next maintenance window or sooner. Just not now.
The first three logical volumes in vg00, where the O/S resides, are boot, swap and root and are all sequential or contiguous. One address after another will be read in sequential order from address zero in the boot lvole all the way through to the end of the root lvol. But this only occurs on bootup.
So don't reboot until your ready.
I recall having made this mistake years ago and the O/S wasn't affected. But, who knows.
The work around is too reignite the O/S. Which means downtime. You can kill two birds with one stone when you do this by resizing lvol2 swap to something bigger. See the previous response which is correct except for updating /etc/fstab.
But you're not going to follow this now. Just file it away for the future.
Plan this out with pencil and paper so you know your lvol sizes before starting. If its the first time then have the response center guide you through.
Do you have an ignite tape or image? If not, then you'll have to reinstall.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2008 09:36 AM
01-21-2008 09:36 AM
Re: Extending secondary swap
Yes, we do have a recent ignite image of this server.
Knowing that secondary swap has to be contigous space and since /dev/vg00/lvswap2 is physically the last logical volume in volume group vg00, I'm guessing the next reboot should safely extend secondary swap.
The current logical volume and physical extent layout of vg00 is as follows:
/dev/vg00/lvol1 using phyical extent 00000 through 00031
/dev/vg00/lvol2 using physical extent 00032 through 00125
/dev/vg00/lvol3 using physical extent 00126 through 00189
/dev/vg00/lvol4 using physical extent 00190 through 00627
/dev/vg00/lvol5 using physical extent 00628 through 00690
/dev/vg00/lvol6 using physical extent 00691 through 01190
/dev/vg00/lvol7 using physical extent 01191 through 01565
/dev/vg00/lvswap2 using physical extent 01566 through 03101
Correct me if I'm wrong, but shouldn't the next reboot resize secondary swap space /dev/vg00/lvswap2 to the 24 GB I increased it to with the lvextend command?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2008 09:49 AM
01-21-2008 09:49 AM
Re: Extending secondary swap
But your still missing the point, you've made swap a random accessed lvol now instead of a sequential contiguous lvol. So when you read your pvdisplay report it will show the last PEs belonging to swap. And they shouldn't be there. All the swap PEs should be around the 200 to 300 range, with boot being 0 to 199 and root being 301 to something like 500. While those new PE will be at the end with addresses something like 5000 to 5050.
Further more with vg00 active I don't think you'll be able to intervene with an lvreduce or a vgcfgrestore. Check for the date on the vg00 map file though to see if it was updated. It should have been.
Regardless, with vgcfgrestore, I don't think it will work since the map file will have been updated.
Again, ignite is your only option here.
And don't reboot til your ready to reignite the whole boot disk.
I suppose you can try to see what happens before re-igniting. Just make sure that your ready before you do.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2008 05:50 AM
01-22-2008 05:50 AM