This repo provides scripts to install the (Linux) kernel module shiftfs via dkms.
This Repository: | Upstream development: |
---|---|
inactive at the moment | active |
shiftfs is a kernel filesystem for the Linux kernel.
It provides easier uid/gid-shifting for containers and can be used for example with LXD (see also: Usecases).
shiftfs was made by:
See Credits
- Further information on shiftfs can be found in the official LXD Forum: https://discuss.linuxcontainers.org/t/trying-out-shiftfs/5155
The official successor of shiftfs is available now, see details below.
The original shiftfs (the version used in this repo) is still available for:
- Newer kernel versions (the end of support is unknown for now, upstream will probably announce it someday (see also: Issue 24)), including: 6.1 and more
- Longterm kernel versions: 5.15, 5.10 and 5.4
See Overview of Branches/Versions below for more information on each available version in this repo.
The new approach called "idmapped mounts" is natively included in recent Linux kernels (since kernel version 5.12) - so there is no need for dkms-modules anymore. Support for the new approach is implemented since LXD version 4.16, and the transition is seamless, so LXD will automatically switch to the new approach, if available and all commands/options stay the same.
Note: For now there are some limitations though, as only ext4, xfs, vfat and btrfs (since kernel version 5.15) are supported as underlying filesystems for containers and volumes.
ZFS and cephfs are planned to be supported in future kernels or seperately.
So if you use unsupported filesystems, I recommend to use the original shiftfs for now, until support for them is included in the new approach.
Sources:
There are different versions of shiftfs.c for different kernel versions, so I cover a few of them:
Note: I only test the most recent branch regularly, all others are not regularly tested.
Branch/Version: | For Kernel(version): | Further Notes: |
---|---|---|
- | 6.3.x | I did not set up a branch yet, but you can try to replace the shiftfs.c file from k6.1 with this one. You also need to adjust dkms.conf. |
k6.1 | 6.1.x and 6.2.x | Does not work with 6.0.x. Also take a look at the Notes! |
k5.18 | 5.18.x, 5.19.x (and probably 6.0.x) | 5.19.x and 6.0.x are not tested. Kernel versions are deprecated upstream, see kernel.org. |
k5.17 | 5.17.x | Kernel version is deprecated upstream, see kernel.org. |
k5.16 | 5.15.x (longterm version) (and probably 5.16.x) | - |
k5.13 | 5.13.x (and probably 5.14.x) | Kernel versions are deprecated upstream, see kernel.org. |
k5.10 | 5.10.x (longterm version) and 5.8.x | - |
k5.4 | 5.4 (longterm version) | - |
Arch Linux Packages in AUR | for packages "linux" and "linux-lts" | see the AUR pages for more details. |
Other kernel versions that are newer than 5.x might work, but there is no guarantee and I will not provide that. You have the best chances if you search inside the Ubuntu kernel repos and might find a version that matches your kernel version (e.g. hirsute kernel repo - master next for 5.11).
shiftfs will most likely not work on kernels older than version 5.x. Thus the only recent and active branch newer than 5 is 5.4. See also kernel.org.
-
Regarding Overlayfs inside a container: shiftfs can prevent the use of overlayfs inside a container.
A usecase for this is running Docker with the overlayfs-storage driver inside a lxd container.
A Kernelpatch that solves this is available, but it's not included in the mainline kernel (yet). To my knowledge only Ubuntu included it (see solved bug report).For workarounds and more information see: Issue 2 of this repo
-
More Issues may be found in the Ubuntu Kernel Bug Tracker.
If you want to post a testreport, take a look at: Testreports Issue on Github.
-
LXD:
How to use shiftfs with LXD is described in my wiki
and in the official Forum of LXD: Usecases for shiftfs and Trying out shiftfs.
Report bugs at: https://github.com/toby63/shiftfs-dkms/issues
-
shiftfs was made by:
- James Bottomley
- Seth Forshee [email protected]
- Christian Brauner [email protected]
(recent info is in the shiftfs.c file (See: footer -> tag: MODULE_AUTHOR))
-
Some files are based on the Debian package repo of bbswitch (https://salsa.debian.org/nvidia-team/bbswitch), including:
- dkms.conf
- Makefile
- Makefile.dkms
-
Special thanks to:
- Stéphane Graber @stgraber
- Christian Brauner @brauner
for the helpful advice.
General Public License, Version 2
See: LICENSE