Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

skip scrub and trim on virtual hardware #126

Open
Framsfex opened this issue Sep 16, 2024 · 0 comments
Open

skip scrub and trim on virtual hardware #126

Framsfex opened this issue Sep 16, 2024 · 0 comments

Comments

@Framsfex
Copy link

scrub and trim do not make sense on virtual hardware, it should be done on the host system.

I have added to /etc/default/btrfsmaintenance

if grep -qi virtual /sys/devices/virtual/dmi/id/product_name; then
  HARDWARE="virtual"
else
  HARDWARE="real"
fi
(...)
if [ "$HARDWARE" = "virtual" ]; then
  BTRFS_SCRUB_PERIOD="none"
else
  BTRFS_SCRUB_PERIOD="monthly"                                                                                                                                                                 
fi   
(...)
 if [ "$HARDWARE" = "virtual" ]; then
  BTRFS_TRIM_PERIOD="none"                                                                                                                                                                     
elif systemctl is-enabled fstrim 2>/dev/null | grep -q static; then
  # /lib/systemd/system/fstrim.timer                                                                                                                                                           
  BTRFS_TRIM_PERIOD="none"
else
  BTRFS_TRIM_PERIOD="weekly"
fi                                                                                                                                                                                             
                                                                                                                                                                                         
@Framsfex Framsfex changed the title skip filesystems on virtual hardware skip scrub and trim on virtual hardware Sep 16, 2024
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

No branches or pull requests

1 participant