From: Loiseleur Michel <mloiseleur@linagora.com>
To: linux-fsdevel@vger.kernel.org
Subject: Re: Hacking linux-utils for swap label
Date: Thu, 13 Apr 2006 14:34:58 +0200 [thread overview]
Message-ID: <443E4572.9050402@linagora.com> (raw)
In-Reply-To: <20060413121609.GC20839@harddisk-recovery.com>
Erik Mouw a écrit :
>On Thu, Apr 13, 2006 at 11:00:45AM +0200, Loiseleur Michel wrote:
>
>
>>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.
>>
>>
>
>That's because filesystem labels is a userland issue and not at all
>kernel related. It's also how mount label works: the userland program
>"mount" figures out which device contains the requested label and
>passes the correct device to the mount() syscall.
>
>
>
>>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" ?
>>
>>
>
>Yes, but rather name it something like dumpswap, just like dumpe2fs,
>etc.
>
>
This is not exactly what I need. I don't know how to dress the full map
of a swap file/partition, and I don't need it. I just need to retrieve
the link between 'device' and 'label' put in /etc/fstab. After reading
the code in linux-utils package (mount/swapon.c &
mount/get_label_uuid.c), I figured out how to implement it in C. But I
need it in shell script >_<.
The program I want to add is nearer of e2label program (ext2/3
equivalent). That's why I suggested the name "swaplabel", which would be
functionally equivalent to e2label.
>
>
>> 2.2) a new option to swapon ? (there is already a "-l" in it,
>>but it does not display the label)
>>
>>
>
>No, mount also doesn't display labels.
>
>
ok
>
>
>> 2.3) a patch to the "-l" option ?
>> 2.4) a patch to add a colum "label" in /proc/partitions ?
>>
>>
>
>No, cause labels are a userland issue.
>
>
Yes, you're right. I wanted to join linux-utils developers, and it's the
mailing list which seems the good one for me.
Thanks for your advice, erik.
--
Michel Loiseleur
-
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
next prev parent reply other threads:[~2006-04-13 13:09 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-13 9:00 Hacking linux-utils for swap label Loiseleur Michel
2006-04-13 12:16 ` Erik Mouw
2006-04-13 12:34 ` Loiseleur Michel [this message]
2006-04-13 12:36 ` Evgeniy Dushistov
2006-04-13 13:12 ` Loiseleur Michel
2006-04-13 16:37 ` Greg KH
2006-04-13 16:52 ` Theodore Ts'o
2006-04-13 17:10 ` Greg KH
2006-04-13 18:19 ` Theodore Ts'o
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=443E4572.9050402@linagora.com \
--to=mloiseleur@linagora.com \
--cc=linux-fsdevel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.