Re: unmounting a filesystem safely that doesn't exist anymore

2006-06-14 Thread Christopher Sean Hilton
On Mon, Jun 12, 2006 at 04:44:48PM -0400, Zaphod Beeblebrox wrote:
 On 6/12/06, Ulrich Spoerlein [EMAIL PROTECTED] wrote:
 
 Björn König wrote:
 
 
 
  I did a mistake: I unplugged my digital camera accidentally before I
 unmounted the
  filesystem. *doh* This happens very often, because I'm very
 scatterbrained. =) The kernel
  will panic and all filesystems remain unclean in any case now. I know
 that this is a well
  know issue and in past discussions you stated that this behaviour is
 intended and won't be
  changed ad hoc. I just want to know if somebody knows a workaround or
 small trick that
  prevents the other filesystems from being unclean on next boot-up.
 
 You might give the automounter (am-utils) a whirl. They are very
 confusing to set up, but you can set the unmount-if-unused timeout to
 something like 5 seconds. This could narrow the window enough to not
 panic you system frequently :)
 
 
 That's rather hackish ... especially since this is a common problem and a
 rather obvious hole in using FreeBSD for noobs.
 

I've been using the automounter to handle these mounts for about three
years now. When I started I would be have to run fsck on my memory
stick about twice a day. Now it's more like once a month. In short it
works.

I've got to admit that I agree with the fact that this is a more than
rather hackish solution to the problem. The real issue here is that
for Unix, filesystems come in two types: Those on hard disks which are
perpetually available once they've been mounted once, and those which
come from the network which can come and go as they please. The
automounter works as a solution to this problem by making a local
filesystem on hotplugable hardware look like it's coming from a
network.

It took me the better part of a day to figure out how to make the
automounter work properly in this situation. In my case I was using a
UFS formatted memory stick which complicated things. The automounter
was coded with the assumption that UFS filesystems only exist on
drives that are bolted into the computer. The automounter will gladly
mount a UFS volume but because it's a UFS volume it never feels the
need to dismount the volume and leave it in a clean state. 

Another problem is that most tools today makes a similar the
assumption about mounted volumes that they didn't graft into the
filesystem. So, for example opening up the Nautilus file browser on
/amd/ufs0 on my system creates an entry in some magic file somewhere
that tells Nautilus to periodically visit that directory. As far as
amd is concerned these visits are valid requests to mount the
filesystem. The end result is that the filesystem again remains
permanently mounted. 

With MS-DOS FAT filesystems the problem is who mounted the
filesystem. Amd mounts my MP3 player read-write on /amd/mp3 perms 777
root:wheel. I use rsync to copy podcasts from a holding directory on
my desktop to it. And rsync complains all the time that it can copy
the files but it cannot change the date/time. This is because
chris:chris cannot change an entry in a directory owned by root:wheel,
as it should be.

It doesn't sound like I'm trying to sell this but in the long run I
actually believe that amd is the best of a bunch of mediocre
solutions. I wish however that:

 Amd didn't make the assumption that a UFS volume was going to be
 there forever;

 Gnome could be told that filesystems under /amd or some other
 programmable mount point will come and go with the wind so don't
 cache the names;

 That more applications would understand that there are people
 using the automounter and that a mount request can be
 accomplished by a simple:

  $ ls -l /amd/foo

 and a umount request can be accomplished by a doing:

  $ amq -u /amd/foo

Look for a followup with configs.g

-- Chris

-- 
Chris Hilton   chris-at-vindaloo-dot-com

All I was doing was trying to get home from work!
 -- Rosa Parks

___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: unmounting a filesystem safely that doesn't exist anymore

2006-06-13 Thread Zaphod Beeblebrox

On 6/12/06, Ulrich Spoerlein [EMAIL PROTECTED] wrote:


Björn König wrote:





 I did a mistake: I unplugged my digital camera accidentally before I
unmounted the
 filesystem. *doh* This happens very often, because I'm very
scatterbrained. =) The kernel
 will panic and all filesystems remain unclean in any case now. I know
that this is a well
 know issue and in past discussions you stated that this behaviour is
intended and won't be
 changed ad hoc. I just want to know if somebody knows a workaround or
small trick that
 prevents the other filesystems from being unclean on next boot-up.

