All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fred Ollinger <Fred.Ollinger@seescan.com>
To: "Paul D. DeRocco" <pderocco@ix.netcom.com>,
	'Mantas Mikulenas' <grawity@gmail.com>,
	"yocto@yoctoproject.org" <yocto@yoctoproject.org>
Subject: Re: [systemd-devel] How to automount
Date: Tue, 22 Sep 2015 23:49:23 +0000	[thread overview]
Message-ID: <1442965676104.72571@seescan.com> (raw)
In-Reply-To: <23E6267BFA52430DA768DDA7DC46AC9C@PAULD>

You can see what udev thinks it will do for a given drive by using:

 $ udevadm test /sys/block/sdb1

Given that your drive is in /sys/block/sdb1 (could be sda1, etc).

As for the dirty bit, we had to clear it ourselves.

Frederick

________________________________________
From: Paul D. DeRocco <pderocco@ix.netcom.com>
Sent: Tuesday, September 22, 2015 4:42 PM
To: Fred Ollinger; 'Mantas Mikulenas'; yocto@yoctoproject.org
Subject: RE: [yocto] [systemd-devel] How to automount

> From: Fred Ollinger [mailto:Fred.Ollinger@seescan.com]
>
> This is in the package: udev-extraconf
>
> On your system look here:
>
> /etc/udev/rules.d/automount.rules
>
> In this file, you'll find the following rules.
>
> The second one auto unmounts.
>
> SUBSYSTEM=="block", ACTION=="add"    RUN+="/etc/udev/scripts/mount.sh"
>
> SUBSYSTEM=="block", ACTION=="remove" RUN+="/etc/udev/scripts/mount.sh"
>
> SUBSYSTEM=="block", ACTION=="change",
> ENV{DISK_MEDIA_CHANGE}=="1" RUN+="/etc/udev/scripts/mount.sh"

Well, that started me down a long path. First of all, none of these things
existed because my Yocto build didn't include udev-extraconf. The version
I did two years ago did (although I didn't see it mentioned in my own
metadata), which is why it worked. So I added it back, rebuilt it, and
then tried plugging in a USB flash drive.

The drive appeared as /dev/sdb and /dev/sdb1 (it has a partition table),
The syslog showed the mount.sh script message "Auto-mount of
[/run/media/sdb1] successful", /run/media/sdb1 exists as a directory, but
nothing is mounted there. The next syslog message from FAT-fs said "Volume
was not properly unmounted. Some data may be corrupt. Please run fsck."
When I did that, all I found was that the dirty bit was set, so I
speculated that that caused the mount to somehow be undone.

So I cleaned the dirty bit, synced the file system, unplugged the drive
and plugged it in again. This time the syslog showed the successful mount
message, but no complaint about the drive. Yet it still wasn't mounted.

I can manually mount it, and see its contents. If I then yank the drive,
the mount.sh script doesn't unmount it. I even tweaked the script to log
any attempt to unmount, and it didn't even try.

Whenever I fix the dirty bit, disconnecting and reconnecting logs the
successful mount message, doesn't complain about the dirty bit, but
doesn't mount. Disconnecting again gives me a FAT-fs error "unable to read
boot sector to mark fs as dirty". Connecting again gives me the successful
mount message, and complains about the dirty bit.

Something must be missing here.

--

Ciao,               Paul D. DeRocco
Paul                mailto:pderocco@ix.netcom.com



  reply	other threads:[~2015-09-22 23:49 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 [this message]
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
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=1442965676104.72571@seescan.com \
    --to=fred.ollinger@seescan.com \
    --cc=grawity@gmail.com \
    --cc=pderocco@ix.netcom.com \
    --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.