- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: How to add swap size?
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
08-21-2002 07:23 PM
08-21-2002 07:23 PM
I have a Linpus Linux release 6.4 ,
Yesterday I added 512M RAM on the server ,
but I don't know how to add swap size ,
I did some tests but failed ,
(I've crushed 2 test servers.)
I uploaded the testing steps ,
And I know maybe I make mistakes in mkswap or swapon ,
Should somebody help me to add swap size?
Or should I enlarge /dev/hdb1 size?
like :
mkswap -v1 /dev/hdb2 128512
and then :
swapon -v -p -1 /dev/hdb2
Need helps,
Thanks billions!
Violin.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2002 07:40 PM
08-21-2002 07:40 PM
SolutionYou can not "extend" the current swap partition, instead you can create another partion then add it to additional swap.
You can add the swap partition on hda or hdb.
> # mkswap -v0 /dev/hda1 128512
This command will initialize your "live" OS partition to swap partition. That's why you crashed the system.
So what you need is
1) Create new partition
2) reboot the system to make the new partition ready to use from the system.
3) mkswap /dev/hdXXX is just OK.
The default is swap version 1 (new style swap area)
And you don't need to put the size. The partition will be initialized as swap
4) put one line into /etc/fstab
5) swapon -a
Good luck
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2002 07:52 PM
08-21-2002 07:52 PM
Re: How to add swap size?
But if I have no free disk to create partition,
how could I do?
All the disks are created mount point,
But I have enough free space in /u02,
Can you help me? Thanks again.
Violin.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2002 10:01 PM
08-21-2002 10:01 PM
Re: How to add swap size?
If you don't have additional space for new partition, use "swap on filesystem".
Following example is how to create 500mb swap on filesystem.
# dd if=/dev/zero of=swapfile bs=1024k count=500
This command will create 500mb file. Make sure you put "count" otherwise you will make your filesystem full.
# mkswap swapfile
# chmod 0600 swapfile
Edit /etc/fstab
/swapfile swap swap defaults 0 0
# free
# swapon -a
# free (to confirm your system use the new swap)
"dd" will kill your system, if you forget options. Be careful!!
Good luck
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2002 07:29 PM
08-22-2002 07:29 PM
Re: How to add swap size?
If I add more memory , could I use dd again?
like:
dd if=/dev/zero of=swapfile1 bk=1024k count=500
Could I?
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2002 07:54 PM
08-22-2002 07:54 PM
Re: How to add swap size?
Yes, you can create additional "swap on filesystem" and mkswap then enable it.
I am not sure how many swaps you can create in a system, but the max swap partition size is 2gb. so I guess a max-swap-file-size would be the same 2gb.
Regards,