- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- extending swap space in LVM on a Linux RH 9
Operating System - Linux
1820591
Members
2137
Online
109626
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
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
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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
тАО08-19-2003 11:58 AM
тАО08-19-2003 11:58 AM
extending swap space in LVM on a Linux RH 9
Hey all, I created a swap space of 3gig but in fact I need to create lvswap as a 4gig filesystem. Now that my swap space is created as 3gig, how can I increaase it to 4gig without blowing away my system. Any help is greatly appreciated.
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-19-2003 12:44 PM
тАО08-19-2003 12:44 PM
Re: extending swap space in LVM on a Linux RH 9
This depends on how much space you have allocated on your file systems and which file system types you're using.
If you're using ReiserFS, you can reduce other file systems and associated LV's by 1 GB with resize_reiserfs; then, lvextend the swap space. Later, with the server in single-user mode, you can turn off swap, mkswap on the swap LV and swapon -a again.
If you're using ext3 - AFAIK, the standard of RH - then matters become more complicated. You'll need to put the server in single-user mode, as you'll need to:
* umount your ext3 file systems;
* remount them as ext2;
* umount them;
* ext2resize them in order to make space for the swap LV;
* resize and recreate the swap LV as described above;
* tune2fs -j them in order to make them ext3 again.
I don't know whether e2online is available on RH9; it's a bit risky to use it anyway.
HTH
Paulo Fessel
If you're using ReiserFS, you can reduce other file systems and associated LV's by 1 GB with resize_reiserfs; then, lvextend the swap space. Later, with the server in single-user mode, you can turn off swap, mkswap on the swap LV and swapon -a again.
If you're using ext3 - AFAIK, the standard of RH - then matters become more complicated. You'll need to put the server in single-user mode, as you'll need to:
* umount your ext3 file systems;
* remount them as ext2;
* umount them;
* ext2resize them in order to make space for the swap LV;
* resize and recreate the swap LV as described above;
* tune2fs -j them in order to make them ext3 again.
I don't know whether e2online is available on RH9; it's a bit risky to use it anyway.
HTH
Paulo Fessel
L'employ├Г┬й propose, le boss dispose.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-20-2003 12:11 AM
тАО08-20-2003 12:11 AM
Re: extending swap space in LVM on a Linux RH 9
I think you can add some temporary swap files on filesystems where there enough free space. example:
# dd if=/dev/zero of=/tmp/swap-file bs=1M count=1024
# mkswap /tmp/swap-file
# swapon /tmp/swap-file
this creates a 1 GB file in /tmp and mounts it as swap space. You can do this more than once with different files to get more additional swap space.
then you can unmount your lvswap volume (using swapoff), resize the volume and mount it again (with mkswap and swapon).
finally, unmount the swap-file (swapoff /tmp/swap-file) and delete it.
this should work.
P.S.: before umounting the lvswap volume verify that the swap space used can fit into the remaining swap-file. I there is a lot of used swap, this operation could take some time.
ciao
Claudio
# dd if=/dev/zero of=/tmp/swap-file bs=1M count=1024
# mkswap /tmp/swap-file
# swapon /tmp/swap-file
this creates a 1 GB file in /tmp and mounts it as swap space. You can do this more than once with different files to get more additional swap space.
then you can unmount your lvswap volume (using swapoff), resize the volume and mount it again (with mkswap and swapon).
finally, unmount the swap-file (swapoff /tmp/swap-file) and delete it.
this should work.
P.S.: before umounting the lvswap volume verify that the swap space used can fit into the remaining swap-file. I there is a lot of used swap, this operation could take some time.
ciao
Claudio
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Learn About
News and Events
Support
© Copyright 2025 Hewlett Packard Enterprise Development LP