getting UUID and label of a filesystem
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Perhaps this is obvious, but I cannot find a way to print out the UUID or the label of a mounted reiser filesystem, in a manner similar to xfs_admin.
Best way to do this?
On a mounted filesystem?
As non-root user?
Thanks!
~ - boyd
Boyd Waters
http://www.aoc.nrao.edu/~bwaters
National Radio Astronomy Observatory
Socorro, New Mexico
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQE/qrMw0is8k1r0QeURAhekAJ9N7Q7USe7Hull5ydP99vdS/uYO2gCgrj0v v5MuJNmUlLEJyYWUaVjqn2M=
=J7uc
-----END PGP SIGNATURE-----
Quoted 8 lines · Boyd Waters
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1Perhaps this is obvious, but I cannot find a way to print out the UUID or the label of a mounted reiser filesystem, in a manner similar to
xfs_admin.Best way to do this?
debugreiserfs /dev/xxx
Quoted 2 lines
On a mounted filesystem?
Yes.
Quoted 2 lines
As non-root user?
Doubtful
now you talk about label, how to change a label?
Quoted 30 lines · Boyd Waters
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1Perhaps this is obvious, but I cannot find a way to print out the UUID or the label of a mounted reiser filesystem, in a manner similar to
xfs_admin.Best way to do this?
On a mounted filesystem?
As non-root user?
Thanks!
~ - boyd
Boyd Waters
http://www.aoc.nrao.edu/~bwaters
National Radio Astronomy Observatory
Socorro, New Mexico-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.orgiD8DBQE/qrMw0is8k1r0QeURAhekAJ9N7Q7USe7Hull5ydP99vdS/uYO2gCgrj0v v5MuJNmUlLEJyYWUaVjqn2M=
=J7uc
-----END PGP SIGNATURE-----
Signature · 3 lines
Regards, Redeeman () ascii ribbon campaign - against html e-mail /\ - against microsoft attachments
reiserfstune --label <new label> /dev/xxx
That ought to do it ;)
Quoted 33 lines · Redeeman
now you talk about label, how to change a label?
Quoted 30 lines · Boyd Waters
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1Perhaps this is obvious, but I cannot find a way to print out the UUID or the label of a mounted reiser filesystem, in a manner similar to
xfs_admin.Best way to do this?
On a mounted filesystem?
As non-root user?
Thanks!
~ - boyd
Boyd Waters
http://www.aoc.nrao.edu/~bwaters
National Radio Astronomy Observatory
Socorro, New Mexico-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.orgiD8DBQE/qrMw0is8k1r0QeURAhekAJ9N7Q7USe7Hull5ydP99vdS/uYO2gCgrj0v v5MuJNmUlLEJyYWUaVjqn2M=
=J7uc
-----END PGP SIGNATURE-----
Quoted 9 lines · Boyd Waters
Perhaps this is obvious, but I cannot find a way to print out the UUID or the label of a mounted reiser filesystem, in a manner similar to
xfs_admin.Best way to do this?
On a mounted filesystem?
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.
Cheers, Andreas
--
Andreas Dilger
http://sourceforge.net/projects/ext2resize/
http://www-mddsp.enel.ucalgary.ca/People/adilger/
-----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-----
Quoted 26 lines · Boyd Waters
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1Andreas 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"
Quoted 5 lines
So in a script:
#/bin/bash
FS_DEV=/dev/hda1
FS_UUID=/sbin/blkid $FS_DEV | cut -d '"' -f4
Better would be:
FS_UUID=/sbin/blkid $FS_DEV |grep UUID | head -n1| cut -d '"' -f4
That way you don't get multiple lines of output, and don't expect the first line to contain your UUID.
Also the second lines could be used to execute commands if you don't quote the output from the programs.
Mike
Quoted 22 lines · Mike Fedyk
Quoted 21 lines · Boyd Waters
Andreas Dilger wrote:
| 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:
Quoted 7 lines
Quoted 3 lines
#/bin/bash
FS_DEV=/dev/hda1
FS_UUID=/sbin/blkid $FS_DEV | cut -d '"' -f4Better would be:
FS_UUID=
/sbin/blkid $FS_DEV |grep UUID | head -n1| cut -d '"' -f4
Or rather:
PATH=/sbin:$PATH
eval blkid $FSDEV | cut -d: -f2-
and use UUID (TYPE, LABEL) directly (I also hate hard-coding paths in scripts).
Cheers, Andreas
--
Andreas Dilger
http://sourceforge.net/projects/ext2resize/
http://www-mddsp.enel.ucalgary.ca/People/adilger/
Quoted 13 lines · Mike Fedyk
Quoted 7 lines
as non-root user:
$ /sbin/blkid /dev/loop5 /dev/loop5: LABEL="35" UUID="c9923c3f-da67-464f-ad55-6b4da22dabf0"\ TYPE="reiserfs"Quoted 5 lines
So in a script:
#/bin/bash
FS_DEV=/dev/hda1
FS_UUID=/sbin/blkid $FS_DEV | cut -d '"' -f4
Quoted 6 lines
Better would be:
FS_UUID=
/sbin/blkid $FS_DEV |grep UUID | head -n1| cut -d '"' -f4That way you don't get multiple lines of output, and don't expect the first line to contain your UUID.
FS_UUID=$(/sbin/blkid "$FS_DEV" | awk -F'"' '/UUID/{print $4;exit}')
The /UUID/ probably should be $<some number>=="UUID" or $<some number>~/UUID/, but I don't know the column.
$() is now the preferred form and is nestable. This is in the POSIX spec, if your shell doesn't handle this form, your shell is not POSIX compliant.
The use of grep|head|cut pipelines is really poor form
Signature · 2 lines
Chris Dukes I tried being reasonable once--I didn't like it.
I set labels on my ReiserFS filesystems, but I can't use LABEL= in /etc/fstab. I thought that was the point of having filesystem labels. Is there some configuration setting that I'm missing? Thanks,
John
Quoted 44 lines · Brian Tinsley
reiserfstune --label <new label>
/dev/xxxThat ought to do it ;)
Quoted 34 lines · Redeeman
now you talk about label, how to change a label?
Quoted 30 lines · Boyd Waters
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1Perhaps this is obvious, but I cannot find a way to print out the UUID or the label of a mounted reiser filesystem, in a manner similar to
xfs_admin.Best way to do this?
On a mounted filesystem?
As non-root user?
Thanks!
~ - boyd
Boyd Waters
http://www.aoc.nrao.edu/~bwaters
National Radio Astronomy Observatory
Socorro, New Mexico-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.orgiD8DBQE/qrMw0is8k1r0QeURAhekAJ9N7Q7USe7Hull5ydP99vdS/uYO2gCgrj0v v5MuJNmUlLEJyYWUaVjqn2M=
=J7uc
-----END PGP SIGNATURE-----
Quoted 18 lines · Brian Tinsley
Quoted 8 lines · Boyd Waters
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1Perhaps this is obvious, but I cannot find a way to print out the UUID or the label of a mounted reiser filesystem, in a manner similar to
xfs_admin.Best way to do this?
debugreiserfs
/dev/xxx
Quoted 9 lines
Quoted 1 line
On a mounted filesystem?
Yes.
Quoted 1 line
As non-root user?
I've added myself to the "disk" group and it works for me as non-root. You just need read access to the raw device, no? John
Quoted 6 lines
Doubtful
Quoted 2 lines · John Dalbec
I've added myself to the "disk" group and it works for me as non-root. You just need read access to the raw device, no?
Yes.
But how many need access to the UUID information? That can be a big security hole...
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Mike Fedyk wrote:
| On Mon, Nov 10, 2003 at 03:07:40PM -0500, John Dalbec wrote: | |>I've added myself to the "disk" group and it works for me as non-root. You |>just need read access to the raw device, no? | | | Yes. | | But how many need access to the UUID information? That can be a big | security hole...
Cool discussion.
Um, can you point me to info regarding security holes in exposing the UUID of a filesystem? I can't come up with a use-case that would support this statement, but I'm willing to believe there is such.
I am using UUID's to track the source filesystem of a large distributed-backup; I have lots of copies of stuff strewn across various filesystems and I am in the process of pouring it all into a centralized version-control system (Subversion). I can set arbitrary name=value tags on the versioned files, and I'm currently setting one of them to the source filesystem's UUID.
(Later, I'll start another thread which explores how to use ReiserFS features to support Subversion, without an intervening database layer...)
So: What's the security hole in exposing the filesystem UUID?
~ - boyd
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQE/r/ez0is8k1r0QeURAvvjAJsFAKITHuQUcPhdS14/VecHvDL31wCfVEIs 4B+HXCitmX4m3QpVH5I/g7c=
=J0yK
-----END PGP SIGNATURE-----
Quoted 3 lines · John Dalbec
I set labels on my ReiserFS filesystems, but I can't use LABEL= in
/etc/fstab. I thought that was the point of having filesystem labels. Is there some configuration setting that I'm missing?
"mount" has not been updated to use libblkid. I had always intended on doing that, but it was never in the top 10 on my todo list. I had agreement in principle from Andries Brouwer to use a libblkid in mount instead of having a duplicate set of LABEL/UUID parsing code there, but just lacked the time/incentive to do that part.
It would probably benefit all reiserfs users to get this working, so that you can finally mount reiserfs filesystems by LABEL/UUID, so if someone has some time and wants to contribute back to reiserfs this is a fairly easy project (not kernel hacking ;-).
Cheers, Andreas
--
Andreas Dilger
http://sourceforge.net/projects/ext2resize/
http://www-mddsp.enel.ucalgary.ca/People/adilger/
2003-11-10T15:40:19 Boyd Waters:
Quoted 11 lines
Quoted 7 lines · Mike Fedyk
Quoted 2 lines · John Dalbec
I've added myself to the "disk" group and it works for me as non-root. You just need read access to the raw device, no?
Yes.
But how many need access to the UUID information? That can be a big security hole...Um, can you point me to info regarding security holes in exposing the UUID of a filesystem?
Interesting. I read Mike's response to be talking about the security consequences of having lots of users able to read the raw disk device, and thereby bypass any access control mechanisms the filesystem might implement (including even normal Unix file permissions).
-Bennett
Quoted 10 lines · Bennett Todd
2003-11-10T15:40:19 Boyd Waters:Quoted 9 lines
Quoted 7 lines · Mike Fedyk
Quoted 2 lines · John Dalbec
I've added myself to the "disk" group and it works for me as non-root. You just need read access to the raw device, no?
Yes.
But how many need access to the UUID information? That can be a big security hole...
Quoted 8 lines
Quoted 2 lines
Um, can you point me to info regarding security holes in exposing the UUID of a filesystem?
Interesting. I read Mike's response to be talking about the security consequences of having lots of users able to read the raw disk device, and thereby bypass any access control mechanisms the filesystem might implement (including even normal Unix file permissions).
Yes, that's exactly what I meant. Sorry for the non-exact wording.
Mike
Quoted 10 lines · Andreas Dilger
"mount" has not been updated to use libblkid. I had always intended on doing that, but it was never in the top 10 on my todo list. I had agreement in principle from Andries Brouwer to use a libblkid in mount instead of having a duplicate set of LABEL/UUID parsing code there, but just lacked the time/incentive to do that part.
It would probably benefit all reiserfs users to get this working, so that you can finally mount reiserfs filesystems by LABEL/UUID, so if someone has some time and wants to contribute back to reiserfs this is a fairly easy project (not kernel hacking ;-).
Quoted 1 line · Brian Tinsley
I use labels on SuSE with no problem. Could be an incompatibility with your mount command, but I'm not sure.
Has SuSE already updated the mount command to use libblkid then? Or did they insert duplicate LABEL/UUID parsing code for ReiserFS? John
Quoted 12 lines · John Dalbec
Quoted 10 lines · Andreas Dilger
"mount" has not been updated to use libblkid. I had always intended on doing that, but it was never in the top 10 on my todo list. I had agreement in principle from Andries Brouwer to use a libblkid in mount instead of having a duplicate set of LABEL/UUID parsing code there, but just lacked the time/incentive to do that part.
It would probably benefit all reiserfs users to get this working, so that you can finally mount reiserfs filesystems by LABEL/UUID, so if someone has some time and wants to contribute back to reiserfs this is a fairly easy project (not kernel hacking ;-).
Quoted 7 lines
Quoted 2 lines · Brian Tinsley
I use labels on SuSE with no problem. Could be an incompatibility with your mount command, but I'm not sure.
Has SuSE already updated the mount command to use libblkid then? Or did they insert duplicate LABEL/UUID parsing code for ReiserFS?
John
There is a libblkid on my SuSE 9 laptop, but I don't see it on Enterprise Server 8. The mount command on version 9 doesn't appear to be linked to libblkid, so it's probably a safe assumption to say that they modified the mount command on both.