4xSSD BTRFS Cache Pool Snapshots


Go to solution Solved by JorgeB,

Recommended Posts

I configured 4x1TB SSDs as BTRFS RAID1 cache pool for media only shares. I did an initial scrub, configured a weekly scrub and monthly balance. I have a separate backup scheme in case of trouble. Everything appears to be working fine but the test of time is needed.

 

I've used ZFS snapshots on PROXMOX and wanted to explore BTRFS snapshots with UNRAID.

See https://linuxhint.com/use-btrfs-snapshots/

 

btrfs subvolume list /mnt/cache_raid returns blank.

Maybe because there's only top root subvolume with no label?

Can you confirm UNRAID does not create subvolumes for each share that uses this cache pool?

 

btrfs filesystem show /mnt/cache_raid/
Label: none  uuid: bbdb2e06-2722-4d3a-80d2-XXXX
        Total devices 4 FS bytes used 325.33GiB
        devid    1 size 931.51GiB used 164.00GiB path /dev/sdb1
        devid    2 size 931.51GiB used 163.03GiB path /dev/sdc1
        devid    3 size 931.51GiB used 163.03GiB path /dev/sdd1
        devid    4 size 931.51GiB used 164.00GiB path /dev/sde1

 

btrfs subvolume show /mnt/cache_raid/
/
        Name:                   <FS_TREE>
        UUID:                   901b6a05-c459-4c95-a11f-XXXX
        Parent UUID:            -
        Received UUID:          -
        Creation time:          2023-01-05 16:56:59 -0800
        Subvolume ID:           5
        Generation:             151
        Gen at creation:        0
        Parent ID:              0
        Top level ID:           0
        Flags:                  -
        Send transid:           0
        Send time:              2023-01-05 16:56:59 -0800
        Receive transid:        0
        Receive time:           -
        Snapshot(s):

 

So pls confirm the commands to make a read only snapshot of top level BTRFS:

mkdir -v /mnt/cache_raid/.snapshots - create snapshot directory

btrfs subvolume snapshot -r /mnt/cache_raid /mnt/cache_raid/.snapshots/`hostname`-`date +%y%m%d`-`date +%H%M`

btrfs subvolume list /mnt/cache_raid - list subvolumes and snapshots

 

Comments and feedback if I should stay away from exploring this are welcome.

Link to comment
  • Solution
4 hours ago, cometship said:

Maybe because there's only top root subvolume with no label?

Can you confirm UNRAID does not create subvolumes for each share that uses this cache pool?

Correct, it's should in the future but not for now, you need to create them manually or by using the snapshots plugin.

 

4 hours ago, cometship said:

btrfs subvolume snapshot -r /mnt/cache_raid /mnt/cache_raid/.snapshots/`hostname`-`date +%y%m%d`-`date +%H%M`

First you must create the subvolume

 

btrfs sub create /mnt/cache_raid/subvolume_name

 

Note that the subvolume_name will also act as a share, then:

 

btrfs subvolume snapshot -r /mnt/cache_raid/subvolume_name /mnt/cache_raid/.snapshots/`hostname`-`date +%y%m%d`-`date +%H%M`

 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.