Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
systemd-216: mount
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
mv
Advocate
Advocate


Joined: 20 Apr 2005
Posts: 4890

PostPosted: Sat Aug 23, 2014 4:28 pm    Post subject: systemd-216: mount Reply with quote

systemd-216 manages somehow to obtain full control over mount points:

If a mount unit for some filesystem exists (which is unavoidable if this is in /etc/fstab) then this mount point can neither be mounted nor umounted with the "mount" and "umount" commands, only by starting or stopping the systemd units.

How is this possible?

And - more important - how can I prevent this new BS of systemd-216? So far, the only "workaround" to this annoying behaviour seems to be to link the unit to /dev/null - even a ConditionNull in the unit does not stop this broken behaviour of systemd.
Back to top
View user's profile Send private message
TheCubeIsALie
n00b
n00b


Joined: 11 Sep 2013
Posts: 19

PostPosted: Sat Aug 23, 2014 8:29 pm    Post subject: Reply with quote

Odd, I'm using systemd-216 as well yet I do not have this problem. I have an external hard drive mounted at /mnt/drive that's listed in my fstab that I can mount and unmount as ease using their respective commands.

Here's what /run/systemd/generator/mnt-drive.mount looks like on my system
Code:
# Automatically generated by systemd-fstab-generator

[Unit]
SourcePath=/etc/fstab
Documentation=man:fstab(5) man:systemd-fstab-generator(8)
Before=local-fs.target

[Mount]
What=/dev/disk/by-partuuid/4b6676ba-ad27-40ef-a1b4-8d6c8e8f4302
Where=/mnt/drive
Type=btrfs
Options=noatime,space_cache,inode_cache,compress=lzo,autodefrag


Perhaps the fstab generator is the problem here? Booting Linux with the kernel parameter fstab="no" should stop systemd from handling these mount points, perhaps this would fix your problem.
Back to top
View user's profile Send private message
mv
Advocate
Advocate


Joined: 20 Apr 2005
Posts: 4890

PostPosted: Sun Aug 24, 2014 9:26 am    Post subject: Reply with quote

Thanks for the reply.

Meanwhile I found that it is necessary that the mount-device is from /dev/mapper.
Thus, the existence of the following unit prevents the manual mounting/umounting of /srv/foo (note that even ConditionNull is used...):

/etc/systemd/system/srv-foo.mount wrote:
[Mount]
ConditionNull=false
What=/dev/mapper/nonexistent
Where=/srv/foo
Type=dummy

In the moment when the "Where" directory is changed or "/dev/mapper/nonexistent" is modified to "/nonexistent" the mounting of /srv/foo is possible
(Of course, "systemctl daemon-reload" has to be used when making such modifications).

TheCubeIsALie wrote:
Perhaps the fstab generator is the problem here?

It is undesired here, since I actually do not want a unit for the corresponding mount-point, but it is of course not the "cause" for this misbehaviour of systemd.
Quote:
Booting Linux with the kernel parameter fstab="no"

This is not a solution for me, since most of my partitions should be mounted automatically. I cuold as well mask the wrongly generated units. B[/i]ut both is a lot of work and prevents me from copying my /etc/systemd configuration to my other systems which have different mount-points.
Back to top
View user's profile Send private message
mv
Advocate
Advocate


Joined: 20 Apr 2005
Posts: 4890

PostPosted: Sat Feb 21, 2015 7:55 am    Post subject: Reply with quote

With systemd-219 my previous workaround to mask the autogenerated unit is boycotted:
systemd-219 now "starts" some internally generated mount-unit whenever you mount something. There is no way to avoid this nonsense.

Finally, I am able to produce a test case so that everyone can see the complete brokenness:

Code:

# The following is necessary to produce the failure, although completely unrelated
# (It just means that the "illusion" of systemd being the operating system is destroyd
# by letting the kernel being able to do some mounts automatically).

mkdir /tmp/bla
mount --bind / /tmp/bla
mount --make-shared /

# Now with systemd, "mount" simply does not work for the device mapper.
# To prove it, we make an encrypted device and "mount" it (unsuccesfully):

