Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add config parameter for /dev tmpfs size #3128

merged 1 commit into from Oct 4, 2019


Copy link

commented Aug 28, 2019

Second try's a charm. Sorry. Closed the other PR in favour for this PR.

This PR wants to solve an issue with a limited size of the /dev tmpfs, which already happened a while ago in #781. Back then the size of the /dev tmpfs was increased but with a fixed size.
Under some rare but real circumstances, the /dev tmpfs can run out of space. Here from a real container in production:

root@irnsrvc16 ~ # df -h /dev
Filesystem     Type   Size  Used Avail Use% Mounted on
none           tmpfs  492K  492K     0 100% /dev

The reason in this case is that this specific container is used as central syslog server (using syslog-ng) for a couple dozen other LXC containers. syslog-ng uses its console logging to /dev/tty10, which just uses up the whole space

root@irnsrvc16 ~ # ll /dev/tt*
crw-rw-rw- 1 root root   5, 0 Aug 21  2018 /dev/tty
crw--w---- 1 root tty  136, 0 Aug 21  2018 /dev/tty1
-rw-r----- 1 root adm  503808 Aug 23 09:21 /dev/tty10
crw--w---- 1 root tty  136, 1 Aug 21  2018 /dev/tty2
crw--w---- 1 root tty  136, 2 Aug 21  2018 /dev/tty3
crw--w---- 1 root tty  136, 3 Aug 21  2018 /dev/tty4

This is just one practical example. There may be other uses cases where /dev may run out of space.

Important: The current default of 500K as tmpfs size will stay unless lxc.devfs_size is used to overwrite that value. This way security to protect against a misbehaving software spamming /dev is in place, yet the admin has the freedom to increase (or decrease) the default size for his own reasons.


This comment has been minimized.

Copy link

commented Aug 28, 2019

This pull request didn't trigger Jenkins as its author isn't in the whitelist.

An organization member must perform one of the following:

  • To have this branch tested by Jenkins, use the "ok to test" command.
  • To have a one time test done, use the "test this please" command.

Those commands are simple Github comments of the format: "jenkins: COMMAND"

Copy link

left a comment

I have no objection to the change in general but I think the name for the config key is not very nice. How about:



//Cc @stgraber, @hallyn, @Blub


This comment has been minimized.

Copy link
Contributor Author

commented Aug 28, 2019

Yep, the name is not fixed in stone (@brauner you understand this ;-) ), we can vote on the parameter name.

lxc.autodev.tmpfs.size sounds pretty good and is self-explanatory (for most users anyway).

src/lxc/conf.c Outdated Show resolved Hide resolved
@Napsty Napsty changed the title Add devfs_size config parameter Add config parameter for /dev tmpfs size Aug 30, 2019

This comment has been minimized.

Copy link

commented Oct 4, 2019

lgtm, but please squash the two commits.

Signed-off-by: Claudio Kuenzler <>
@hallyn hallyn force-pushed the Napsty:add-parameter-devfs_size branch from a38a78e to 63012bd Oct 4, 2019
@hallyn hallyn merged commit 83bac1b into lxc:master Oct 4, 2019
2 of 3 checks passed
2 of 3 checks passed
continuous-integration/travis-ci/pr The Travis CI build is in progress
Branch target Branch target is correct
DCO All commits signed-off
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
4 participants
You can’t perform that action at this time.