Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

How do we define swap partition on a linux server that has several hard disks? What measure do you think if a linux server crashes then it has the minimum down time? when we don’t use LVM on linux installation?

share|improve this question
    
Given that you almost never want your servers to actually use swap all that much, maybe you should skip the swap partition completely and set up a swap file. –  Zoredache Jul 27 '10 at 16:53

2 Answers 2

I don't understand the second question.

To answer the first: You can create a RAID and define the swap as that RAID device. RAID 1 is probably the best type for swap partitions; RAID 5 is unncessary and RAID 0 doesn't give protection.

Creating a RAID array during install is pretty easy in Debian/Ubuntu. Check out the documenation if you need it at https://help.ubuntu.com/10.04/serverguide/C/index.html.

share|improve this answer
    
Why would you care about protecting data in a swap file? Do you also take care to ensure you don't lose data in (actual) RAM? –  Matt Jul 27 '10 at 16:37
    
I'm not an expert on how fault-tolerant RAM is, but I assume if suddenly a gigabyte of RAM memory got 'deallocated', some programs would crash, if not the OS. Am I wrong? –  Luke has no name Jul 27 '10 at 17:49
    
if some RAM disappears, you can expect a kernel crash, but that's not what usually happens with faulty RAM. If some swap disappears, the kernel should be unaffected, but programs that happen to have a pointer to a page in the swap are likely to die an unrecoverable death (segmentation fault or bus error, I guess). If some RAM fails, programs pointing into it are likely to similarly die; if the kernel happened to be using that RAM, expect a kernel panic or hard lockup. –  Gilles Jul 27 '10 at 20:22
    
@matt.j.alexander: simple, because if you've got something swapped out this stops the program crashing simply because of that. –  Cry Havok Oct 16 '10 at 19:28

You can add as many swap partitions as you like across as many hard disks as you like; just set the partition type to Linux Swap, use mkswap to format it, and use swapon to tell the kernel to use it.

Be sure to add your new swap partitions to /etc/fstab.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.