You might give the automounter (am-utils) a whirl. They are very
confusing to set up, but you can set the unmount-if-unused timeout to
something like 5 seconds. This could narrow the window enough to not
panic you system frequently :)



That's rather hackish ... especially since this is a common problem and a
rather obvious hole in using FreeBSD for noobs.

It seems that a better solution would be to allow filesystems to be mounted
with a 'sync' flag.  Or even an ULTRA-sync flag.  Meaning strict sync
semantics and even 'sync' running against the FS every few seconds.  If a
filesystem so-mounted completely disappears (or errors out), then it should
just go poof as if it was umount -f'd.
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: unmounting a filesystem safely that doesn't exist anymore

2006-06-12 Thread Björn König

Peter Jeremy schrieb:

On Sat, 2006-Jun-10 19:40:41 +0200, Bjrn Knig wrote:

I did a mistake: I unplugged my digital camera accidentally before I 
unmounted the filesystem. *doh* This happens very often, because I'm 
very scatterbrained. =)



Your best solution may be to use mtools (ports/emulators/mtools) rather
than mounting the filesystem.


changed ad hoc. I just want to know if somebody knows a workaround or 
small trick that prevents the other filesystems from being unclean on 
next boot-up.



The only way to do this is to have all the other filesystems mounted
read-only.  The filesystem clean flag is part of the superblock and
is cleared when a filesystem is mounted.  It will be set only if the
filesystem is cleanly unmounted.


Thank you very much for these information. They help me a lot.

Björn

P.S. I get the feeling questions@ would had been a better place for my 
question. ;-)

___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: unmounting a filesystem safely that doesn't exist anymore

2006-06-12 Thread Ulrich Spoerlein
Björn König wrote:
 Hello,
 
 I did a mistake: I unplugged my digital camera accidentally before I 
 unmounted the 
 filesystem. *doh* This happens very often, because I'm very scatterbrained. 
 =) The kernel 
 will panic and all filesystems remain unclean in any case now. I know that 
 this is a well 
 know issue and in past discussions you stated that this behaviour is intended 
 and won't be 
 changed ad hoc. I just want to know if somebody knows a workaround or small 
 trick that 
 prevents the other filesystems from being unclean on next boot-up.

You might give the automounter (am-utils) a whirl. They are very
confusing to set up, but you can set the unmount-if-unused timeout to
something like 5 seconds. This could narrow the window enough to not
panic you system frequently :)

Ulrich Spoerlein
-- 
 PGP Key ID: 20FEE9DD   Encrypted mail welcome!
Fingerprint: AEC9 AF5E 01AC 4EE1 8F70  6CBD E76E 2227 20FE E9DD
Which is worse: ignorance or apathy?
Don't know. Don't care.


pgptDKFK0qUnN.pgp
Description: PGP signature


Re: unmounting a filesystem safely that doesn't exist anymore

2006-06-11 Thread Peter Jeremy
On Sat, 2006-Jun-10 19:40:41 +0200, Bjrn Knig wrote:
I did a mistake: I unplugged my digital camera accidentally before I 
unmounted the filesystem. *doh* This happens very often, because I'm 
very scatterbrained. =)

Your best solution may be to use mtools (ports/emulators/mtools) rather
than mounting the filesystem.

changed ad hoc. I just want to know if somebody knows a workaround or 
small trick that prevents the other filesystems from being unclean on 
next boot-up.

The only way to do this is to have all the other filesystems mounted
read-only.  The filesystem clean flag is part of the superblock and
is cleared when a filesystem is mounted.  It will be set only if the
filesystem is cleanly unmounted.

-- 
Peter Jeremy
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to [EMAIL PROTECTED]


unmounting a filesystem safely that doesn't exist anymore

2006-06-10 Thread Björn König

Hello,

I did a mistake: I unplugged my digital camera accidentally before I 
unmounted the filesystem. *doh* This happens very often, because I'm 
very scatterbrained. =) The kernel will panic and all filesystems remain 
unclean in any case now. I know that this is a well know issue and in 
past discussions you stated that this behaviour is intended and won't be 
changed ad hoc. I just want to know if somebody knows a workaround or 
small trick that prevents the other filesystems from being unclean on 
next boot-up.


Regards
Björn
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to [EMAIL PROTECTED]