From: Boyd Waters <bwaters+moz@nrao.edu>
To: Andreas Dilger <adilger@clusterfs.com>
Cc: reiserfs-list@namesys.com
Subject: Re: getting UUID and label of a filesystem
Date: Mon, 10 Nov 2003 10:22:49 -0700 [thread overview]
Message-ID: <3FAFC969.4080401@nrao.edu> (raw)
In-Reply-To: <20031106140747.Z10197@schatzie.adilger.int>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Andreas Dilger wrote:
|>As non-root user?
|
|
| If you have a recent e2fsprogs (1.33+ I think), you can use "blkid" to
dump
| the UUID/LABEL of most filesystem types (including reiserfs, XFS, JFS,
ext*).
| If run as root it will create a cache of available block devices and
| their UUID/LABEL that non-root users can access even if they can't read
| the block device, so it doesn't need to be suid or anything. You can also
| use it to locate specific devices by LABEL/UUID/TYPE from scripts, etc.
Great!
as non-root user:
$ /sbin/blkid /dev/loop5
/dev/loop5: LABEL="35" UUID="c9923c3f-da67-464f-ad55-6b4da22dabf0"\
TYPE="reiserfs"
So in a script:
#/bin/bash
FS_DEV=/dev/hda1
FS_UUID=`/sbin/blkid $FS_DEV | cut -d '"' -f4`
And this seems to work on non-reiser partitions, as well.
Nice, thanks!
~ - boyd
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQE/r8lp0is8k1r0QeURAis3AJ9eX0nboz9sp+gDQOjKW6WatSntBgCgj1jm
UQKh+2tCqO5EdBLomleG8MA=
=dUTb
-----END PGP SIGNATURE-----
next prev parent reply other threads:[~2003-11-10 17:22 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-11-06 20:46 getting UUID and label of a filesystem Boyd Waters
2003-11-06 20:54 ` Brian Tinsley
2003-11-10 20:07 ` John Dalbec
2003-11-10 20:14 ` Mike Fedyk
2003-11-10 20:40 ` Boyd Waters
2003-11-10 21:05 ` Bennett Todd
2003-11-11 0:12 ` Mike Fedyk
2003-11-06 20:57 ` Redeeman
2003-11-06 21:03 ` Brian Tinsley
2003-11-10 20:01 ` John Dalbec
2003-11-10 20:42 ` Andreas Dilger
2003-11-12 13:35 ` John Dalbec
2003-11-12 15:32 ` Brian Tinsley
2003-11-06 21:07 ` Andreas Dilger
2003-11-10 17:22 ` Boyd Waters [this message]
2003-11-10 18:12 ` Mike Fedyk
2003-11-10 18:44 ` Andreas Dilger
2003-11-10 19:35 ` Chris Dukes
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=3FAFC969.4080401@nrao.edu \
--to=bwaters+moz@nrao.edu \
--cc=adilger@clusterfs.com \
--cc=reiserfs-list@namesys.com \
/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.