[systemd-devel] auto-unmount via BindsTo= is annoying

Mantas Mikulėnas grawity at gmail.com
Sat Apr 4 04:36:25 PDT 2015


On Sat, Apr 4, 2015 at 1:44 PM, Andrei Borzenkov <arvidjaar at gmail.com>
wrote:

> В Sat, 4 Apr 2015 12:55:34 +0300
> Mantas Mikulėnas <grawity at gmail.com> пишет:
>
> > On Sat, Apr 4, 2015 at 7:37 AM, Andrei Borzenkov <arvidjaar at gmail.com>
> > wrote:
> >
> > > В Fri, 3 Apr 2015 21:19:24 +0300
> > > Mantas Mikulėnas <grawity at gmail.com> пишет:
> > >
> > > > Previously udev used to undo mounts when a device *disappeared;* when
> > > > systemd took over the task, it started unmounting things as soon as
> it
> > > > noticed that the device *doesn't exist right now.* While similar,
> the new
> > > > behavior can be annoying, since it also triggers if the device never
> > > > existed in the first place. For example:
> > > >
> > > > ~ My fstab has "/dev/mapper/luks-backups → /mnt/backup". I want to
> mount
> > > > another disk there (which has a different label), but even though
> `mount
> > > > /dev/sdb1 /mnt/backup` succeeds, the directory remains empty and
> won't
> > > show
> > > > up in `findmnt`.
> > > >
> > > > After a few retries I check dmesg and notice systemd saying that
> > > > "mnt-backup.mount is bound to an inactive device; stopping". Which
> means,
> > > > if my fstab says disk X is mounted there, systemd won't let me mount
> > > > anything else but disk X at that location.
> > > >
> > > > ~ I had to boot to emergency mode due to reasons, and attempted to
> mount
> > > > /boot & /boot/efi in order to fix something. Since my fstab had
> > > > "/dev/disk/by-partlabel/boot → /boot", any attempts to mount
> anything at
> > > > /boot get immediately undone – emergency mode has no udev, so I get
> > > > "boot.mount is bound to an inactive device; stopping" all over again.
> > > >
> > >
> > > Do these commits help?
> > >
> > > commit 628c89cc68ab96fce2de7ebba5933725d147aecc
> > > Author: Lennart Poettering <lennart at poettering.net>
> > > Date:   Fri Feb 27 21:55:08 2015 +0100
> > >
> > >     core: rework device state logic
> > >
> > > commit 496068a8288084ab3ecf8b179a8403ecff1a6be8
> > > Author: Martin Pitt <martin.pitt at ubuntu.com>
> > > Date:   Fri Mar 13 08:35:59 2015 +0100
> > >
> > >     core: don't change removed devices to state "tentative"
> > >
> >
> > Nope, this is already on 093c2cfe3b1.
> >
> >
>
> I cannot reproduce it. Could you give more details (/etc/fstab line,
> systemctl status and systemctl show mnt-backup.mount before and after
> manual mount)?
>

Hmm, you're right, I cannot reproduce the /mnt/backup case either. Weird.
(I mostly remember it from 2 weeks ago.)

The /boot one though happened just yesterday:

-- 
Mantas Mikulėnas <grawity at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20150404/841f3eea/attachment-0001.html>
-------------- next part --------------
# systemctl status boot.mount
● boot.mount - /boot
   Loaded: loaded (/etc/fstab)
   Active: inactive (dead) since Sat 2015-04-04 14:32:18 EEST; 47s ago
    Where: /boot
     What: /dev/disk/by-partlabel/boot
     Docs: man:fstab(5)
           man:systemd-fstab-generator(8)
  Process: 132 ExecUnmount=/bin/umount /boot -n (code=exited, status=0/SUCCESS)

# systemctl status /dev/disk/by-partlabel/boot
● dev-disk-by\x2dpartlabel-boot.device
   Loaded: loaded
   Active: inactive (dead)

