Spin down attached disks with udisks2 Dbus?

How should I configure spin down of unused attached disks?

I need spin down for my archive server snap (not published yet), which will need access to the disks only 2 times a week or so.

As far as I know the default configuration of my RPI3 never spins down disks, because I have not found a configuration option to specify that.

The standard policies won’t allow setting of the APM (advanced power mgnt) Configuration via udisks2 Dbus and generate apparmor denials if you try, even when using sudo. So my “sudo dbus-send Confiuration … APM …” command does not work, let alone from within a snap.

By the way the “sudo hdparm …” command works, but installing that seems overkill to me, because the dbus-send command is already available and should be able to configure spin-down of the disks. Also, I can’t use hdparm in a strict confined snap.

Should there be an “interface” that accepts spin down instructions, just like the udisks2 interface accepts mount instructions? (too difficult for me to build, I’m afraid).

Or should I just make my own ubuntu-core image? And what would then be a wise course of implementation?

did you actually install the udisks2 snap ? udisks is not on the core image by default but there is a snap… you should even be able to write another snap with a little script in it that talks to udisks2 via teh snap interface it provides to then toggle the setting as needed …