[lxc-users] Using shiftfs with NFS mounted filesystem

Michael Eager eager at eagerm.com
Sat Jul 18 23:35:14 UTC 2020


On 7/18/20 12:14 PM, Narcis Garcia wrote:
> This issue seems more apropriate here:
> https://github.com/containers/fuse-overlayfs

Why?

The shiftfs module is a kernel module, not a userspace FUSE implementation.


> 
> 
> Narcis Garcia
> 
> __________
> I'm using this dedicated address because personal addresses aren't
> masked enough at this mail public archive. Public archive administrator
> should fix this against automated addresses collectors.
> El 18/7/20 a les 20:16, Michael Eager ha escrit:
>> I'm running LXD on a Centos 8 host, kernel-4.18.0.  I built and
>> installed the shiftfs module.
>>
>> I added a device to a container which mounts a local file system in the
>> container:
>> $ lxc config device add devel devel disk path=/<container-path>
>> source=/<host-path> shift=true
>> (Both container and mounted fs are named "devel".)
>>
>> This appears to work with a local FS.  Files which were owned by "root"
>> on the host system show up as owned by "root" in the container, not by
>> "nobody".  I can create and delete files normally.
>>
>> When the host filesystem is NFS mounted, it initially appears correct in
>> the container, but there are several odd behaviors:
>>
>> Creating a file:
>> [eager at devel devel]$ cd tmp
>> [eager at devel tmp]$ ls
>> [eager at devel tmp]$ touch x
>> touch: cannot touch 'x': Permission denied
>> [eager at devel tmp]$ ls -l
>> total 512
>> -rw-rw-r-- 1 eager eager 0 Jul 18 17:56 x
>>
>> Deleting a file:
>> [eager at devel tmp]$ rm x
>> rm: remove write-protected regular empty file 'x'? y
>> rm: cannot remove 'x': Permission denied
>> [eager at devel tmp]$ ls -l
>> total 512
>> -rw-rw-r-- 1 eager eager 0 Jul 18 17:56 x
>>
>> When I remove the file 'x' on the host, it's gone in the container, but
>> trying to create 'x' again fails with a different error:
>> [eager at devel tmp]$ ls -l
>> total 0
>> [eager at devel tmp]$ touch x
>> touch: cannot touch 'x': Stale file handle
>> [eager at devel tmp]$ ls -l
>> total 0
>>
>> But I can create a different file 'y', albeit with the permission error:
>> [eager at devel tmp]$ touch y
>> touch: cannot touch 'y': Permission denied
>> [eager at devel tmp]$ ls -l
>> total 1.0K
>> -rw-rw-r-- 1 eager eager 0 Jul 18 18:07 y
>>
>>
>> Something seems to be broken.  Is there a way to fix this?
>>
> _______________________________________________
> lxc-users mailing list
> lxc-users at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-users
> 



More information about the lxc-users mailing list