From mboxrd@z Thu Jan 1 00:00:00 1970 From: Loiseleur Michel Subject: Hacking linux-utils for swap label Date: Thu, 13 Apr 2006 11:00:45 +0200 Message-ID: <443E133D.8070209@linagora.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from whisky.linagora.com ([62.23.27.55]:446 "EHLO whisky.linagora.com") by vger.kernel.org with ESMTP id S1751219AbWDMJAx (ORCPT ); Thu, 13 Apr 2006 05:00:53 -0400 Received: from localhost (unknown [127.0.0.1]) by whisky.linagora.com (Postfix) with ESMTP id E8A0E989A3D for ; Thu, 13 Apr 2006 09:00:51 +0000 (UTC) Received: from whisky.linagora.com ([127.0.0.1]) by localhost (whisky [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 23222-06 for ; Thu, 13 Apr 2006 11:00:45 +0200 (CEST) Received: from [192.168.0.55] (sgi2.linagora.com [195.68.36.75]) by whisky.linagora.com (Postfix) with ESMTP id 1396A975598 for ; Thu, 13 Apr 2006 11:00:45 +0200 (CEST) To: linux-fsdevel@vger.kernel.org Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org 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, -- Michel Loiseleur