fix(os): Identify disk by partition UUID (#3)
This commit is contained in:
parent
12038d3eaf
commit
e951e077a0
2
setup.sh
2
setup.sh
@ -105,7 +105,7 @@ function we_have_exactly_one_part () {
|
||||
|
||||
function get_drive_id () {
|
||||
local drive_id_list drive_id_single
|
||||
drive_id_list="$(find -L /dev/disk/by-id -samefile "${1:?}" | sort)"
|
||||
drive_id_list="$(find -L /dev/disk/by-partuuid -samefile "${1:?}" | sort)"
|
||||
drive_id_single="$(head -n1 <<<"${drive_id_list}")"
|
||||
if [[ "$(wc -l <<<"${drive_id_single}")" -eq '1' ]] && [[ "$(wc -c <<<"${drive_id_single}")" -gt '1' ]]; then
|
||||
printf -- '%s' "${drive_id_single}"
|
||||
|
Loading…
x
Reference in New Issue
Block a user