<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Thank you very much. It dose work. <br>
</p>
<p>Would you tell me that how the '--no-block' works,</p>
<p>I doesn't deeply understand the interpretation in<font
face="Times New Roman, Times, serif"> <br>
</font></p>
<p><font face="Times New Roman, Times, serif"><a class="moz-txt-link-freetext" href="https://www.freedesktop.org/software/systemd/man/systemd-mount.html#SYSTEMD_MOUNT_OPTIONS=">https://www.freedesktop.org/software/systemd/man/systemd-mount.html#SYSTEMD_MOUNT_OPTIONS=</a></font></p>
<p><font face="Times New Roman, Times, serif"><br>
</font></p>
<p><font face="Times New Roman, Times, serif">And why systemd-mount
can solve the problem brought by MountFlag=slave.</font></p>
<p><font face="Times New Roman, Times, serif"><br>
</font></p>
<p><font face="Times New Roman, Times, serif">Best Regard,</font></p>
<p><font face="Times New Roman, Times, serif">Hongzhi<br>
</font></p>
<br>
<div class="moz-cite-prefix">On 2018年02月28日 03:02, Andrei Borzenkov
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:fc702e6a-f60b-db79-650f-d4e5c2f83f0b@gmail.com">
<pre wrap="">27.02.2018 17:20, Hongzhi, Song пишет:
</pre>
<blockquote type="cite">
<pre wrap="">Hi,
thank for your help, but I still have some question.
My current linux system init uses systemd and udev, with
'automount.rules' and 'mount.sh' in /etc/udev/,
to manage device. But owning to MountFlags=slave, hotpluggable media
(e.g., /dev/sda1 )
can be mounted again in host, whereas can't be formatted by mkfs.ext4 in
host with error
message '/dev/sda1 is apparently in use by the system; will not make a
filesystem here!'.
In your reply, you told me to invoke "systemd-mount" from udev rules. Do
you mean that
I should replace /bin/mount with /usr/bin/systemd-mount in mount.sh, or add
"RUN+='/usr/bin/systemd-mount $env{DEVNAME}'" to automount.rules?
1)
I replaced /bin/mount with /usr/bin/systemd-mount in mount.sh.
/usr/bin/systemd-mount $DEVNAME "/run/media/$name"
it prompted that
systemd[1]: dev-sda.device: Job dev-sda.device/start timed out.
systemd[1]: Timed out waiting for device dev-sda.device.
systemd[1]: Dependency failed for /run/media/sda.
systemd[1]: run-media-sda.mount: Job run-media-sda.mount/start
failed with result 'dependency'.
systemd[1]: Dependency failed for File System Check on /dev/sda.
systemd[1]: <a class="moz-txt-link-abbreviated" href="mailto:systemd-fsck@dev-sda.service">systemd-fsck@dev-sda.service</a>: Job
<a class="moz-txt-link-abbreviated" href="mailto:systemd-fsck@dev-sda.service/start">systemd-fsck@dev-sda.service/start</a> failed with result 'dependency'.
systemd[1]: Startup finished in 16.692s (kernel) + 1min 32.605s
(userspace) = 1min 49.298s.
systemd[1]: dev-sda.device: Job dev-sda.device/start failed with
result 'timeout'.
...
in /var/log/syslog.
</pre>
</blockquote>
<pre wrap="">
Try
systemd-mount --no-block ...
_______________________________________________
systemd-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:systemd-devel@lists.freedesktop.org">systemd-devel@lists.freedesktop.org</a>
<a class="moz-txt-link-freetext" href="https://lists.freedesktop.org/mailman/listinfo/systemd-devel">https://lists.freedesktop.org/mailman/listinfo/systemd-devel</a>
</pre>
</blockquote>
<br>
</body>
</html>