You can use AutoFS to mount HDD dynamically.
Install AutoFS
$ sudo yay -S autofs
Configure AutoFS
$ sudo su
# _ID=$(blkid --output value --match-tag PARTUUID /dev/sda1)
# printf "%s%s\n" "extHDD --fstype=auto PARTUUID="\"${_ID}\"" > /etc/autofs/auto.misc
# exit
- the first line, change user to root.
- the second line, input /dev/sda1’s partition UUID to variable _ID.
- the third line, write out _ID infomation to auto.misc file.
- the fourth line, exit to root.
Start and Enable AutoFS
$ sudo systemctl start autofs
$ sudo systemctl enable autofs
Check the configuration
$ sudo ls /misc/extHDD
Last Updated on June 5, 2024 by lama-admin
Leave a Reply