tor 2010-07-01 klockan 15:49 +0200 skrev SpaceCake:
> Hi,
> 
> 
> 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. I've tried to google for a solution like
> this, but I did not find. Maybe you already have some script at
> hand :) can you please share this with me?
> 
> Thanks
> Laszlo
> 

I tried doing something like this awhile ago. The problem I encountered
was that I couldn't disable the swap once the the device was removed,
swapoff couldn't find the device path(as it wasn't there anymore) but
the system thought the swap was still there. So plugging and unplugging
the swap stick got my system thinking it had loads of swap.

But I didn't experiment all that much, maybe there's a way. Tricking
udev to hold on to the device node until swap is disabled might be
possible.


Reply via email to