HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- How to create swap space on Linux.
Operating System - Linux
1830226
Members
1592
Online
109999
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
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
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-21-2005 10:41 PM
08-21-2005 10:41 PM
Hi,
Please let us know how to create new swap space on Red Hat Linux AS 2.1 & Red Hat Linux ES 3.0 OS.
Regards
Varian
Please let us know how to create new swap space on Red Hat Linux AS 2.1 & Red Hat Linux ES 3.0 OS.
Regards
Varian
Solved! Go to Solution.
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2005 11:05 PM
08-21-2005 11:05 PM
Solution
If you have free (unpartitioned) space on HD, then create a swap partition using fdisk. Then ,after reboot,
issue a command:
mkswap /dev/part
where part is the partition which you make swap.It can be /dev/hda{number} if it's an IDE drive or /dev/sda{number} if it's SCSI.
If all space is occupied by pertitions and you still wich to have swap:
1.
dd if=/dev/zero of=/swp.file bs=1048576 count=64
This command will create swp.file in root folder with size 64 MB.
Now you have to make it a swap file:
2.mkswap /swp.file
To activate the additional swap:
3. swapon /swp.file
If you want this swap to remain across reboots-add a respective entry to /etc/fstab.
Best regards.
issue a command:
mkswap /dev/part
where part is the partition which you make swap.It can be /dev/hda{number} if it's an IDE drive or /dev/sda{number} if it's SCSI.
If all space is occupied by pertitions and you still wich to have swap:
1.
dd if=/dev/zero of=/swp.file bs=1048576 count=64
This command will create swp.file in root folder with size 64 MB.
Now you have to make it a swap file:
2.mkswap /swp.file
To activate the additional swap:
3. swapon /swp.file
If you want this swap to remain across reboots-add a respective entry to /etc/fstab.
Best regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2005 11:30 PM
08-21-2005 11:30 PM
Re: How to create swap space on Linux.
I believe Alexander gave all required information.
Sample entry in /etc/fstab for swap:
incase a file is used for swap, then:
/path/to/file swap swap defaults 0 0
Remember the file path should be existing at the time of swap activation. i.e. incase you have this swap file on /mnt/disk then when the swap is trying to load the file /mnt/disk should be mounted and accessible. Easy way would be to have this entry as the final entry in /etc/fstab
Hope this helps,
Gopi
Never Never Never Giveup
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
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP