On Thu, 1 Jul 2010 15:49:08 +0200, SpaceCake wrote:

> I would like to increase the speed of my machine by putting some swap
> on a fast pendrive. It is working manually by starting a script
> 
> swapon -s
> swapon -p -1 /dev/sdb1
> swapoff /dev/sda6
> swapon -p -2 /dev/sda6
> swapon -s
> 
> but, I would like to make it automatic by creating an udev rule, so
> when I plug in that device the swap space is automatically activated
> and the priority is changed.

Create the udev rule in the usual way and add

RUN="/path/to/your/script"

You must use a full path when running a program from a udev rule and the
program should exit quickly as udev blocks while it is running.


-- 
Neil Bothwick

What colour is a chameleon on a mirror?

Attachment: signature.asc
Description: PGP signature

Reply via email to