mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* dirty buffers and umount/remount
@ 2002-06-11  7:50 Hua Zhong
  2002-06-11  8:12 ` Hua Zhong
  0 siblings, 1 reply; 2+ messages in thread
From: Hua Zhong @ 2002-06-11  7:50 UTC (permalink / raw)
  To: Linux Kernel Mailing List

Hi all:

I have a question that should be simple to answer.

When building a system I need to make sure that whenever user
wants to save configuration to nonvolatile storage (i.e., disk),
all dirty buffers are flushed to disk. Basically I do the following:

1) mount filesystem X from read-only to read-write.
2) save all configuration files to a directory A on X.
3) do a sync.
4) write a label file in A saying "this marks a successful save of
all the configuration files".
5) remount X as read-only.

The problem is that 3) takes quite long time to finish (even most files
in 2) are opened with O_SYNC).

I am wondering if 3) is necessary or not. When the filesystem is remounted
from rw to ro, are all dirty buffers related to it flushed to disk? How
about
umount?

The last related question: is the kdev field in the buffer head the physical
block device (i.e., /dev/hda) or the logical block device (i.e., /dev/hda7)?

Thanks a lot.

Hua


^ permalink raw reply	[flat|nested] 2+ messages in thread

* RE: dirty buffers and umount/remount
  2002-06-11  7:50 dirty buffers and umount/remount Hua Zhong
@ 2002-06-11  8:12 ` Hua Zhong
  0 siblings, 0 replies; 2+ messages in thread
From: Hua Zhong @ 2002-06-11  8:12 UTC (permalink / raw)
  To: Linux Kernel Mailing List

> I am wondering if 3) is necessary or not. When the filesystem is remounted
> from rw to ro, are all dirty buffers related to it flushed to disk? How
> about umount?
>
> The last related question: is the kdev field in the buffer head
> the physical
> block device (i.e., /dev/hda) or the logical block device (i.e.,
> /dev/hda7)?

auh..it must be the logical device which is passed as the mount point..

I also checked the mount/umount code, and didn't find any part does the
flush.
So I guess data can still be lost after an unmount?

> Thanks a lot.
>
> Hua
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-06-11  8:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-06-11  7:50 dirty buffers and umount/remount Hua Zhong
2002-06-11  8:12 ` Hua Zhong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®