1

So I'm running boot2docker (tiny-core). Somehow tmpfs has become mounted twice, once on /. There's a 5G limit so it very quickly get filled and obviously anything saved to this drive reduces the memory and performance of the machine.
So, question is, how do I unmount it? As soon as I boot up, obviously there's files on / and so sudo umount ... fails. Here's the setup...

df

Filesystem Size Used Available Use% Mounted on tmpfs 5.0G 183.6M 4.8G 4% / tmpfs 2.8G 0 2.8G 0% /dev/shm /dev/sda5 672.6G 6.5G 631.9G 1% /mnt/sda5 cgroup 2.8G 0 2.8G 0% /sys/fs/cgroup /dev/sda5 672.6G 6.5G 631.9G 1% /mnt/sda5/var/lib/docker/aufs 

cat /etc/fstab

proc /proc proc defaults 0 0 sysfs /sys sysfs defaults 0 0 devpts /dev/pts devpts defaults 0 0 tmpfs /dev/shm tmpfs defaults 0 0 /dev/zram0 swap swap defaults,noauto 0 0 /dev/sda1 /mnt/sda1 ntfs noauto,users,exec,ro,umask=000 0 0 # Added by TC /dev/sda2 /mnt/sda2 ntfs noauto,users,exec,ro,umask=000 0 0 # Added by TC /dev/sda5 /mnt/sda5 ext4 noauto,users,exec 0 0 # Added by TC /dev/sr0 /mnt/sr0 auto noauto,users,exec 0 0 # Added by TC 

1 Answer 1

1

tmpfs isn't a real filesystem. It's a ramdisk. It's perfectly normal for it to appear to be mounted multiple times.

In this instance, you have a tmpfs root filesystem (probably populated from a squashfs or tar file or something like that), and you have tmpfs for /dev/shm, which is a very common, typical use for tmpfs.

You don't need to unmount it, there's nothing wrong here, nothing to worry about.

Docker instances are supposed to be ephemeral - blow them away and restart them as needed. If you need persistent storage, then you'll need to start your docker image so that one or more directories from the docker host are mounted into the docker guest. or mount an NFS export or connect to a remote database or something.

BTW, most live-CD distros do the same kind of thing, with root as a tmpfs so that system & user programs can write to the rootfs. Of course, it all goes away when the system reboots.

2
  • Hi @cas, thanks. So to clarify, I understand that it may be mounted twice, the problem is that it’s mounted to /. So ANY saves to within / (which is everything) appears to take up space in tmpfs. One of the containers needs to persist videos, so that 5g limit gets hit really quickly. And then the container falls over. But it doesn’t really matter that it’s docker filling the drive. If I wget a large file, that does exactly the same, errors with disk full. Commented Aug 1, 2019 at 21:49
  • It's not a problem. It seems that's the way that particular docker image is supposed to work. And, as I said, docker images are supposed to be ephemeral anyway. For persistent storage, you need to mount it from the host or somewhere else. e.g. tell docker to mount a subdirectory of the host as /video and store your videos under that. e.g. using --volume option, like: --volume /path/to/video/dir:/video Commented Aug 1, 2019 at 22:02

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.