Skip to content

check the drives filesystem and only use snapper on btrfs#2936

Open
ecruzolivera wants to merge 1 commit intobasecamp:masterfrom
ecruzolivera:snapshots-only-on-btrfs-drives
Open

check the drives filesystem and only use snapper on btrfs#2936
ecruzolivera wants to merge 1 commit intobasecamp:masterfrom
ecruzolivera:snapshots-only-on-btrfs-drives

Conversation

@ecruzolivera
Copy link

@ecruzolivera ecruzolivera commented Oct 28, 2025

Hi, in my setup I have two drives, one btrfs for root and another ext4 for home, the current omarchy-snapshot script assumes that all drives are Btrfs.

@ecruzolivera ecruzolivera changed the title check the drivers filesystem and only use snapper on btrfs check the drives filesystem and only use snapper on btrfs Oct 28, 2025
@dhh dhh requested a review from ryanrhughes October 29, 2025 10:05
@ecruzolivera
Copy link
Author

Hi @ryanrhughes, just a friendly reminder of this.

@ryanrhughes
Copy link
Collaborator

@ecruzolivera What's the issue this solves exactly? If you don't have btrfs for a drive, it won't have a snapper config so it'd already be ignored unless I'm misunderstanding.

@ecruzolivera
Copy link
Author

@ecruzolivera What's the issue this solves exactly? If you don't have btrfs for a drive, it won't have a snapper config so it'd already be ignored unless I'm misunderstanding.

Hello, this script will limit snapper to only be called on btrfs partitions.

I have two drives, one for /root that has btrfs and another for /home that it is ext4. Without this script, the snapper script will report all partitions to be snapped including the ext4 ones.

sudo snapper --csvout list-configs | awk -F, 'NR>1 {print $1}'
home
root

And therefore the script will fail when trying to snap an ext4 partition.

My script will check if the partition is Btrfs before trying to snap it

 if [[ -d $path ]] && [[ "$(findmnt -n -o FSTYPE --target "$path")" == "btrfs" ]]; then
      sudo snapper -c "$name" create -c number -d "$DESC"
 fi

Please let me know if I was able to explain myself properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants