Gentoo Archives: gentoo-user

From: Rich Freeman <rich0@g.o>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] lxc filling /dev
Date: Mon, 17 Feb 2020 02:14:07
Message-Id: CAGfcS_kaK4sm0O1NpcjesWenCBKY6MzFv17y2L1UCgkw0790iQ@mail.gmail.com
In Reply to: [gentoo-user] lxc filling /dev by William Kenworthy
1 On Sun, Feb 16, 2020 at 7:57 PM William Kenworthy <billk@×××××××××.au> wrote:
2 >
3 > 2 ~ # lxc-attach -n mail -- bash -c "df -h"
4 > none 492K 320K 172K 66% /dev
5 > du and ls -al do not give any clues, the host /dev is normal and all
6 > running lxc instances do it, but at different rates
7
8 Are you running ls -al from INSIDE the container? If you're running
9 it on the host you won't see anything because it is almost certainly
10 in a separate mount namespace, and so it is invisible from the host.
11 In particular, any files you see in rootdir/dev from the host are NOT
12 visible in the container, and vice-versa.
13
14 I don't use lxc, but if I had to take a wild guess your /dev isn't
15 being properly initialized inside, and some typical device node is
16 being created as a regular file and stuff like "echo foo > /dev/null"
17 is actually writing to a real file there, filling up the tmpfs.
18
19 Try:
20 lxc-attach -n mail -- bash -c "ls -l --recursive /dev"
21
22 Or launch an interactive shell inside the container and just poke
23 around in there. I have no idea what the "lxc way" to launch a shell
24 is, but you can always use:
25 nsenter --target <pid> --all /bin/bash
26 (where <pid> is the pid on the host of a process inside the container)
27
28 nsenter is part of util-linux
29
30 --
31 Rich

Replies

Subject Author
Re: [gentoo-user] lxc filling /dev William Kenworthy <billk@×××××××××.au>