【SOLVED】/dev/sda is in use and contains a unknown filesystem

I would like to build lxd container in a blank disk, but I can’t bulid it.

Would you like to use LXD clustering? (yes/no) [default=no]:
Do you want to configure a new storage pool? (yes/no) [default=yes]:
Name of the new storage pool [default=default]: satassdlxd
Name of the storage backend to use (zfs, ceph, btrfs, dir, lvm) [default=zfs]:
Create a new ZFS pool? (yes/no) [default=yes]:
Would you like to use an existing empty block device (e.g. a disk or partition)? (yes/no) [default=no]: yes
Path to the existing block device: /dev/sda
Would you like to connect to a MAAS server? (yes/no) [default=no]:
Would you like to create a new local network bridge? (yes/no) [default=yes]: no
Would you like to configure LXD to use an existing bridge or host interface? (yes/no) [default=no]: yes
Name of the existing bridge or host interface: br0
Would you like the LXD server to be available over the network? (yes/no) [default=no]:
Would you like stale cached images to be updated automatically? (yes/no) [default=yes]
Would you like a YAML "lxd init" preseed to be printed? (yes/no) [default=no]:
Error: Failed to create storage pool 'satassdlxd': Failed to run: zpool create -f -m none -O compression=on satassdlxd /dev/sda: /dev/sda is in use and contains a unknown filesystem.

If you know for a fact that /dev/sda isn’t in use (I’d confirm with grep sda /proc/*/mountinfo), then you may need to wipe its beginning so that ZFS doesn’t consider it to be used.

You’d normally do dd if=/dev/zero of=/dev/sda bs=4M count=10 to achieve that, but first make very very sure that the ZFS error isn’t correct as if that drive is used for your bootloader, swap or anything else, you’ll have a very very bad day :slight_smile:

1 Like