- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- changing the swap partition size in linux
Operating System - Linux
1822193
Members
3949
Online
109640
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
Forums
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
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
тАО03-06-2007 07:08 PM
тАО03-06-2007 07:08 PM
changing the swap partition size in linux
I installed new memory (RAM) to a machine had RH LINUX OS.In red hat Linux how to change (increase ) the swap partition size or Add a NEW swap partion.What are the commands and steps ?
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-06-2007 07:45 PM
тАО03-06-2007 07:45 PM
Re: changing the swap partition size in linux
Hi,
Make a new partition of Swap type by using fdisk command, and then add an entry into /etc/fstab .
You may get more info from following link:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1091537
Make a new partition of Swap type by using fdisk command, and then add an entry into /etc/fstab .
You may get more info from following link:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1091537
PreSales Specialist
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-06-2007 08:33 PM
тАО03-06-2007 08:33 PM
Re: changing the swap partition size in linux
Hi Laalitha,
Please find the necessary below:
Use fdisk to create the swap partition( command t will ask for swap-id, give 82 for linux swap )and then do
mkswap /dev/hda*
swapon /dev/hda*
The above answer is correct only if there left some free space (i don't think it is!). If your harddisk is fully partitioned you need to find some way to resize(or simply delete) some partition. More easier way is to create swap file:
dd if=/dev/zero of=/swapfile bs=1K count=
mkswap /swapfile
swapon /swapfile
if you don't wish to tell "swapon /swapfile" every time you boot modify your /etc/fstab file and add record similar to created by your setup program (in case of automatic partitioning it usually exists)
Also,I tried creating a swapfile on my machine. I had a swap partition on /dev/hda2. I deleted this partition and added the swapfile entry inside /etc/fstab. I rebooted the machine and I saw this error message on the terminal.
Enabling swap partitions: could not create swap partition /swapfile [ERROR]
In the shell prompt I gave
mkswap /swapfile
swapon /swapfile
and then rebooted again. Then I got
Enabling swap paritions: [OK]
This worked fine for me.
So, I can use my /dev/hda2 partition for other purposes. This will be helpful if there is not enough space to create a swap partition on the disk
Try the above(using the best options) and let me know!!
Please find the necessary below:
Use fdisk to create the swap partition( command t will ask for swap-id, give 82 for linux swap )and then do
mkswap /dev/hda*
swapon /dev/hda*
The above answer is correct only if there left some free space (i don't think it is!). If your harddisk is fully partitioned you need to find some way to resize(or simply delete) some partition. More easier way is to create swap file:
dd if=/dev/zero of=/swapfile bs=1K count=
mkswap /swapfile
swapon /swapfile
if you don't wish to tell "swapon /swapfile" every time you boot modify your /etc/fstab file and add record similar to created by your setup program (in case of automatic partitioning it usually exists)
Also,I tried creating a swapfile on my machine. I had a swap partition on /dev/hda2. I deleted this partition and added the swapfile entry inside /etc/fstab. I rebooted the machine and I saw this error message on the terminal.
Enabling swap partitions: could not create swap partition /swapfile [ERROR]
In the shell prompt I gave
mkswap /swapfile
swapon /swapfile
and then rebooted again. Then I got
Enabling swap paritions: [OK]
This worked fine for me.
So, I can use my /dev/hda2 partition for other purposes. This will be helpful if there is not enough space to create a swap partition on the disk
Try the above(using the best options) and let me know!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-07-2007 06:43 PM
тАО03-07-2007 06:43 PM
Re: changing the swap partition size in linux
If you aren't going to run more applications on your machine, you don't need to add swap at all.
For example: yesterday you had 1GB RAM + 1GB swap = 2GB virtual memory.
today you have 2GB RAM + 1GB swap = 3GB virtual memory.
For example: yesterday you had 1GB RAM + 1GB swap = 2GB virtual memory.
today you have 2GB RAM + 1GB swap = 3GB virtual memory.
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