Gentoo Archives: gentoo-user

From: SpaceCake <spacecakex@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] activating swap by udev event
Date: Thu, 01 Jul 2010 16:49:52
Message-Id: AANLkTikuLoYnWRT0qtG-7uMoQv2hP4rsf0oWHQyJ25r6@mail.gmail.com
In Reply to: Re: [gentoo-user] activating swap by udev event by Albert Hopkins
1 This is a shame but the idea coming from Windows world. In Win7/Vista there
2 is a feature called ready boost which I suppose do something similar... or
3 maybe not :) the main goal is to break the bottleneck of the slow HDD, but
4 it is maybe a better idea to put some part of the system on a SDHC card
5 which can reside in my bulting SD slot :) I know, this is also removable :)
6
7 L:
8
9
10 2010/7/1 Albert Hopkins <marduk@×××××××××××.org>
11
12 > On Thu, 2010-07-01 at 18:06 +0200, Nils Larsson wrote:
13 > > tor 2010-07-01 klockan 08:49 -0700 skrev Bill Longman:
14 > > > On 07/01/2010 08:44 AM, SpaceCake wrote:
15 > > > > So, it solves the first problem, identifiying the device, but how can
16 > I
17 > > > > tell to udev to use always /dev/sds (for example) for this device?
18 > >
19 > > You need to have the udev rule or the script that it runs look at
20 > > something specific(the swaplabel for instance).
21 > >
22 > > > > I'm thinking how can I instruct udev to turn off swap when the device
23 > is
24 > > > > removed, but this is another story :)
25 > >
26 > > I tried doing exactly what you're doing now awhile ago and this is where
27 > > I got stuck, swapoff needs the deivce node(path) to still exist, it
28 > > can't disable swap without it. I could never get swapoff to run before
29 > > udev removed the device node, so I ended up with the system thinking(or
30 > > at least reporting) that it had loads more swap than it actually did.
31 >
32 > This is a bad thing to do. If you have pages swapped out to the device
33 > and you remove the device before putting those pages elsewhere then you
34 > have effectively hosed your system. If it doesn't fail immediately then
35 > as soon as the kernel tries to swap in those pages and finds out the
36 > device it's on can't be accessed then you are in for a world of pain.
37 >
38 > I guess the deeper question (although entirely rhetorical AFAIC) is why
39 > would someone want to swap out to a removable device?
40 >
41 >
42 >