Closed priceaj closed 6 months ago
You can use any container image as system service so you basically need create container which have fstrim
command included and setup entrypoint in way that it will run when container starts and contained stops after that.
Then just include needed volumes to it and set cron schedule.
BurmillaOS Version: (ros os version) v1.9.6
Where are you running BurmillaOS? (docker-machine, AWS, GCE, baremetal, etc.) Hyper-V
Which processor architecture you are using? x64
Do you use some extra hardware? (GPU, etc)? No
Which console you use (default, ubuntu, centos, etc..) default
Do you use some service(s) which are not enabled by default? hyperv-vm-tools volume-nfs docker-compose
Have you installed some extra tools to console? No
Do you use some other customizations? No
Please share copy of your cloud-init (remember remove all sensitive data first)
Due to the way Hyper-V works with ext4 formatted virtual disks, Hyper-V will only compact the VHD for ext4 disks if the sectors are trimmed (i.e. zeroed out). Therefore I need to run trim
sudo fstrim -av
from the command line regularly to free up space used by the VHD file.For volumes attached via cloud-init, I can add the discard flag to enable trim, however the main BurmillaOS drive /dev/sda1 does not have discard enabled by default and requires the
fstrim
command to be run in order to free up the space.Is it possible to schedule a regular execution of
sudo fstrim -av
in BurmillaOS?crontab
does not seem to be available by default, and I don't know if there is another system scheduler available by default.It looks you might be able to create a custom service (https://burmillaos.org/docs/system-services/custom-system-services/), and schedule this via container crontab. But I don't understand how you would go about creating these services from the docs.
Any help would be appreciated.