Configure Core 16 OS Filesystem

Hi folks!

Apologies if this is answered, I’ve been Googling my ass off and gotten lost in the maze of forum posts and documentation versions.
I would like to pxe-deploy Ubuntu Core 16 to a handful of x64 boxes, and define a custom partition layout they’ll all use, including a zfs data partition that lxd will use.

It looks like I need to write a gadget snap to define the partitions. I’ve gotten as far as building my own iso using the ubuntu-image tool and defining a model snap, that was reasonably straightforward (ish!) but the filesystem stuff looks more complex.

Before I get into the weeds, am I barking up the right tree here? Is there some other method that’s recommended to accomplish this?

core is curretly restricted to ext4 and heavily relies on filesystem labels to make the writable bits of the image available during boot. to support zfs the zfs module would be needed inside the initrd and the “writable” label would be needed to find the partition …

code is at:

1 Like

The ZFS fs would be a separate partition in this scenario, needed for LXD container storage volumes. So unless I’m unaware of a restriction here, the ZFS work can be done once the system is up and running - it’s totally fine for the Core 16 system to live on a separate (bunch of?) ext4 partitions.

ubuntu-image will always create two partitions regardless, one vfat for system-boot holding bootloader bits (on x86 thats only grub.cfg i think) and the “writable” labeled ext4 rootfs partition… anything else you define in gadget.yaml is completely up to you. so yeah, if your zfs is desired as an additional partition there should nothing stop you from defining it … that said, i’m not sure how well ubuntu-image will be able to handle creation of zfs partitions, there might be code missing (worth a try i guess … and a wishlist bug if it does not work)