M=experiment
F=./$M/file
D=./$M/dir
DM=/dev/mapper/$M
mkdir -p $D
dd if=/dev/zero of=$F bs=1024 count=5000
cryptsetup luksFormat $F # type YES and a password
cryptsetup luksOpen $F $M # re-enter the password
mke2fs $DM # Format the new encrypted device
mount $DM $D # With systemd, this has no effect!
: >$D/failed # Prove it by using the mount
umount $D # This fails on systemd
cryptsetup luksClose $M
ls $D # This displays "failed" on systemd
rm -r ./$M # cleanup everything

My clear recommendation: Dump systemd and use a sane init system which does not pretend to be an operation system.

Edit: Reformulated less offensive.


Last edited by mv on Wed Feb 25, 2015 9:24 am; edited 1 time in total
Back to top
View user's profile Send private message
djdunn
l33t
l33t


Joined: 26 Dec 2004
Posts: 719
Location: Arrakis

PostPosted: Wed Feb 25, 2015 12:59 am    Post subject: Reply with quote

I wonder if Jesus will return when systemd reaches version 666
_________________
A process cannot be understood by stopping it. Understanding must move with the flow of the process, must join it and flow with it.

-The First Law of Mentat
Back to top
View user's profile Send private message
devurandom
n00b
n00b


Joined: 08 Jan 2004
Posts: 63

PostPosted: Fri Feb 27, 2015 8:55 am    Post subject: Reply with quote

See-Also: https://bugs.gentoo.org/show_bug.cgi?id=541402
Back to top
View user's profile Send private message
fulminemizzega
n00b
n00b


Joined: 09 Jun 2013
Posts: 12

PostPosted: Sat Apr 04, 2015 1:46 pm    Post subject: Reply with quote

Systemd-219 here, I have had a similar issue last night, tinkering with two squashfs images and a qcow2 disk image.
After boot, doing "mount squash1.img /mnt/1" works with no other options needed and correctly creates the loop device and mounts, then doing "mount squash2.img /mnt/tmp" doesn't work, with the same error you reported (reproduced error right now because of journal rotation... see below):
Code:
Apr 04 15:22:48 gentoo-mediacenter systemd[1]: Unit mnt-tmp.mount is bound to inactive unit. Stopping, too.
Apr 04 15:22:48 gentoo-mediacenter systemd[1]: Unmounting /mnt/tmp...
Apr 04 15:22:48 gentoo-mediacenter systemd[287]: Unit mnt-tmp.mount is bound to inactive unit. Stopping, too.
Apr 04 15:22:48 gentoo-mediacenter systemd[287]: Unmounting /mnt/tmp...
Apr 04 15:22:48 gentoo-mediacenter umount[23495]: umount: /mnt/tmp: not mounted
Apr 04 15:22:48 gentoo-mediacenter systemd[287]: mnt-tmp.mount mount process exited, code=exited status=1
Apr 04 15:22:48 gentoo-mediacenter systemd[287]: Unmounted /mnt/tmp.
Apr 04 15:22:48 gentoo-mediacenter systemd[287]: Unit mnt-tmp.mount entered failed state.
Apr 04 15:22:48 gentoo-mediacenter systemd[1]: Requested transaction contradicts existing jobs: Resource deadlock avoided
Apr 04 15:22:48 gentoo-mediacenter systemd[1]: Unmounted /mnt/tmp.

