[lxc-users] fstab and lxc

Fajar A. Nugraha list at fajar.net
Fri Nov 13 07:33:24 UTC 2015


On Fri, Nov 13, 2015 at 1:58 PM, Eldon Kuzhyelil <eldon.mec at gmail.com>
wrote:

> Hi,
> I'm trying to set up two LXC containers where one contains a python
> programm and the other contains my postgres database.I have got the
> connection between two containers.Now im stuck with fstab configuration
> file.The fstab file in my system is as below:
>
> root at eldon-X550LC:/home/eldon# lxc-ls -f
> NAME                STATE    IPV4       IPV6  AUTOSTART
> -------------------------------------------------------
> my_lxc_ubuntu       RUNNING  10.0.3.87  -     NO
> postgresLXC_ubuntu  STOPPED  -          -     NO
>
> root at eldon-X550LC:/home/eldon# less /etc/fstab
>
> # /etc/fstab: static file system information.
> #
> # Use 'blkid' to print the universally unique identifier for a
> # device; this may be used with UUID= as a more robust way to name devices
> # that works even if disks are added and removed. See fstab(5).
> #
> # <file system> <mount point>   <type>  <options>       <dump>  <pass>
> # / was on /dev/sda6 during installation
> UUID=0c85eedf-589a-4dd3-a2e3-41e133a7dc13 /               ext2
> errors=remount-ro 0       1
> ~
> ~
> ~
>
> But when i am trying to view the fstab file inside my LXC container i am
> getting this:
>
> ubuntu at my_lxc_ubuntu:~$ less /etc/fstab
> # UNCONFIGURED FSTAB FOR BASE SYSTEM
> ...skipping...
> # UNCONFIGURED FSTAB FOR BASE SYSTEM
>
> Is there any error here?
>
>
... and your problem is?

/etc/fstab inside the container is pretty much ignored. At least when using
ubuntu, the default apparmor policy would prevent the containers from being
able to mount anything. Which is normal. All container mounts are done on
the host side (including via container's config file).

When NOT using apparmor-capable distro, or when you specifically allow
mounts inside the container, it's still best to let the host do the
mounting.

So an empty fstab INSIDE the container is normal. Nothing wrong with that.

-- 
Fajar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20151113/63a4dee6/attachment.html>


More information about the lxc-users mailing list