adding swap partition

Rick Stevens rstevens at vitalstream.com
Fri Jun 11 17:04:04 UTC 2004


Chiu, PCM (Peter) wrote:
> Dear Rick,
> 
> 
>>which will cause the file to be used automatically at your next boot. Also
> 
> note that the maximum size of a single >>swap partition or file is 2GB, but
> you can have up to 8 of those (16GB total swap).
> 
> How do you determine the limits on the maximum swap file or partitions and
> their total number?

Both are built into the kernel source and are mentioned in the kernel
docs.  The 2GB limit on an individual swap partition or file is based on
the fact that a signed 32-bit integer is used to index into the swap
(2^31 = 2GB).  This is also the cause of the 2GB file size limit with
older programs (ones which don't use an "off_t" for the index variable).

The number of swap partitions or files is also documented.  I don't have
a good answer as to why it's only 8, but 8 it is.

> -----Original Message-----
> From: redhat-install-list-bounces at redhat.com
> [mailto:redhat-install-list-bounces at redhat.com] On Behalf Of Rick Stevens
> Sent: 10 June 2004 19:53
> To: invincible invincible invincible; Getting started with Red Hat Linux
> Subject: Re: adding swap partition
> 
> 
> invincible invincible invincible wrote:
> 
>>  
>>hello all
>>
>>i have installed red hat linux 9.0 but at the time 0f partitioning it 
>>was  giving me error at the time of creating swap partition. so i 
>>installed linux without it and the systems is kind of behaving quite 
>>slow. is there a way to add swap partition after we have installed 
>>linux. waiting for ur reply.
> 
> 
> You can create an empty file of the size you want, use "mkswap" on the file
> to convert it to swap format, then enable it using the swapon command.
> 
> For example, to create a 512MB swap file, find a filesystem that has 512MB
> free (use the "df -h" command).  Let's assume that's on your /var
> filesystem.  As root:
> 
> 	# dd if=/dev/null of=/var/swapfile bs=1M bc=512
> 	# mkswap /var/swapfile
> 	# swapon /var/swapfile
> 
> You can then edit your /etc/fstab file and add a line like:
> 
> 	/var/swapfile    swap          swap    defaults        0 0
> 
> which will cause the file to be used automatically at your next boot. Also
> note that the maximum size of a single swap partition or file is 2GB, but
> you can have up to 8 of those (16GB total swap).
> 
> If you have unassigned space on your hard drive, you can create a swap
> _partition_ and use it.  I don't know what kind of error you got, but the
> most common one in disk druid is trying to specify a mountpoint for a
> partition with the "swap" filesystem type.  I'd sure like to know what you
> did and what error you got.
> ----------------------------------------------------------------------
> - Rick Stevens, Senior Systems Engineer     rstevens at vitalstream.com -
> - VitalStream, Inc.                       http://www.vitalstream.com -
> -                                                                    -
> -    If your broker is so damned smart...why is he still working?    -
> ----------------------------------------------------------------------
> 
> 
> _______________________________________________
> Redhat-install-list mailing list
> Redhat-install-list at redhat.com
> https://www.redhat.com/mailman/listinfo/redhat-install-list
> To Unsubscribe Go To ABOVE URL or send a message to:
> redhat-install-list-request at redhat.com
> Subject: unsubscribe
> 
> 
> _______________________________________________
> Redhat-install-list mailing list
> Redhat-install-list at redhat.com
> https://www.redhat.com/mailman/listinfo/redhat-install-list
> To Unsubscribe Go To ABOVE URL or send a message to:
> redhat-install-list-request at redhat.com
> Subject: unsubscribe
> 


-- 
----------------------------------------------------------------------
- Rick Stevens, Senior Systems Engineer     rstevens at vitalstream.com -
- VitalStream, Inc.                       http://www.vitalstream.com -
-                                                                    -
-                 IGNORE that man behind the keyboard!               -
-                                                - The Wizard of OS  -
----------------------------------------------------------------------





More information about the Redhat-install-list mailing list