Deleting all FreeBSD jails

Software

There are tons of guides online for creating jails, and an always excellent page in the handbook, but precious few instructions for deleting them.

Assuming you used ezjail with default settings, you can blow them all away with this:

# echo "WARNING, THIS WILL DELETE ALL OF THEM!"
# chflags -R noschg /usr/jails
# rm -rf /usr/jails

Then you can start over again; as opposed to just starting again, or starting over. I remember noschg by thinking of Benedict Reuschling :).

Wait, I don’t think I’ve ever posted about using jails here, or ezjail, or even iocage. Making a mental and physical note to correct this.

Author bio and support

Me!

Ruben Schade is a technical writer and IaaS engineer in Sydney, Australia who refers to himself in the third person in bios. Wait, not BIOS… my brain should be EFI by now.

The site is powered by Hugo, FreeBSD, and OpenZFS on OrionVM, everyone’s favourite cloud infrastructure provider.

If you found this post helpful or entertaining, you can shout me a coffee or buy some silly merch. Thanks!