Skip to content

Instantly share code, notes, and snippets.

@alixiaikuda
Last active December 30, 2024 18:15
Show Gist options
  • Select an option

  • Save alixiaikuda/d6fc66603c6ae363cab44ab2aa286b07 to your computer and use it in GitHub Desktop.

Select an option

Save alixiaikuda/d6fc66603c6ae363cab44ab2aa286b07 to your computer and use it in GitHub Desktop.
automatically set the rotational value of a device by uuid.
[Unit]
Description=set the rotational value for a specific device
After=local-fs.target
[Service]
Type=oneshot
ExecStart=/usr/local/bin/set_rotational.sh
[Install]
WantedBy=multi-user.target
#!/bin/bash
UUID="uuid here"
DEVICE=$(blkid -U $UUID)
echo 0 > /sys/block/$(basename $DEVICE)/queue/rotational
@alixiaikuda
Copy link
Copy Markdown
Author

why? i took an external hdd out of it's enclosure and as it turns out, the little board in the enclosure that takes sata and converts it to usb, always reports any drive in it (even an ssd), as "seagate expansion hdd".

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