From: Eric Sandeen <sandeen@sandeen.net>
To: Peter Gervai <grinapo@gmail.com>
Cc: xfs@oss.sgi.com
Subject: Re: how to sync / commit data to disk?
Date: Tue, 23 Jan 2007 10:08:22 -0600 [thread overview]
Message-ID: <45B632F6.50705@sandeen.net> (raw)
In-Reply-To: <d55656c10701230716x1ae7cf49kd8a854fd73429c4f@mail.gmail.com>
Peter Gervai wrote:
> Hello,
>
> [Tried to search archieves, found nothing, probably my keywords are bad. :-)]
>
> What is the recommended way to make sure that a file is written
> physically to the disk? (apart from the cache of the disk.)
>
> This problem seem to have arisen in grub bootloader under Debian linux
> (and most probably everywhere else): it must be sure that the copied
> files are there, and can be addressed by C/H/S and modified there, at
> the given sector address.
>
> My educated guess would be
> xfs_freeze -f
> sync
> xfs_freeze -u
That's one hack that has been proposed, and may help.
Another issue that I've seen with grub is that it seems to like to write
directly to the block device WHILE THE FILESYSTEM IS MOUNTED.
This is very bad, and causes ext3 grief too.
grub seems to think that it can just call "sync" and have everything be
happy, but esp. when it's doing reads & writes via both block dev &
filesystem, stuff is so out of whack syncs won't save you.
I'm not sure how you're invoking grub, but we found that manually
specifying --stage2, i.e.
install --stage2=/boot/grub/stage2 ...
at least caused it to leave the block device alone while the fs is
mounted, rather than trying to write the underlying bdev... that was
obvious, no? ;-) You could verify this by stracing your grub command,
and see what it is doing with the block device.
-Eric
next prev parent reply other threads:[~2007-01-23 16:09 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-23 15:16 how to sync / commit data to disk? Peter Gervai
2007-01-23 15:58 ` Geir A. Myrestrand
2007-01-23 16:08 ` Eric Sandeen [this message]
2007-01-23 20:33 ` Peter Gervai
2007-01-23 21:43 ` Eric Sandeen
2007-01-24 6:21 ` Chris Wedgwood
2007-01-23 16:50 ` Chris Wedgwood
2007-01-23 22:24 ` Nathan Scott
2007-01-23 22:58 ` Chris Wedgwood
2007-01-23 16:58 ` Iustin Pop
-- strict thread matches above, loose matches on Subject: below --
2007-01-24 16:28 James Pearson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=45B632F6.50705@sandeen.net \
--to=sandeen@sandeen.net \
--cc=grinapo@gmail.com \
--cc=xfs@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox