Skip to content
This repository has been archived by the owner on Aug 22, 2024. It is now read-only.

Need to check if the device name is a symbolic link #58

Closed
gilfreund opened this issue Dec 8, 2022 · 2 comments
Closed

Need to check if the device name is a symbolic link #58

gilfreund opened this issue Dec 8, 2022 · 2 comments

Comments

@gilfreund
Copy link
Contributor

The script checks if the variable has a value, and if this is a block device.
However, names like /dev/xvdb might also be a symbolic link to the actual block device. e.g.

ls -la /dev/xvd*
lrwxrwxrwx 1 root root  7 Dec  8 12:06 /dev/xvda -> nvme0n1
lrwxrwxrwx 1 root root  9 Dec  8 12:06 /dev/xvda1 -> nvme0n1p1
lrwxrwxrwx 1 root root 11 Dec  8 12:06 /dev/xvda128 -> nvme0n1p128
lrwxrwxrwx 1 root root  7 Dec  8 12:22 /dev/xvdba -> nvme2n1
lrwxrwxrwx 1 root root  7 Dec  8 12:25 /dev/xvdbb -> nvme3n1

Not sure if a [[ -h FILE ]] is enough or do we need to check on the target as well.

if [ -z "${DEVICE}" ] || [ ! -b "${DEVICE}" ]; then

@gilfreund
Copy link
Contributor Author

This is following @MikeKroell comment #17 (comment)

@gilfreund
Copy link
Contributor Author

Turns out to be a configuration issue in my account templates.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant