using swap files - where do I activate at boot?
I inherited a Debian system running potato. The system occassionaly was running out of memory so I thought I should increase my virtual memory. Rather than repartitioning the hard drive to add another swap partition, I thought it would be best to just use a swap file. So, I've created the file with dd, made it a swap file with mkswap, and activated it with swapon, and it's working fine. My question is, what is the best way to activate the swap file at boot time? Thanks, Gerry
Re: using swap files - where do I activate at boot?
*- On 28 Dec, [EMAIL PROTECTED] wrote about using swap files - where do I activate at boot? I inherited a Debian system running potato. The system occassionaly was running out of memory so I thought I should increase my virtual memory. Rather than repartitioning the hard drive to add another swap partition, I thought it would be best to just use a swap file. So, I've created the file with dd, made it a swap file with mkswap, and activated it with swapon, and it's working fine. My question is, what is the best way to activate the swap file at boot time? Just add it to your /etc/fstab. /path/to/swapfile none sw It will get added to the swap at boot with the rest of the swap space. I would recommend giving your swap partitions/files different priorities in this case so that the faster partitions are higher priority and the swap files are lower priority. See swapon(2) for more details. /dev/of/swap/partition none sw,pri=1 /path/to/swapfilenone sw,pri=0 HTH, Brian Servis -- Mechanical Engineering | Never criticize anybody until you Purdue University | have walked a mile in their shoes, [EMAIL PROTECTED] | because by that time you will be a http://www.ecn.purdue.edu/~servis | mile away and have their shoes.
Re: using swap files - where do I activate at boot?
Brian Servis said: It will get added to the swap at boot with the rest of the swap space. I would recommend giving your swap partitions/files different priorities in this case so that the faster partitions are higher priority and the swap files are lower priority. See swapon(2) for more details. /dev/of/swap/partition none sw,pri=1 /path/to/swapfilenone sw,pri=0 The behaviour I've observed is that if no swap priorities are specified, they'll be done sequentially, with the first listed swap fs being given a priority of -1, the second is assigned -2, etc. Previous suggestions I've seen were that you should manually override the priorities to make them equal, in which case the kernel will give each page to the swap fs that it expects to get the fastest response from. Other reading suggests that with equal priority, pages are assigned round-robin. What really happens and what's the best way to handle swap priorities when dealing with swap devices of comparable performance (e.g., swap partitions on two different hard drives)? -- Geek Code 3.1: GCS d- s+: a- C++ UL++$ P L++ E- W--(++) N+ o+ !K w---$ O M- !V PS+ PE Y+ PGP t 5++ X+ R++ tv- b++ DI D G e* h+ r++ y+