[H-GEN] listing ext2/3 (and other) partition volume labels

Tony Nugent tony at linuxworks.com.au
Fri Aug 8 09:14:32 EDT 2003


[ Humbug *General* list - semi-serious discussions about Humbug and     ]
[ Unix-related topics. Posts from non-subscribed addresses will vanish. ]

When ext2 (and ext3) filesystems are created (with mke2fs), they can
be given a volume label tag that can be used by tools such as mount,
/etc/fstab and e2fsck to allow reference to these partitions by a
more "friendly" name, as an alternative to the more technical
/dev/hdXX convention style.

Very often, linux distros use these labels to identify which
directory it is intended to be mounted on.  For example. "/tmp" for
the /tmp partition, "/var/spool" for a partition mounted on that
directory, "/" for the root partition, and so on.

The e2label utility allows you to write new labels to ext2 partitions, so
does tune2fs.  (mlabel for msdos volumes).

But neither seem to be able to _list_ any existing labels (which, to
me, seems a silly omission that is an obviously useful thing).

Are there any (command-line) tools available that will allow you to
list the partition lables on any or all partitions?  (ext2 and ext3,
and also nice to be able to list other partition types that support
volume labels such as vfat etc).

  [ If I had time to dig through the ext2 code and brush up on my C,
    I'd write my own tool to do this, or -better- patch the current
    ones and send to the authors... ]

I have e2fsprogs 1.27 here, perhaps I need to update?  But I'm
reluctant... I have noticed that some of the more recent versions of
mke2fs and friends do things to ext2/3 partitions that older
versions of these tools do not like at all.

Cheers
Tony

--
* This is list (humbug) general handled by majordomo at lists.humbug.org.au .
* Postings to this list are only accepted from subscribed addresses of
* lists 'general' or 'general-post'.  See http://www.humbug.org.au/



More information about the General mailing list