diff options
author | Matt Wilson <msw@redhat.com> | 1999-12-29 15:59:47 +0000 |
---|---|---|
committer | Matt Wilson <msw@redhat.com> | 1999-12-29 15:59:47 +0000 |
commit | 87a1d45e2ce6fc489ea621735f00dbf12c1a2b90 (patch) | |
tree | e2a6f9d4694e84c728c9e8317a69ad23a53beed5 /fstab.py | |
parent | e44eb12840c9a86aeb804f14c09490f57bb607a9 (diff) | |
download | anaconda-87a1d45e2ce6fc489ea621735f00dbf12c1a2b90.tar.gz anaconda-87a1d45e2ce6fc489ea621735f00dbf12c1a2b90.tar.xz anaconda-87a1d45e2ce6fc489ea621735f00dbf12c1a2b90.zip |
various fixes for raid upgrades (which seem to work now)
Diffstat (limited to 'fstab.py')
-rw-r--r-- | fstab.py | 26 |
1 files changed, 24 insertions, 2 deletions
@@ -18,6 +18,7 @@ import isys import iutil import os import string +import raid def _(str): return str @@ -75,7 +76,7 @@ class Fstab: fsystem = "swap" else: fsystem = "ext2" - self.addRaidDevice(mntPoint, raidDev, fsystem, level, devices) + self.addNewRaidDevice(mntPoint, raidDev, fsystem, level, devices) def rescanPartitions(self): if self.ddruid: @@ -181,10 +182,14 @@ class Fstab: os.unlink(file) - def addRaidDevice(self, mountPoint, raidDevice, fileSystem, + def addNewRaidDevice(self, mountPoint, raidDevice, fileSystem, raidLevel, deviceList): self.supplementalRaid.append((mountPoint, raidDevice, fileSystem, raidLevel, deviceList)) + + def addExistingRaidDevice(self, raidDevice, fileSystem, deviceList): + # these are added to the fstab separately!!! + self.existingRaid.append(raidDevice, fileSystem, deviceList) def raidList(self): (devices, raid) = self.ddruid.partitionList() @@ -244,6 +249,8 @@ class Fstab: self.messageWindow(_("Error"), _("Error unmounting %s: %s") % (device, msg)) + for (raidDevice, fileSystem, deviceList) in self.existingRaid: + isys.raidstop(raidDevice) def makeFilesystems(self): # let's make the RAID devices first -- the fstab will then proceed @@ -320,6 +327,9 @@ class Fstab: def mountFilesystems(self, instPath): if (not self.setupFilesystems): return + for (raidDevice, fileSystem, deviceList) in self.existingRaid: + isys.raidstart(raidDevice, deviceList[0]) + for (mntpoint, device, fsystem, doFormat, size) in self.mountList(): if fsystem == "swap": continue @@ -475,6 +485,7 @@ class Fstab: self.messageWindow = messageWindow self.badBlockCheck = 0 self.extraFilesystems = [] + self.existingRaid = [] self.ddruid = self.createDruid() # I intentionally don't initialize this, as all install paths should # initialize this automatically @@ -520,6 +531,13 @@ def readFstab (path, fstab): f = open (path, "r") lines = f.readlines () f.close + + drives = fstab.driveList() + raidList = raid.scanForRaid(drives) + raidByDev = {} + for (mdDev, devList) in raidList: + raidByDev[mdDev] = devList + for line in lines: fields = string.split (line) # skip comments @@ -537,4 +555,8 @@ def readFstab (path, fstab): fields[0][0:8] != "/dev/rd/" and fields[0][0:9] != "/dev/ida/"): continue + if fields[0][0:7] == "/dev/md": + fstab.addExistingRaidDevice(fields[0][5:], fields[1], + raidByDev[mdDev]) + fstab.addMount(fields[0][5:], fields[1], fields[2]) |