Can a RAM disk replace a swap partition?
Q I'm trying to perform an experiment on my Fedora box, to set up a RAM disk to use as a swap device to replace the swap partition. There seems to be some debate over whether there's any point to this so I thought that I'd set it up and test the performance with a few games of Doom 3. Can someone explain how I might go about this?
A We've been trying to figure out why you would want to do this, but we really have no idea. It's easy enough to build a RAM disk, then install a swap filesystem on the block device. You can make a swap filesystem on the RAM device, assuming it's compiled into the kernel, with:
# mkswap /dev/ram0 # swapoff -a # swapon /dev/ram0
You can monitor the use of the swap device with 'free', and the actual paging with 'vmstat' as you're doing your testing. We'd be very interested to see what results you get from your testing, though, because we don't think that anything exciting is going to happen at all!
Related solutions
- Accidentally made a Vista partition into a swap partition
- What is the best size for the swap partition?
- Restore partition table in Linux after formatting drive
- Disk diagnostics
- Red Hat not detecting SATA hard disk


Copyright 2010 Future Publishing Limited (company
registered number 2008885), a company registered
in England and Wales whose registered office is at
Beauford Court, 30 Monmouth Street, Bath, BA1 2BW, UK