Gentoo Archives: gentoo-user

From: Neil Bothwick <neil@××××××××××.uk>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] activating swap by udev event
Date: Thu, 01 Jul 2010 14:16:34
Message-Id: 20100701151624.11bd166f@zaphod.digimed.co.uk
In Reply to: [gentoo-user] activating swap by udev event by SpaceCake
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?

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-user] activating swap by udev event SpaceCake <spacecakex@×××××.com>