Last night I didn't think about it too much, it didn't work so I tried another route: using losetup, then mounting (read-only) /dev/loop1 to /mnt/tmp, and it worked without issues. I left the systemd do what I needed (copying contents from /mnt/1 and /mnt/tmp to the qcow2 image) with htop opened in another tmux window. When I came back and everything was done, I found that the systemd process was eating my cpu, system load was about 2.5 (dual-core cpu). I ran "journalctl -f" and was flooded with
Code:
Apr 04 01:34:14 gentoo-mediacenter systemd[287]: Unmounting /mnt/tmp...
Apr 04 01:34:14 gentoo-mediacenter systemd[287]: mnt-tmp.mount mount process exited, code=exited status=1
Apr 04 01:34:14 gentoo-mediacenter systemd[287]: Failed unmounting /mnt/tmp.
Apr 04 01:34:14 gentoo-mediacenter systemd[287]: Unit mnt-tmp.mount is bound to inactive unit. Stopping, too.
Apr 04 01:34:14 gentoo-mediacenter systemd[287]: Unmounting /mnt/tmp...
Apr 04 01:34:14 gentoo-mediacenter systemd[287]: mnt-tmp.mount mount process exited, code=exited status=1
Apr 04 01:34:14 gentoo-mediacenter systemd[287]: Failed unmounting /mnt/tmp.
Apr 04 01:34:14 gentoo-mediacenter systemd[287]: Unit mnt-tmp.mount is bound to inactive unit. Stopping, too.
Apr 04 01:34:14 gentoo-mediacenter systemd[287]: Unmounting /mnt/tmp...
Apr 04 01:34:14 gentoo-mediacenter systemd[287]: mnt-tmp.mount mount process exited, code=exited status=1
Apr 04 01:34:14 gentoo-mediacenter systemd[287]: Failed unmounting /mnt/tmp.
Apr 04 01:34:14 gentoo-mediacenter systemd[287]: Unit mnt-tmp.mount is bound to inactive unit. Stopping, too.
Apr 04 01:34:16 gentoo-mediacenter systemd[287]: Unmounting /mnt/tmp...
Apr 04 01:34:16 gentoo-mediacenter systemd[287]: mnt-tmp.mount mount process exited, code=exited status=1
Apr 04 01:34:16 gentoo-mediacenter systemd[287]: Failed unmounting /mnt/tmp.
Apr 04 01:34:16 gentoo-mediacenter systemd[287]: Unit mnt-tmp.mount is bound to inactive unit. Stopping, too.
Apr 04 01:34:16 gentoo-mediacenter systemd[287]: Unmounting /mnt/tmp...
Apr 04 01:34:16 gentoo-mediacenter umount[7268]: umount: /mnt/tmp: umount failed: Operazione non permessa
Apr 04 01:34:16 gentoo-mediacenter systemd[287]: mnt-tmp.mount mount process exited, code=exited status=1
Apr 04 01:34:16 gentoo-mediacenter systemd[287]: Failed unmounting /mnt/tmp.
Apr 04 01:34:16 gentoo-mediacenter systemd[287]: Unit mnt-tmp.mount is bound to inactive unit. Stopping, too.
Apr 04 01:34:16 gentoo-mediacenter systemd[287]: Unmounting /mnt/tmp...
Apr 04 01:34:16 gentoo-mediacenter umount[7270]: umount: /mnt/tmp: umount failed: Operazione non permessa
Apr 04 01:34:16 gentoo-mediacenter umount[7271]: umount: /mnt/tmp: umount failed: Operazione non permessa
Apr 04 01:34:16 gentoo-mediacenter umount[7274]: umount: /mnt/tmp: umount failed: Operazione non permessa
Apr 04 01:34:16 gentoo-mediacenter umount[7276]: umount: /mnt/tmp: umount failed: Operazione non permessa
Apr 04 01:34:16 gentoo-mediacenter umount[7278]: umount: /mnt/tmp: umount failed: Operazione non permessa
Apr 04 01:34:16 gentoo-mediacenter umount[7282]: umount: /mnt/tmp: umount failed: Operazione non permessa
Apr 04 01:34:16 gentoo-mediacenter systemd[287]: mnt-tmp.mount mount process exited, code=exited status=1
Apr 04 01:34:16 gentoo-mediacenter systemd[287]: Failed unmounting /mnt/tmp.

and so on. So systemd was continuously trying to unmount /mnt/tmp, but had no permission ("Operazione non permessa" = "Operation not permitted") to do that (why? Is it because I mounted it as root?). This also caused the journal to rotate because I set SystemMaxUse=200M in /etc/systemd/journald.conf

Should I report some of my "experience" to https://bugs.gentoo.org/show_bug.cgi?id=541402 or https://bugs.freedesktop.org/show_bug.cgi?id=89383 ?

Edit: just tried patch https://bugs.gentoo.org/show_bug.cgi?id=541402#c6 , run "systemctl daemon-reexec && systemctl daemon-reload" (if it does make any sense), mounts correctly but floods the journal with the same message, and systemd process eats cpu cycles. Rebooted, now it's working.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum