From mboxrd@z Thu Jan 1 00:00:00 1970 From: Loiseleur Michel Subject: Re: Hacking linux-utils for swap label Date: Thu, 13 Apr 2006 15:12:20 +0200 Message-ID: <443E4E34.4000005@linagora.com> References: <443E133D.8070209@linagora.com> <20060413123619.GA3778@rain.homenetwork> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Received: from whisky.linagora.com ([62.23.27.55]:63432 "EHLO whisky.linagora.com") by vger.kernel.org with ESMTP id S964922AbWDMNMc (ORCPT ); Thu, 13 Apr 2006 09:12:32 -0400 To: Evgeniy Dushistov , linux-fsdevel@vger.kernel.org In-Reply-To: <20060413123619.GA3778@rain.homenetwork> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org Evgeniy Dushistov a =E9crit : >On Thu, Apr 13, 2006 at 11:00:45AM +0200, Loiseleur Michel wrote: > =20 > >>Hello everyone, >> >> It's my first time in hacking something so deep in linux, so please= =20 >>don't be too hard on me. It concerns the code packaged in "linux-util= s",=20 >>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=20 >>label name, in order to restore (ie: format) it correctly in a recove= ry=20 >>solution (mondorescue). >> For instance, a call to "e2label" do the job for the ext2/3 kind o= f=20 >>partition. >> But for swap partition, there is _no_ way to get it back. The name= =20 >>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= ,=20 >>named _swaplabel_, which display the list of device, uuid and name of= =20 >>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,=20 >>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, >> >> =20 >> >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=3D in >/etc/fstab, >in spite of name it handles many types of file systems and swap >partitions also. > =20 > Thanks a lot to you. It was ... hum ... not obvious. I can do the job=20 with it. No needs to patch anything ! I can parse in shell script the=20 output of "blkid". kind regards, --=20 Michel - To unsubscribe from this list: send the line "unsubscribe linux-fsdevel= " in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html