Systemd silence

Experiment used on asus p9d ws

Admin's own units go in /etc/systemd/system/, if maintaining someone elses system, use /run/systemd/system/ if programmatically generated, otherwise /lib/systemd/system/ and the system's package manager.

First lets stop the fans.

Having put operating system on SSD, have some disks for back up and less important applications.

Make some units for starting and stopping a imsm backed raid array, lets call it silencedisks.service

  1. [Unit]
  2. Description=disks silent mode
  3. Conflicts=various.automount automated-backups.service automated-backups.timer
  4. ExecStart=-/bin/sh -c "\
  5. until /sbin/vgchange -a n n; test -z \"$(find /dev/mapper/ -name n-*)\"; do sleep 1; done;\
  6. /sbin/mdadm --stop /dev/md/n* /dev/md/u*;\
  7. /sbin/mdadm --stop /dev/md/i*;\
  8. /sbin/hdparm -B 127 -M 128 -y \
  9. /dev/disk/by-id/ata-SAMSUNG* /dev/disk/by-id/ata-ST* /dev/disk/by-id/ata-WDC*
  10. "

First, the silence unit conflicts with any users of the spinning disk logical volume

systemd requires them to stop when starting this unit.

Next, use vgchange to deactivate the volume group, example called nkeep polling to see that it has removed its mappings before proceeding

Once the volume group has confirmed stopped, go on and deactivate the backing mdadm arrays, here they are intel matrixraid so stop the contents, then the containers.

The mdadm commands actually fail if the array is still in use, all my drives have imsm containers even if solitary devices.

Once the spinning arrays are stopped, go and spin down the drives. Silence