summaryrefslogtreecommitdiffstats
path: root/partedUtils.py
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2004-07-12 19:26:01 +0000
committerJeremy Katz <katzj@redhat.com>2004-07-12 19:26:01 +0000
commit5b39667492a46c19c6de602775ee73ce95449678 (patch)
treef93056f8d2f16a841d945268a92fd6740df2f16c /partedUtils.py
parent5f8d54266faa93f6f787ebe1277be2b1838c006e (diff)
downloadanaconda-5b39667492a46c19c6de602775ee73ce95449678.tar.gz
anaconda-5b39667492a46c19c6de602775ee73ce95449678.tar.xz
anaconda-5b39667492a46c19c6de602775ee73ce95449678.zip
sniff for raid and lvm magic before ext[23]. if you have ext[23] on raid,
then the magic is going to (potentially) be on the component devs. add sniffing for lvm2 magic based on code in the lvm tools
Diffstat (limited to 'partedUtils.py')
-rw-r--r--partedUtils.py27
1 files changed, 17 insertions, 10 deletions
diff --git a/partedUtils.py b/partedUtils.py
index 652790be0..466f69b09 100644
--- a/partedUtils.py
+++ b/partedUtils.py
@@ -398,6 +398,23 @@ def sniffFilesystemType(device):
pass
return None
+ # physical volumes start with HM (see linux/lvm.h
+ # and LVM/ver/tools/lib/pv_copy.c)
+ if buf.startswith("HM"):
+ return "physical volume (LVM)"
+ # sniff for LVM2 label. see LVM/ver/lib/label/label.[ch] for a
+ # description of the label and LVM/ver/lib/format_text/layout.h
+ for sec in range(0, 4):
+ off = (sec * 512) + 24
+ if buf[off:].startswith("LVM2"):
+ return "physical volume (LVM)"
+
+ try:
+ isys.raidsbFromDevice(dev)
+ return "software RAID"
+ except:
+ pass
+
# ext2 check
if struct.unpack("<H", buf[1080:1082]) == (0xef53,):
if isys.ext2HasJournal(dev, makeDevNode = 0):
@@ -405,10 +422,6 @@ def sniffFilesystemType(device):
else:
return "ext2"
- # physical volumes start with HM (see linux/lvm.h
- # and LVM/ver/tools/lib/pv_copy.c)
- if buf.startswith("HM"):
- return "physical volume (LVM)"
# xfs signature
if buf.startswith("XFSB"):
return "xfs"
@@ -417,12 +430,6 @@ def sniffFilesystemType(device):
buf[pagesize - 10:] == "SWAPSPACE2"):
return "swap"
- try:
- isys.raidsbFromDevice(dev)
- return "software RAID"
- except:
- pass
-
if fsset.isValidReiserFS(dev):
return "reiserfs"