#!/bin/sh # # LXC to btrfs subvolume converter # Convert the LXC rootfs into a btrfs subvolume to # backup with btrfs snapshots. # for rootfs in /var/lib/lxc/*/rootfs; do { mv "${rootfs}" "${rootfs}.saved" btrfs subvolume create "${rootfs}" mv "${rootfs}.saved"/* "${rootfs}" rmdir "${rootfs}.saved" echo "${rootfs} to subvolume\n" } done #for rootfs in /var/lib/lxc/*/rootfs; #do # echo "${rootfs}" #done