From e2eda9ab032e54325d9b6213485a1b692680ddb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Graber?= Date: Fri, 15 Dec 2023 17:06:20 -0500 Subject: [PATCH] lxd-to-incus: Add shiftfs check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #309 Signed-off-by: Stéphane Graber --- cmd/lxd-to-incus/validate.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/cmd/lxd-to-incus/validate.go b/cmd/lxd-to-incus/validate.go index 0078f879397..e340c7b8f93 100644 --- a/cmd/lxd-to-incus/validate.go +++ b/cmd/lxd-to-incus/validate.go @@ -10,6 +10,7 @@ import ( "github.com/lxc/incus/internal/linux" "github.com/lxc/incus/internal/version" incusAPI "github.com/lxc/incus/shared/api" + "github.com/lxc/incus/shared/util" ) var minLXDVersion = &version.DottedVersion{4, 0, 0} @@ -392,5 +393,21 @@ func (c *cmdMigrate) validate(source Source, target Target) error { return fmt.Errorf("Source daemon running on btrfs but being moved to non-btrfs target") } + // Shiftfs check. + if util.PathExists("/sys/module/shiftfs/") { + fmt.Println("") + fmt.Println("WARNING: The shiftfs kernel module was detected on your system.") + fmt.Println(" This may indicate that your LXD installation is using shiftfs") + fmt.Println(" to allow shifted passthrough of some disks to your instance.") + fmt.Println("") + fmt.Println(" Incus does not support shiftfs but instead relies on a recent") + fmt.Println(" feature of the Linux kernel instead, VFS idmap.") + fmt.Println("") + fmt.Println(" If your instances actively rely on shiftfs today, you may need") + fmt.Println(" to update to a more recent Linux kernel or ZFS version to keep") + fmt.Println(" using this shifted passthrough features.") + fmt.Println("") + } + return nil }