Installation of Ubuntu in BTRFS subvolumes
Smoot Carl-Mitchell
smoot at tic.com
Sat Dec 21 23:23:09 UTC 2024
On Sat, 2024-12-21 at 22:40 +0000, Bernd Lentes wrote:
>
> Hi Smoot,
>
> when and how did you create the subvolumes ?
> Have they been already available during installation of Ubuntu ?
The backup instances are snapshots which are subvolumes. After I
backup my servers to the backup filesystem, I run this script:
BACKUPDIR=/backup
date=`date +%Y-%m-%d`
year=`date +%Y`
[ -d $BACKUPDIR/.snapshots/$year ] || mkdir $BACKUPDIR/.snapshots/$year
btrfs subvolume snapshot -r $BACKUPDIR
$BACKUPDIR/.snapshots/$year/$date
The btrfs command effectively make a snapshot of the entire filesystem
which is mounted on /backup
I do a few other housekeeping chores to delete old snapshots, but the
above is where the snapshot volumes are created. I do this daily, out
of cron which is why the snapshots are named the way they are.
".snapshot" is just a convenient name and can be anything.
Please keep in mind because of BTRF's copy on write, each snapshot only
reflects the differences from the previous snapshot. As a result each
snapshot is not a true backup, but is reliable enough for my purposes.
--
Smoot Carl-Mitchell
System/Network Architect
voice: +1 480 922-7313
cell: +1 602 421-9005
smoot at tic.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20241221/44237fe8/attachment.html>
More information about the ubuntu-users
mailing list