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 1OUPmP-0001q1-C4 for garchives@archives.gentoo.org; Thu, 01 Jul 2010 19:50:37 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 4D402E0A0B; Thu, 1 Jul 2010 19:49:33 +0000 (UTC) Received: from mail-ww0-f53.google.com (mail-ww0-f53.google.com [74.125.82.53]) by pigeon.gentoo.org (Postfix) with ESMTP id 0B424E0A0B for ; Thu, 1 Jul 2010 19:49:32 +0000 (UTC) Received: by wwa36 with SMTP id 36so1033088wwa.10 for ; Thu, 01 Jul 2010 12:49:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:date :user-agent:cc:references:in-reply-to:mime-version:content-type :content-transfer-encoding:message-id; bh=GWFKZhXiuWmRmsmPyJ8XH0PjB9TqGVUu4vfjoFYdDVQ=; b=HgYH3zUJlTAJynmNMGNIvKMgYPtCxObrwLhiX91IhH2hglapKL9GxxHKa1VrHpwDAi vQ9T1d2H213XlrTlFoI+rdMuQ65Cuf5ApdXrKFm+U7EpfJTa3HLMryCv8kZDOTvHQ0G0 GLoMyrkohY+IQoP9rtC/5PxbSHM12znizompQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:cc:references:in-reply-to :mime-version:content-type:content-transfer-encoding:message-id; b=OCToIzXv/ZwhkJJKOoynHl/YSXo7a26csUGd1RsoX6xTqMZrmANYVkJ274h2Netuba hRD2NFwPg6QigPa1tX9oOLJsewdu1kk1ovTppZUHvxPdmYvhTdfBK/blAQZZiRiuWUtS NxtbiimmRjEoH85T01weTSPn63/UbcMcbw+RE= Received: by 10.227.72.208 with SMTP id n16mr166784wbj.103.1278013771087; Thu, 01 Jul 2010 12:49:31 -0700 (PDT) Received: from nazgul.localnet (196-210-140-126.dynamic.isadsl.co.za [196.210.140.126]) by mx.google.com with ESMTPS id e31sm1053337wbe.5.2010.07.01.12.49.28 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 01 Jul 2010 12:49:29 -0700 (PDT) From: Alan McKinnon To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] activating swap by udev event Date: Thu, 1 Jul 2010 21:46:15 +0200 User-Agent: KMail/1.13.3 (Linux/2.6.34-ck-r1; KDE/4.4.4; x86_64; ; ) Cc: Nils Larsson References: <4C2CB906.8030906@gmail.com> <1278000414.11343.10.camel@growl> In-Reply-To: <1278000414.11343.10.camel@growl> 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 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201007012146.16265.alan.mckinnon@gmail.com> X-Archives-Salt: 71070e11-9e7a-4673-a5f8-fcc4cbd04eb7 X-Archives-Hash: 565bbfbd3a05e078d2d47cade19d6141 On Thursday 01 July 2010 18:06:54 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. It is blindingly obvious what mistake you are both making. You want to remove the device then disable swap. That will never work in a zillion years for all the good reasons mentioned elsewhere in this thread. You MUST disable swap THEN remove the device. This sequence is inviolate. -- alan dot mckinnon at gmail dot com