Re: swap space in a file?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2006-12-14 at 13:29 +0000, Alan wrote:
> On Thu, 14 Dec 2006 7:26:26 -0500
> Tom Horsley <tomhorsley@xxxxxxxxxxxx> wrote:
> 
> > Are there nice simple foolproof instructions somewhere that would let me add
> > more swap space to my system by using an ordinary file as swap (I don't want to
> > repartition the disk). Seems like the device mapper voodoo might work for
> > this, but my brain is too tiny to figure out how on my own :-).
> 
> dd if=/dev/zero of=/swapfile bs=1M count=whatever
> 
> [Make a file that size, you don't have to make it with dd, thats just the
> quick but arcane command old Unix heads tend to use for it]

Well, yeah, but you do want the swapfile to be contiguous and NOT a
sparse file so you must fill it with _something_.  /dev/zero is a nice
source of zero bytes and dd will write a contiguous, non-sparse file.
So, to create a 1GB swap file:

	dd if=/dev/zero of=/path/to/swap/file bs=1M count=1000

And Bob's your uncle!

> mkswap /swapfile  
> 
> [Mark it as a swap file and set it up]
> 
> Then add /swapfile (or whever you put it) to /etc/fstab
> 
> swapon -a
> 
----------------------------------------------------------------------
- Rick Stevens, Senior Systems Engineer     rstevens@xxxxxxxxxxxxxxx -
- VitalStream, Inc.                       http://www.vitalstream.com -
-                                                                    -
-        Brain:  The organ with which we think that we think.        -
----------------------------------------------------------------------

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux