Exemplo n.º 1
0
    def doMigrate(self, intf=None):
        if not self.exists:
            raise FSError("filesystem has not been created")

        if not self.migratable or not self.migrate:
            return

        if not os.path.exists(self.device):
            raise FSError("device does not exist")

        # if journal already exists skip
        if isys.ext2HasJournal(self.device):
            log.info("Skipping migration of %s, has a journal already." %
                     self.device)
            return

        argv = self._defaultMigrateOptions[:]
        argv.append(self.device)
        try:
            rc = iutil.execWithRedirect(self.migratefsProg,
                                        argv,
                                        stdout="/dev/tty5",
                                        stderr="/dev/tty5")
        except Exception as e:
            raise FSMigrateError("filesystem migration failed: %s" % e,
                                 self.device)

        if rc:
            raise FSMigrateError("filesystem migration failed: %s" % rc,
                                 self.device)

        # the other option is to actually replace this instance with an
        # instance of the new filesystem type.
        self._type = self.migrationTarget
Exemplo n.º 2
0
    def doMigrate(self, intf=None):
        # if journal already exists skip
        if isys.ext2HasJournal(self.device):
            log.info("Skipping migration of %s, has a journal already."
                     % self.device)
            return

        FS.doMigrate(self, intf=intf)
Exemplo n.º 3
0
    def doMigrate(self, intf=None):
        # if journal already exists skip
        if isys.ext2HasJournal(self.device):
            log.info("Skipping migration of %s, has a journal already." %
                     self.device)
            return

        FS.doMigrate(self, intf=intf)
        self.tuneFS()
Exemplo n.º 4
0
    def tuneFS(self):
        if not isys.ext2HasJournal(self.device):
            # only do this if there's a journal
            return

        try:
            rc = iutil.execWithRedirect(
                "tune2fs", ["-c0", "-i0", "-ouser_xattr,acl", self.device],
                stdout="/dev/tty5",
                stderr="/dev/tty5")
        except Exception as e:
            log.error("failed to run tune2fs on %s: %s" % (self.device, e))
Exemplo n.º 5
0
    def tuneFS(self):
        if not isys.ext2HasJournal(self.device):
            # only do this if there's a journal
            return

        try:
            rc = iutil.execWithRedirect("tune2fs",
                                        ["-c0", "-i0",
                                         "-ouser_xattr,acl", self.device],
                                        stdout = "/dev/tty5",
                                        stderr = "/dev/tty5")
        except Exception as e:
            log.error("failed to run tune2fs on %s: %s" % (self.device, e))