From mboxrd@z Thu Jan 1 00:00:00 1970 From: Evgeniy Dushistov Subject: Re: Hacking linux-utils for swap label Date: Thu, 13 Apr 2006 16:36:19 +0400 Message-ID: <20060413123619.GA3778@rain.homenetwork> References: <443E133D.8070209@linagora.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mx1.mail.ru ([194.67.23.121]:31554 "EHLO mx1.mail.ru") by vger.kernel.org with ESMTP id S964904AbWDMMfT (ORCPT ); Thu, 13 Apr 2006 08:35:19 -0400 Received: from [212.46.247.78] (port=7295 helo=rain) by mx1.mail.ru with asmtp id 1FU12b-000EcS-00 for linux-fsdevel@vger.kernel.org; Thu, 13 Apr 2006 16:35:18 +0400 To: linux-fsdevel@vger.kernel.org Content-Disposition: inline In-Reply-To: <443E133D.8070209@linagora.com> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Thu, Apr 13, 2006 at 11:00:45AM +0200, Loiseleur Michel wrote: > Hello everyone, > > It's my first time in hacking something so deep in linux, so please > don't be too hard on me. It concerns the code packaged in "linux-utils", > I hope I have found the correct mailing list. > > > Here is the problem : > I need a way in shell script to get back the device name from the > label name, in order to restore (ie: format) it correctly in a recovery > solution (mondorescue). > For instance, a call to "e2label" do the job for the ext2/3 kind of > partition. > But for swap partition, there is _no_ way to get it back. The name > didn't appear in /proc/swaps or /proc/partitions. > > Here is my current hacking: > I have developped myself a small "addon" to swapon/swapoff program, > named _swaplabel_, which display the list of device, uuid and name of > all the partitions. It was really easy, this code is old but so damn cool ! > > Here is the question : > 1) Is this possible to enhance linux-utils in order to do the job ? > 2) What's the better way to correct this : > 2.1) a new program as my "swaplabel" ? > 2.2) a new option to swapon ? (there is already a "-l" in it, > but it does not display the label) > 2.3) a patch to the "-l" option ? > 2.4) a patch to add a colum "label" in /proc/partitions ? > 2.5) an other way I didn't think of ? > > thanks for your help, > kind regards, > May be I don't understand something, but there is http://e2fsprogs.sourceforge.net/ and it contains blkid utility and which used for handle LABEL= in /etc/fstab, in spite of name it handles many types of file systems and swap partitions also. -- /Evgeniy