Skip to content

Commit

Permalink
dumpe2fs: add support for LABEL= and UUID= specifiers for the device
Browse files Browse the repository at this point in the history
The e2mmpstatus man page claims that it will support LABEL= and UUID=
specifiers, and these days e2mmpstatus is implemented in terms of
dumpe2fs.  So teach dumpe2fs to handle these specifiers so we can make
the e2mmpstatus man page be true.

#106

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
  • Loading branch information
tytso committed Dec 5, 2024
1 parent 559b5d2 commit 689b440
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
6 changes: 6 additions & 0 deletions misc/dumpe2fs.8.in
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ prints the super block and blocks group information for the file system
present on
.I device.
.PP
The
.I device
specifier can either be a filename (i.e., /dev/sda1), or a LABEL or UUID
specifier: "\fBLABEL=\fIvolume-label\fR" or "\fBUUID=\fIuuid\fR". (i.e.,
LABEL=home or UUID=e40486c6-84d5-4f2f-b99c-032281799c9d).
.PP
.B Note:
When used with a mounted file system, the printed
information may be old or inconsistent.
Expand Down
8 changes: 7 additions & 1 deletion misc/dumpe2fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ extern int optind;
#include "ext2fs/kernel-jbd.h"
#include <uuid/uuid.h>

#include "support/devname.h"
#include "support/nls-enable.h"
#include "support/plausible.h"
#include "../version.h"
Expand Down Expand Up @@ -673,7 +674,12 @@ int main (int argc, char ** argv)
if (optind != argc - 1)
usage();

device_name = argv[optind++];
device_name = get_devname(NULL, argv[optind++], NULL);
if (!device_name) {
com_err(program_name, 0, _("Unable to resolve '%s'"),
argv[1]);
exit(1);
}
flags = EXT2_FLAG_JOURNAL_DEV_OK | EXT2_FLAG_SOFTSUPP_FEATURES |
EXT2_FLAG_64BITS | EXT2_FLAG_THREADS;
if (force)
Expand Down

0 comments on commit 689b440

Please sign in to comment.