On Sun, Sep 16, 2001 at 07:29:33PM -0600, Charles Curley wrote:
> Is there any way in a perl script to translate a disk label
> (e.g. "LABEL=/boot") from the label to a device (e.g. /dev/hda1)? I do
> bare metal restore using tomsrtbt, which apparently does not
> understand labels.
I ended up answering my own question. On RH 7.1, "mount -l" will add
labels where present to the listing, which you can then parse with
perl. To install a file system with a label, "mke2fs -L <label>", and
to change it later "tune2fs -L <label>".
The latest tomsrtbt, 1.7.361, will make the file system with a label,
but its mount does not respect the -l option. That will get me what I
want.
I have not tried Erik Troan's technique (reading /proc/partition). I
think using mount is simpler. Other folks suggested using df and
/etc/mtab. Neither one provided a direct mapping of label to device
file name.
Thank you all.
--
-- C^2
No windows were crashed in the making of this email.
Looking for fine software and/or web pages?
http://w3.trib.com/~ccurley
PGP signature