1 |
On Thu, 1 Jul 2010 15:49:08 +0200, SpaceCake wrote: |
2 |
|
3 |
> I would like to increase the speed of my machine by putting some swap |
4 |
> on a fast pendrive. It is working manually by starting a script |
5 |
> |
6 |
> swapon -s |
7 |
> swapon -p -1 /dev/sdb1 |
8 |
> swapoff /dev/sda6 |
9 |
> swapon -p -2 /dev/sda6 |
10 |
> swapon -s |
11 |
> |
12 |
> but, I would like to make it automatic by creating an udev rule, so |
13 |
> when I plug in that device the swap space is automatically activated |
14 |
> and the priority is changed. |
15 |
|
16 |
Create the udev rule in the usual way and add |
17 |
|
18 |
RUN="/path/to/your/script" |
19 |
|
20 |
You must use a full path when running a program from a udev rule and the |
21 |
program should exit quickly as udev blocks while it is running. |
22 |
|
23 |
|
24 |
-- |
25 |
Neil Bothwick |
26 |
|
27 |
What colour is a chameleon on a mirror? |