Last active
December 30, 2024 18:15
-
-
Save alixiaikuda/d6fc66603c6ae363cab44ab2aa286b07 to your computer and use it in GitHub Desktop.
automatically set the rotational value of a device by uuid.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| UUID="uuid here" | |
| DEVICE=$(blkid -U $UUID) | |
| echo 0 > /sys/block/$(basename $DEVICE)/queue/rotational |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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".