Running fsck before mounting removable media
David Zeuthen
david at fubar.dk
Mon Apr 23 13:12:41 PDT 2007
On Sun, 2007-04-22 at 11:48 -0700, Artem Kachitchkine wrote:
> > No, it isn't a good idea to run a fsck check on every plugin time. This is in the
> > most cases not needed and the most user don't like to get a fsck check every time
> > they plugin their USB harddisk or USB-stick, at least not if you have a big
> > disk and a journaling filesystem.
Funny enough, Mac OS X runs fsck every time you attach a disk. For my
250GB harddisk (attached via USB2.0 and formatted with FAT32) it takes
40 seconds before I see an icon. It's tweakable from a (hard to find)
configuration dialog in OS X though.
> > If you always umount the partition correctly
> > there is no need to run always fsck.
Dude, that's, like, overly optimistic :-)
> It is not a good idea to make this default, but having the ability to do
> so is a legitimate request. There is a need to enable additional actions
> before and after mount, e.g. some users wish to share mounted media over
> the network. Nothing urgent, but worth adding it to the TODO and tossing
> around some ideas in the future.
Sure, and note that as this is policy, the request needs to originate
from the desktop session. Hence, for GNOME, it's gnome-volume-manager
(or probably gnome-mount), for KDE it's something else, that needs to
call something like
CheckFilesystem ()
on the
org.freedesktop.Hal.Device.Volume
interface. There's a couple of ways to go about this; see e.g.
http://www.gballard.net/macrant/OSX_Permissions.jpg
So for example CheckFilesystem() could simply take an address of a
socket to connect to stdin/stdout of the fsck to and the UI application
would use a terminal widget to show to the user. There might be security
issues with this approach though :-). There's a ton of other approaches
too; at first it's probably best to just provide
CheckFilesystemNonInteractive ()
and perhaps have that method emit some D-Bus signals e.g.
FilesystemCheckProgress (double percentageComplete)
FilesystemCheckEmitline (string line)
etc. etc. Maybe that's all we need; the old UNIX hands can just use a
shell and fsck using the commandline if they want interactive stuff.
It's also worth perhaps looking at libparted; it has
ped_file_system_check() and we already have some abstractions of that
library... (that, btw, I will soon hook into D-Bus methods now that
PolicyKit is usable)
Anyway, we definitely want something like this...
David
More information about the hal
mailing list