From: Mike Looijmans <mike.looijmans@topic.nl>
To: <yocto@yoctoproject.org>
Subject: Re: [systemd-devel] How to automount
Date: Thu, 24 Sep 2015 12:55:24 +0200 [thread overview]
Message-ID: <5603D69C.5040905@topic.nl> (raw)
In-Reply-To: <CAF3SDA6D2-SNdU0bbCH0+5vk7XbYgdx-O1Wm+Z_5xQfjbv===Q@mail.gmail.com>
On 23-09-15 12:09, Daniel. wrote:
> I think that sync just flushes data to disk and umount clears the dirty bit.
> There is no sync.vfat that I know.
>
> Em 23/09/2015 05:31, "Paul D. DeRocco" <pderocco@ix.netcom.com
> <mailto:pderocco@ix.netcom.com>> escreveu:
>
> > From: Mike Looijmans
> >
> > This only serves to remove a mounted directory after
> > "yanking" the device. It
> > doesn't really do anything useful though, you'll still get corrupted
> > filesystems, because Linux is way too lazy in writing out dirty data.
> >
> > Proper solution would be to have the system mount a removable
> > device as
> > read-only, and promote it to r/w once someone tries to write
> > to it. And then
> > after a timeout, it should go back to readonly.
> >
> > Supposedly, "autofs" can accomplish this, but I've never met
> > anyone who got
> > that to actually work.
>
> In my system, the removable drive is used only for backing up or restoring
> various data files in response to user commands. If I do a sync after each
> such command, shouldn't that be enough to guarantee the file system
> doesn't get corrupted when the drive is removed? Will it also ensure the
> dirty flag is clear, or does that get set anyway?
Nope, "sync" does not clear the flag. Only umount does that (the same for any
filesystem, this is not fat specific). Actually, sync is no guarantee that
it's actually safe to yank the stick, data could still reside in buffers
somewhere. Only umount (sort of) guarantees that.
The only thing that would really work is to unmount the device.
You could try mounting it read-only by default, and remount it before (rw) and
after (ro) writing to it. Since it's under your control, it's possible to 'get
it right' here and always have clean media.
Kind regards,
Mike Looijmans
System Expert
TOPIC Embedded Products
Eindhovenseweg 32-C, NL-5683 KH Best
Postbus 440, NL-5680 AK Best
Telefoon: +31 (0) 499 33 69 79
Telefax: +31 (0) 499 33 69 70
E-mail: mike.looijmans@topicproducts.com
Website: www.topicproducts.com
Please consider the environment before printing this e-mail
next prev parent reply other threads:[~2015-09-24 10:55 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <F9B37C5086864E2EA06AC70C09CF7C25@PAULD>
[not found] ` <CAFKnvs6eVMrfcH3AOS28vAG237UUbYdLKR=FGB9PBipOQZbqYg@mail.gmail.com>
[not found] ` <3DB96F2F9D444EFE931CA8443BAFBACE@PAULD>
[not found] ` <CAPWNY8XTWDDS83JwizV8jH=xkxs9hdRgBLB5CsacTYQsqCwG=Q@mail.gmail.com>
2015-09-22 17:45 ` [systemd-devel] How to automount Paul D. DeRocco
2015-09-22 18:33 ` Fred Ollinger
2015-09-22 19:55 ` Daniel.
2015-09-22 23:42 ` Paul D. DeRocco
2015-09-22 23:49 ` Fred Ollinger
2015-09-23 0:22 ` Paul D. DeRocco
2015-09-23 0:30 ` Daniel.
2015-09-23 1:20 ` Paul D. DeRocco
2015-09-23 2:34 ` Daniel.
2015-09-23 7:20 ` Mike Looijmans
2015-09-23 8:30 ` Paul D. DeRocco
2015-09-23 10:09 ` Daniel.
2015-09-23 18:31 ` Paul D. DeRocco
2015-09-23 19:28 ` Daniel.
2015-09-24 10:55 ` Mike Looijmans [this message]
2015-09-24 6:04 Johannes Pointner
2015-09-24 10:58 ` Mike Looijmans
-- strict thread matches above, loose matches on Subject: below --
2015-09-24 11:25 Johannes Pointner
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=5603D69C.5040905@topic.nl \
--to=mike.looijmans@topic.nl \
--cc=yocto@yoctoproject.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.