Gentoo Archives: gentoo-user

From: Alan McKinnon <alan@××××××××××××××××.za>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Suspend to swap on a diskless host
Date: Thu, 24 May 2007 07:17:20
Message-Id: 200705232056.30985.alan@linuxholdings.co.za
In Reply to: [gentoo-user] Suspend to swap on a diskless host by Dan Farrell
1 On Wednesday 23 May 2007, Dan Farrell wrote:
2 > I know this is a long shot, and not many people run diskless hosts.
3 > I have one with kind of a loud fan that uses a lot of energy - it's a
4 > pentium 4 in a slimline case and it runs pretty hot, so I can't
5 > adjust the fan speed based on temperature, because it seems like
6 > turning the fan off at 70+ degrees C is a bad idea.
7 >
8 > Instead, I'd like to be able to suspend to ram or swap so that the
9 > fans can stop spinning and the cpu can cool down -- all in one fell
10 > swoop! -- but I've had troubles doing so. While working on that, I
11 > was thinking I might have better luck if the kernel was allowed to
12 > restart itself. I would like to set up swsuspend on the machine, but
13 > I'm a little unclear as to how I would do so.
14 >
15 > I know swapon doesn't work on regular files, so to add my swap I need
16 > to first use losetup to set up /dev/loop0 as my swap device. Then
17 > swapon /dev/loop0 works. but how can I enable swap on loop0 before
18 > the initscripts boot (right now I have it done in local.start).
19 > Don't I need to be able to mount the swap as swap right away to
20 > resume from it? Or will it be enought to specify the location? If
21 > not, is there some way to specify loop settings at boot time, on the
22 > kernel command line?
23
24 Your entire post seems half-assed, and I think you need to think it
25 through carefully:
26
27 1. What are you *actually* trying to do? Seems like the fan is loud, so
28 a) replace the fan with a different one that has propellers/bearing
29 that don't make a friggin' noise, or b) clean the thing
30
31 2. It's *diskless* machine. The whole point of swap is to entend virtual
32 memory to include space on disk. If you don't have a physical spinning
33 disk platter, what are you going to swap to? tmpfs?
34
35 3. Who told you you can't swapon to a regular file? 'man swapon' says
36 otherwise
37
38 4. It's a p4 cpu you have. Cpu throttling is what reduces cpu
39 temperatures in that case, and cpufreqd accomplishes that nicely
40
41 5. How *exactly* are you going to resume from a loop device? AFAIK the
42 kernel will unmount such mounts before suspending (but this topic is in
43 a state of flux as per many recent conversations on lkml)
44
45 I think you really need
46
47 emerge cpufreqd
48
49 and configure your kernel with the necessary governors etc
50
51 alan
52
53 --
54 Optimists say the glass is half full,
55 Pessimists say the glass is half empty,
56 Developers say wtf is the glass twice as big as it needs to be?
57
58 Alan McKinnon
59 alan at linuxholdings dot co dot za
60 +27 82, double three seven, one nine three five
61 --
62 gentoo-user@g.o mailing list

Replies

Subject Author
Re: [gentoo-user] Suspend to swap on a diskless host Dan Farrell <dan@×××××××××.cx>