fstrim: cannot open /dev/.lxd-mounts: Permission denied
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
util-linux (Debian) |
Fix Released
|
Unknown
|
|||
util-linux (Ubuntu) |
Fix Released
|
Medium
|
Eric Desrochers | ||
Xenial |
Fix Released
|
Medium
|
Eric Desrochers | ||
Bionic |
Fix Released
|
Medium
|
Eric Desrochers | ||
Disco |
Fix Released
|
Medium
|
Eric Desrochers |
Bug Description
[Impact]
fstrim weekly cronjob output in an unprivileged LXD container:
/etc/cron.
fstrim: cannot open /dev/.lxd-mounts: Permission denied
fstrim: /dev/fuse: not a directory
fstrim: /dev/lxd: FITRIM ioctl failed: Operation not permitted
There is a github issue:
https:/
The outcome is that it's purely an fstrim misbehaviour, it could be smarter.
Stephane Graber comment:
As all of this is handled by the kernel, there isn't anything we can do about it in LXD.
I think fstrim should be made slightly more clever:
* Don't run on bind-mounts (you can detect bind-mounts by parsing /proc/self/
* Maybe not be as noisy on expected errors like EACCES, EPERM and ENOENT, only log actual failures which would likely be EINVAL or memory related errors.
ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: util-linux 2.27.1-6ubuntu3
ProcVersionSign
Uname: Linux 4.4.0-21-generic x86_64
ApportVersion: 2.20.1-0ubuntu2.1
Architecture: amd64
Date: Sun Jun 5 19:49:04 2016
ProcEnviron:
LANGUAGE=en_US:en
TERM=xterm
PATH=(custom, no user)
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: util-linux
UpgradeStatus: No upgrade log present (probably fresh install)
[Test Case]
* Ubuntu lxd container
* Wait for the scheduled fstrim run (X: cronjob, B and late: systemd timer)
* fstrim will run and report errors "Operation not permitted" "Permission denied", ...
Container shouldn't run fstrim, it should only be run at host level.
[Potential Regression]
None, the change will only block fstrim to be automatically run at scheduled time. One can still run fstrim on a container manually, even if there is no purpose of doing that.
Xenial uses the cronjob approach /etc/cron.
Bionic and late switched to a systemd timer.
2 differents fixes (one for X, and one for B and late) will be needed, but they'll do same thing, which prevent fstrim to automatically run if inside a container both fixes using systemd-
[Other Informations]
* The systemd timer change upstream PR:
https:/
https:/
Changed in util-linux (Ubuntu): | |
importance: | Undecided → Medium |
description: | updated |
Changed in util-linux (Ubuntu): | |
status: | Confirmed → In Progress |
assignee: | nobody → Eric Desrochers (slashd) |
Changed in util-linux (Ubuntu Xenial): | |
assignee: | nobody → Eric Desrochers (slashd) |
status: | New → In Progress |
Changed in util-linux (Ubuntu Bionic): | |
assignee: | nobody → Eric Desrochers (slashd) |
Changed in util-linux (Ubuntu Disco): | |
assignee: | nobody → Eric Desrochers (slashd) |
Changed in util-linux (Ubuntu Xenial): | |
importance: | Undecided → Medium |
Changed in util-linux (Ubuntu Bionic): | |
importance: | Undecided → Medium |
Changed in util-linux (Ubuntu Disco): | |
importance: | Undecided → Medium |
description: | updated |
tags: | added: sts |
Changed in util-linux (Ubuntu Bionic): | |
status: | Confirmed → In Progress |
Changed in util-linux (Ubuntu Disco): | |
status: | Confirmed → In Progress |
description: | updated |
Changed in util-linux (Debian): | |
status: | Unknown → New |
Changed in util-linux (Debian): | |
status: | New → Confirmed |
Changed in util-linux (Debian): | |
status: | Confirmed → Fix Released |
Status changed to 'Confirmed' because the bug affects multiple users.