# systemctl show boot.mount
Where=/boot
What=/dev/disk/by-partlabel/boot
Options=rw
Type=ext4
TimeoutUSec=1min 30s
ControlPID=0
DirectoryMode=0755
SloppyOptions=no
Result=success
ExecUnmount={ path=/bin/umount ; argv[]=/bin/umount /boot -n ; ignore_errors=no ; start_time=[Sat 2015-04-04 14:32:18 EEST] ; stop_time=[Sat 2015-04-04 14:32:18 EEST] ; pid=132 ; code=exited ; status=0 }
Slice=system.slice
MemoryCurrent=18446744073709551615
CPUUsageNSec=18446744073709551615
Delegate=no
CPUAccounting=no
CPUShares=18446744073709551615
StartupCPUShares=18446744073709551615
CPUQuotaPerSecUSec=infinity
BlockIOAccounting=no
BlockIOWeight=18446744073709551615
StartupBlockIOWeight=18446744073709551615
MemoryAccounting=no
MemoryLimit=18446744073709551615
DevicePolicy=auto
UMask=0022
LimitCPU=18446744073709551615
LimitFSIZE=18446744073709551615
LimitDATA=18446744073709551615
LimitSTACK=18446744073709551615
LimitCORE=18446744073709551615
LimitRSS=18446744073709551615
LimitNOFILE=4096
LimitAS=18446744073709551615
LimitNPROC=1885
LimitMEMLOCK=65536
LimitLOCKS=18446744073709551615
LimitSIGPENDING=1885
LimitMSGQUEUE=819200
LimitNICE=0
LimitRTPRIO=0
LimitRTTIME=18446744073709551615
OOMScoreAdjust=0
Nice=0
IOScheduling=0
CPUSchedulingPolicy=0
CPUSchedulingPriority=0
TimerSlackNSec=50000
CPUSchedulingResetOnFork=no
NonBlocking=no
StandardInput=null
StandardOutput=journal
StandardError=inherit
TTYReset=no
TTYVHangup=no
TTYVTDisallocate=no
SyslogPriority=30
SyslogLevelPrefix=yes
SecureBits=0
CapabilityBoundingSet=18446744073709551615
MountFlags=0
PrivateTmp=no
PrivateNetwork=no
PrivateDevices=no
ProtectHome=no
ProtectSystem=no
SameProcessGroup=yes
IgnoreSIGPIPE=yes
NoNewPrivileges=no
SystemCallErrorNumber=0
RuntimeDirectoryMode=0755
KillMode=control-group
KillSignal=15
SendSIGKILL=yes
SendSIGHUP=no
Id=boot.mount
Names=boot.mount
Requires=-.mount
RequiresOverridable=systemd-fsck at dev-disk-by\x5cx2dpartlabel-boot.service
Wants=system.slice
BindsTo=dev-disk-by\x5cx2dpartlabel-boot.device
RequiredBy=boot-efi.mount kernel-post-upgrade.path local-fs.target
WantedBy=dev-disk-by\x5cx2dpartlabel-boot.device
Conflicts=umount.target
Before=boot-efi.mount kernel-post-upgrade.path local-fs.target umount.target
After=-.mount dev-disk-by\x5cx2dpartlabel-boot.device local-fs-pre.target system.slice systemd-fsck at dev-disk-by\x5cx2dpartlabel-boot.service systemd-journald.socket
RequiresMountsFor=/ /dev/disk/by-partlabel/boot
Documentation=man:fstab(5) man:systemd-fstab-generator(8)
Description=/boot
LoadState=loaded
ActiveState=inactive
SubState=dead
FragmentPath=/run/systemd/generator/boot.mount
SourcePath=/etc/fstab
UnitFilePreset=disabled
InactiveExitTimestamp=Sat 2015-04-04 14:32:18 EEST
InactiveExitTimestampMonotonic=105949604
ActiveEnterTimestamp=Sat 2015-04-04 14:32:18 EEST
ActiveEnterTimestampMonotonic=105949604
ActiveExitTimestamp=Sat 2015-04-04 14:32:18 EEST
ActiveExitTimestampMonotonic=105950247
InactiveEnterTimestamp=Sat 2015-04-04 14:32:18 EEST
InactiveEnterTimestampMonotonic=105971619
CanStart=yes
CanStop=yes
CanReload=yes
CanIsolate=no
StopWhenUnneeded=no
RefuseManualStart=no
RefuseManualStop=no
AllowIsolate=no
DefaultDependencies=yes
OnFailureJobMode=replace
IgnoreOnIsolate=yes
IgnoreOnSnapshot=no
NeedDaemonReload=no
JobTimeoutUSec=0
JobTimeoutAction=none
ConditionResult=no
AssertResult=no
ConditionTimestampMonotonic=0
AssertTimestampMonotonic=0
Transient=no

# systemctl show /dev/disk/by-partlabel/boot
Id=dev-disk-by\x5cx2dpartlabel-boot.device
Names=dev-disk-by\x5cx2dpartlabel-boot.device
Wants=boot.mount
BoundBy=systemd-fsck at dev-disk-by\x5cx2dpartlabel-boot.service boot.mount
Before=systemd-fsck at dev-disk-by\x5cx2dpartlabel-boot.service boot.mount
Description=dev-disk-by\x5cx2dpartlabel-boot.device
LoadState=loaded
ActiveState=inactive
SubState=dead
InactiveExitTimestampMonotonic=0
ActiveEnterTimestampMonotonic=0
ActiveExitTimestampMonotonic=0
InactiveEnterTimestampMonotonic=0
CanStart=no
CanStop=no
CanReload=no
CanIsolate=no
StopWhenUnneeded=no
RefuseManualStart=no
RefuseManualStop=no
AllowIsolate=no
DefaultDependencies=yes
OnFailureJobMode=replace
IgnoreOnIsolate=yes
IgnoreOnSnapshot=yes
NeedDaemonReload=no
JobTimeoutUSec=1min 30s
JobTimeoutAction=none
ConditionResult=no
AssertResult=no
ConditionTimestampMonotonic=0
AssertTimestampMonotonic=0
Transient=no
-------------- next part --------------
# systemctl status boot.mount
● boot.mount - /boot
   Loaded: loaded (/etc/fstab)
   Active: inactive (dead)
    Where: /boot
     What: /dev/disk/by-partlabel/boot
     Docs: man:fstab(5)
           man:systemd-fstab-generator(8)

# systemctl status /dev/disk/by-partlabel/boot
● dev-disk-by\x2dpartlabel-boot.device
   Loaded: loaded
   Active: inactive (dead)

# systemctl show boot.mount
Where=/boot
What=/dev/disk/by-partlabel/boot
Options=rw
Type=ext4
TimeoutUSec=1min 30s
ControlPID=0
DirectoryMode=0755
SloppyOptions=no
Result=success
Slice=system.slice
MemoryCurrent=18446744073709551615
CPUUsageNSec=18446744073709551615
Delegate=no
CPUAccounting=no
CPUShares=18446744073709551615
StartupCPUShares=18446744073709551615
CPUQuotaPerSecUSec=infinity
BlockIOAccounting=no
BlockIOWeight=18446744073709551615
StartupBlockIOWeight=18446744073709551615
MemoryAccounting=no
MemoryLimit=18446744073709551615
DevicePolicy=auto
UMask=0022
LimitCPU=18446744073709551615
LimitFSIZE=18446744073709551615
LimitDATA=18446744073709551615
LimitSTACK=18446744073709551615
LimitCORE=18446744073709551615
LimitRSS=18446744073709551615
LimitNOFILE=4096
LimitAS=18446744073709551615
LimitNPROC=1885
LimitMEMLOCK=65536
LimitLOCKS=18446744073709551615
LimitSIGPENDING=1885
LimitMSGQUEUE=819200
LimitNICE=0
LimitRTPRIO=0
LimitRTTIME=18446744073709551615
OOMScoreAdjust=0
Nice=0
IOScheduling=0
CPUSchedulingPolicy=0
CPUSchedulingPriority=0
TimerSlackNSec=50000
CPUSchedulingResetOnFork=no
NonBlocking=no
StandardInput=null
StandardOutput=journal
StandardError=inherit
TTYReset=no
TTYVHangup=no
TTYVTDisallocate=no
SyslogPriority=30
SyslogLevelPrefix=yes
SecureBits=0
CapabilityBoundingSet=18446744073709551615
MountFlags=0
PrivateTmp=no
PrivateNetwork=no
PrivateDevices=no
ProtectHome=no
ProtectSystem=no
SameProcessGroup=yes
IgnoreSIGPIPE=yes
NoNewPrivileges=no
SystemCallErrorNumber=0
RuntimeDirectoryMode=0755
KillMode=control-group
KillSignal=15
SendSIGKILL=yes
SendSIGHUP=no
Id=boot.mount
Names=boot.mount
Requires=-.mount
RequiresOverridable=systemd-fsck at dev-disk-by\x5cx2dpartlabel-boot.service
Wants=system.slice
BindsTo=dev-disk-by\x5cx2dpartlabel-boot.device
RequiredBy=boot-efi.mount kernel-post-upgrade.path local-fs.target
WantedBy=dev-disk-by\x5cx2dpartlabel-boot.device
Conflicts=umount.target
Before=boot-efi.mount kernel-post-upgrade.path local-fs.target umount.target
After=-.mount dev-disk-by\x5cx2dpartlabel-boot.device local-fs-pre.target system.slice systemd-fsck at dev-disk-by\x5cx2dpartlabel-boot.service systemd-journald.socket
RequiresMountsFor=/ /dev/disk/by-partlabel/boot
Documentation=man:fstab(5) man:systemd-fstab-generator(8)
Description=/boot
LoadState=loaded
ActiveState=inactive
SubState=dead
FragmentPath=/run/systemd/generator/boot.mount
SourcePath=/etc/fstab
UnitFilePreset=disabled
InactiveExitTimestampMonotonic=0
ActiveEnterTimestampMonotonic=0
ActiveExitTimestampMonotonic=0
InactiveEnterTimestampMonotonic=0
CanStart=yes
CanStop=yes
CanReload=yes
CanIsolate=no
StopWhenUnneeded=no
RefuseManualStart=no
RefuseManualStop=no
AllowIsolate=no
DefaultDependencies=yes
OnFailureJobMode=replace
IgnoreOnIsolate=yes
IgnoreOnSnapshot=no
NeedDaemonReload=no
JobTimeoutUSec=0
JobTimeoutAction=none
ConditionResult=no
AssertResult=no
ConditionTimestampMonotonic=0
AssertTimestampMonotonic=0
Transient=no

# systemctl show /dev/disk/by-partlabel/boot
Id=dev-disk-by\x5cx2dpartlabel-boot.device
Names=dev-disk-by\x5cx2dpartlabel-boot.device
Wants=boot.mount
BoundBy=systemd-fsck at dev-disk-by\x5cx2dpartlabel-boot.service boot.mount
Before=systemd-fsck at dev-disk-by\x5cx2dpartlabel-boot.service boot.mount
Description=dev-disk-by\x5cx2dpartlabel-boot.device
LoadState=loaded
ActiveState=inactive
SubState=dead
InactiveExitTimestampMonotonic=0
ActiveEnterTimestampMonotonic=0
ActiveExitTimestampMonotonic=0
InactiveEnterTimestampMonotonic=0
CanStart=no
CanStop=no
CanReload=no
CanIsolate=no
StopWhenUnneeded=no
RefuseManualStart=no
RefuseManualStop=no
AllowIsolate=no
DefaultDependencies=yes
OnFailureJobMode=replace
IgnoreOnIsolate=yes
IgnoreOnSnapshot=yes
NeedDaemonReload=no
JobTimeoutUSec=1min 30s
JobTimeoutAction=none
ConditionResult=no
AssertResult=no
ConditionTimestampMonotonic=0
AssertTimestampMonotonic=0
Transient=no


More information about the systemd-devel mailing list