From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1OUMfL-0000kH-45 for garchives@archives.gentoo.org; Thu, 01 Jul 2010 16:31:07 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 25107E09C0; Thu, 1 Jul 2010 16:30:29 +0000 (UTC) Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by pigeon.gentoo.org (Postfix) with ESMTP id 0A5EAE09C0 for ; Thu, 1 Jul 2010 16:30:29 +0000 (UTC) Received: from compute1.internal (compute1.internal [10.202.2.41]) by gateway1.messagingengine.com (Postfix) with ESMTP id DAA4810B23F for ; Thu, 1 Jul 2010 12:30:28 -0400 (EDT) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute1.internal (MEProxy); Thu, 01 Jul 2010 12:30:28 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=subject:from:to:in-reply-to:references:content-type:date:message-id:mime-version:content-transfer-encoding; s=smtpout; bh=6CwOe4yemJhcolAoBvT2UVvpcfE=; b=t1+UxbMYtNcoZz3rcUdSuNC5m+Mr4mQ0Slhg1a67sj0fJ0drjmmEXMfo88OjAkeMy9/QQvHcdWBUtxa74eQyBw5xzqop/GUlkBXNAYLuvrGFZqnsks7TgLsV0uLj+6nGkEiNjsiEres5vsq5fckxGs3V6QJf71MjTimtHRH+xSM= X-Sasl-enc: swmdfEC3aj2xNZZY7kSKL8HrJw7Fus6CH4iyelrgjJX7 1278001828 Received: from [192.168.0.146] (65.23.112.45.nw.nuvox.net [65.23.112.45]) by www.fastmail.fm (Postfix) with ESMTPSA id 7123058AE1 for ; Thu, 1 Jul 2010 12:30:28 -0400 (EDT) Subject: Re: [gentoo-user] activating swap by udev event From: Albert Hopkins To: gentoo-user@lists.gentoo.org In-Reply-To: <1278000414.11343.10.camel@growl> References: <20100701151624.11bd166f@zaphod.digimed.co.uk> <20100701162653.592b261c@zaphod.digimed.co.uk> <4C2CB906.8030906@gmail.com> <1278000414.11343.10.camel@growl> Content-Type: text/plain; charset="UTF-8" Date: Thu, 01 Jul 2010 12:30:27 -0400 Message-ID: <1278001827.9444.7.camel@paska> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org Mime-Version: 1.0 X-Mailer: Evolution 2.30.2 Content-Transfer-Encoding: 7bit X-Archives-Salt: dcf16c69-e950-4f0b-a4ca-11e0f15c8d6b X-Archives-Hash: 8ff4f5209f9dd2ea6e9a899276a7f4d6 On Thu, 2010-07-01 at 18:06 +0200, Nils Larsson wrote: > tor 2010-07-01 klockan 08:49 -0700 skrev Bill Longman: > > On 07/01/2010 08:44 AM, SpaceCake wrote: > > > So, it solves the first problem, identifiying the device, but how can I > > > tell to udev to use always /dev/sds (for example) for this device? > > You need to have the udev rule or the script that it runs look at > something specific(the swaplabel for instance). > > > > I'm thinking how can I instruct udev to turn off swap when the device is > > > removed, but this is another story :) > > I tried doing exactly what you're doing now awhile ago and this is where > I got stuck, swapoff needs the deivce node(path) to still exist, it > can't disable swap without it. I could never get swapoff to run before > udev removed the device node, so I ended up with the system thinking(or > at least reporting) that it had loads more swap than it actually did. This is a bad thing to do. If you have pages swapped out to the device and you remove the device before putting those pages elsewhere then you have effectively hosed your system. If it doesn't fail immediately then as soon as the kernel tries to swap in those pages and finds out the device it's on can't be accessed then you are in for a world of pain. I guess the deeper question (although entirely rhetorical AFAIC) is why would someone want to swap out to a removable device?