FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora User

 
 
LinkBack Thread Tools
 
Old 04-01-2011, 08:49 PM
David Lehman
 
Default Add sync method to force data onto disk and/or journal.

This is for xfs bootloader installation issues.

Related: rhbz#117968
---
pyanaconda/storage/formats/fs.py | 26 ++++++++++++++++++++++++++
1 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/pyanaconda/storage/formats/fs.py b/pyanaconda/storage/formats/fs.py
index 5b1b814..83bfdc1 100644
--- a/pyanaconda/storage/formats/fs.py
+++ b/pyanaconda/storage/formats/fs.py
@@ -865,6 +865,9 @@ class FS(DeviceFormat):
return False
return self._mountpoint is not None

+ def sync(self, root="/"):
+ pass
+
def writeKS(self, f):
f.write("%s --fstype=%s" % (self.mountpoint, self.type))

@@ -1263,6 +1266,29 @@ class XFS(FS):
argv.extend([label, self.device])
return argv

+ def sync(self, root='/'):
+ """ Ensure that data we've written is at least in the journal.
+
+ This is a little odd because xfs_freeze will only be
+ available under the install root.
+ """
+ if not self.status or not self._mountpoint.startswith(root):
+ return
+
+ try:
+ iutil.execWithRedirect("xfs_freeze", ["-f", self.mountpoint],
+ stdout="/dev/tty5", stderr="/dev/tty5",
+ root=root)
+ except (RuntimeError, OSError) as e:
+ log.error("failed to run xfs_freeze: %s" % e)
+
+ try:
+ iutil.execWithRedirect("xfs_freeze", ["-u", self.mountpoint],
+ stdout="/dev/tty5", stderr="/dev/tty5",
+ root=root)
+ except (RuntimeError, OSError) as e:
+ log.error("failed to run xfs_freeze: %s" % e)
+
register_device_format(XFS)


--
1.7.3.4

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 10:12 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org