xfs
[Top] [All Lists]

Label support in anaconda

To: katzj@xxxxxxxxxx, <msw@xxxxxxxxxx>
Subject: Label support in anaconda
From: Ajay Ramaswamy <ajayr@xxxxxxxxxxxx>
Date: Tue, 27 Aug 2002 20:56:38 +0530 (IST)
Cc: bugzilla@xxxxxxxxxx, <linux-xfs@xxxxxxxxxxx>
Sender: linux-xfs-bounce@xxxxxxxxxxx
Sir,
In the current anaconda there is support for writing XFS labels but no 
support for reading them, as a consequence in rescue mode fsset.py is not 
able to read the label and automatically mount the filesystems. This code 
snippet will enable reading the XFS label but it will mean that the one 
call to isys.readExt2Label in fsset.py will have to be changed to call a 
wrapper func which will either call readExt2Label or readXFSLabel after 
validating the filesystem by calling isValidXFS(dev) etc...

I know that you hve marked support for XFS as WONTFIX yet since this is 
with a code snippet to explain what needs be done I hope it will be 
considered

#!/usr/bin/python

def readExt2Label(device):
    makeDevInode(device, "/tmp/disk")
    label = _isys.e2fslabel("/tmp/disk");
    os.unlink("/tmp/disk")
    return label

def readXFSLabel(device):
    makeDevInode(device, "/tmp/disk")
    xfslabel = iutil.execWithCapture("/usr/sbin/xfs_db", ["xfs_db", "-r", "-c", 
"label",  "/tmp/disk"])
    label = xfslabel[9:-2]
    os.unlink("/tmp/disk")
    return label

basically I call the xfs_db util to read the label and chop off the 
initial "LABEL=" and the trailing "\r\n"

Thank you

regards
Ajay


<Prev in Thread] Current Thread [Next in Thread>
  • Label support in anaconda, Ajay Ramaswamy <=