NFS mount on LXC container

Discussion in 'Proxmox VE: Installation and configuration' started by SamTzu, Apr 19, 2018.

Tags:
  1. SamTzu

    SamTzu Member

    Joined:
    Mar 27, 2009
    Messages:
    352
    Likes Received:
    4
    I have been testing NFS mounts on LXC containers and they work mostly ok after you have modified App-Armour settings on the host. Problems arise when the LXC containers are moved or host-node restarts.
    LXC container does not always seem to honor the /etc/fstab settings which results in mounts not working which results in Apache and email braking down because they are stored on NFS share somewhere else.

    I'm wondering what kind of solutions you are familiar with to combat this problem?

    How can I automate a "test" that checks if NFS share is mounted and if it's not then tries "mount -a" again?
     
  2. fabian

    fabian Proxmox Staff Member
    Staff Member

    Joined:
    Jan 7, 2016
    Messages:
    3,132
    Likes Received:
    479
    you should mount NFS on the host, and bind mount it into the container (if you mount the NFS share on all hosts on the same path, you can set the "shared" flag for the bind mount in the container and migration works)
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. lethargos

    lethargos Member
    Proxmox VE Subscriber

    Joined:
    Jun 10, 2017
    Messages:
    84
    Likes Received:
    0
    Hi. Can you please expand on your answer? Are you saying that there's a way of mounting it in the lxc-container without fstab? How do you mount from the host to the lxc container if the container is configured with lvm (by default, of course)?
     
  4. fabian

    fabian Proxmox Staff Member
    Staff Member

    Joined:
    Jan 7, 2016
    Messages:
    3,132
    Likes Received:
    479
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice