[prev in list] [next in list] [prev in thread] [next in thread] 

List:       debian-user
Subject:    Re: Problem unplugging a USB drive
From:       Mick Ab <recoverymail123890 () gmail ! com>
Date:       2020-10-26 20:56:39
Message-ID: CAJrFWkcT038DDimtJTfbeU=6pFs53VahDRj+ZBoWG=b=etnEpw () mail ! gmail ! com
[Download RAW message or body]

The automatic mount and unmount were performed by the USB mount system.

The stick was newish and hasn't been previously written to.

The stick's filesystem is FAT32, in common with most USB sticks.

The auto mount command included the -tvfat option.

I got the message that you frequently see, so it looks as though the stick
just has a dirty bit.
On 26 Oct 2020 20:45, "David Wright" <deblis@lionunicorn.co.uk> wrote:

> On Mon 26 Oct 2020 at 17:09:17 (+0000), Mick Ab wrote:
> > > > > > […] the messages revealed that just before
> > > > > > the stick was unplugged, the kernel suddenly found the stick and
> > > > > > automatically mounted it to /media/usb0.
>
> > Why did the kernel automatically mount the stick ?
>
> >From the mount point chosen, I would guess that it was mounted by
> some kind of automounter. (My guess is based on conversations here:
> I don't run either DE or an automounter.)
>
> > > > > > While the stick was being
> > > > > > unplugged, the system performed a 'lazy' unmount from
> /media/usb0.
>
> That seems logical for a automounter. When you pull the stick,
> it prevents umount from failing because the device was busy.
> Assuming you weren't writing to the stick at the time, the
> amount of corruption that would occur is likely to be influenced
> by the filesystem on it. In my experience with vfat, it's likely
> to be as little setting the dirty bit.
>
> > > > > > The stick was later plugged back into the USB 3 port and the
> dmesg command
> > > > > > issued. The dmesg messages revealed that the stick was probably
> corrupted
> > > > > > due to the lazy unmount.
>
> I didn't know that dmesg was that precise in diagnosis. I frequently see
> "Volume was not properly unmounted. Some data may be corrupt. Please run
> fsck."
> AIUI that's just the dirty bit speaking.
>
> I've seen worse, for example:
>
> [47557.370417] FAT-fs (sdb1): Volume was not properly unmounted. Some data
> may be corrupt. Please run fsck.
> [47689.952378] FAT-fs (sdb1): error, fat_get_cluster: invalid start
> cluster (i_pos 0, start cdc8429e)
> [47689.952384] FAT-fs (sdb1): Filesystem has been set read-only
> [47689.952491] FAT-fs (sdb1): error, fat_get_cluster: invalid start
> cluster (i_pos 0, start 2c494d0f)
>
> In this case, the stick was on its way out.
>
> The flakiness of your usb ports might have some influence on disk
> corruption in any case. Do you have   errors=remount-ro   is the
> appropriate place(s)? (fstab, in my configuration.)
>
> > Usually mounts have to be made manually for this port.
>
> Even if I knew how your machine was configured, I'm not sure I would
> know the answer. When I see people using an automounter, but mounting
> on a mount point of their choosing, I've always presumed that they're
> using a bind mount (assuming that they haven't configured rules for
> their automounter).
>
> I generate only mountpoints automatically with my own rules, but
> I mount and unmount devices manually.
>
> Cheers,
> David.
>
>

[Attachment #3 (text/html)]

<p dir="ltr">The automatic mount and unmount were performed by the USB mount \
system.</p> <p dir="ltr">The stick was newish and hasn&#39;t been previously written \
to.</p> <p dir="ltr">The stick&#39;s filesystem is FAT32, in common with most USB \
sticks.</p> <p dir="ltr">The auto mount command included the -tvfat option.</p>
<p dir="ltr">I got the message that you frequently see, so it looks as though the \
stick just has a dirty bit.</p> <div class="gmail_quote">On 26 Oct 2020 20:45, \
&quot;David Wright&quot; &lt;<a \
href="mailto:deblis@lionunicorn.co.uk">deblis@lionunicorn.co.uk</a>&gt; wrote:<br \
type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 \
.8ex;border-left:1px #ccc solid;padding-left:1ex">On Mon 26 Oct 2020 at 17:09:17 \
(+0000), Mick Ab wrote:<br> &gt; &gt; &gt; &gt; &gt; […] the messages revealed that \
just before<br> &gt; &gt; &gt; &gt; &gt; the stick was unplugged, the kernel suddenly \
found the stick and<br> &gt; &gt; &gt; &gt; &gt; automatically mounted it to \
/media/usb0.<br> <br>
&gt; Why did the kernel automatically mount the stick ?<br>
<br>
&gt;From the mount point chosen, I would guess that it was mounted by<br>
some kind of automounter. (My guess is based on conversations here:<br>
I don&#39;t run either DE or an automounter.)<br>
<br>
&gt; &gt; &gt; &gt; &gt; While the stick was being<br>
&gt; &gt; &gt; &gt; &gt; unplugged, the system performed a &#39;lazy&#39; unmount \
from /media/usb0.<br> <br>
That seems logical for a automounter. When you pull the stick,<br>
it prevents umount from failing because the device was busy.<br>
Assuming you weren&#39;t writing to the stick at the time, the<br>
amount of corruption that would occur is likely to be influenced<br>
by the filesystem on it. In my experience with vfat, it&#39;s likely<br>
to be as little setting the dirty bit.<br>
<br>
&gt; &gt; &gt; &gt; &gt; The stick was later plugged back into the USB 3 port and the \
dmesg command<br> &gt; &gt; &gt; &gt; &gt; issued. The dmesg messages revealed that \
the stick was probably corrupted<br> &gt; &gt; &gt; &gt; &gt; due to the lazy \
unmount.<br> <br>
I didn&#39;t know that dmesg was that precise in diagnosis. I frequently see<br>
&quot;Volume was not properly unmounted. Some data may be corrupt. Please run \
fsck.&quot;<br> AIUI that&#39;s just the dirty bit speaking.<br>
<br>
I&#39;ve seen worse, for example:<br>
<br>
[47557.370417] FAT-fs (sdb1): Volume was not properly unmounted. Some data may be \
corrupt. Please run fsck.<br> [47689.952378] FAT-fs (sdb1): error, fat_get_cluster: \
invalid start cluster (i_pos 0, start cdc8429e)<br> [47689.952384] FAT-fs (sdb1): \
Filesystem has been set read-only<br> [47689.952491] FAT-fs (sdb1): error, \
fat_get_cluster: invalid start cluster (i_pos 0, start 2c494d0f)<br> <br>
In this case, the stick was on its way out.<br>
<br>
The flakiness of your usb ports might have some influence on disk<br>
corruption in any case. Do you have     errors=remount-ro     is the<br>
appropriate place(s)? (fstab, in my configuration.)<br>
<br>
&gt; Usually mounts have to be made manually for this port.<br>
<br>
Even if I knew how your machine was configured, I&#39;m not sure I would<br>
know the answer. When I see people using an automounter, but mounting<br>
on a mount point of their choosing, I&#39;ve always presumed that they&#39;re<br>
using a bind mount (assuming that they haven&#39;t configured rules for<br>
their automounter).<br>
<br>
I generate only mountpoints automatically with my own rules, but<br>
I mount and unmount devices manually.<br>
<br>
Cheers,<br>
David.<br>
<br>
</blockquote></div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic