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

Support nvme devices #54

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Support nvme devices #54

wants to merge 5 commits into from

Conversation

tetron
Copy link

@tetron tetron commented Aug 31, 2022

Issue #41

Improve the script to discover volumes at both /dev/xvdb and /dev/nvme

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Copy link
Contributor

@wleepang wleepang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need some clarification on the regexp pattern used to match device names

@@ -149,10 +149,11 @@ function get_next_logical_device() {
for letter in ${alphabet[@]}; do
# use /dev/xvdb* device names to avoid contention for /dev/sd* and /dev/xvda names
# only supported by HVM instances
if [ ! -b "/dev/xvdb${letter}" ]; then
if [[ $created_volumes =~ .*/dev/xvdb${letter}.* ]]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the .* at the start of the pattern needed, and can the .* at the end of the pattern be scoped to a subset - e.g. [0-9]?

Copy link
Author

@tetron tetron Oct 31, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The string in created_volumes comes from $(aws ec2 describe-volumes) which is JSON output, to avoid having to actually parse it (and pull in jq or python or something) it just does the simpler match to see if "/dev/xvdb${letter}" shows up anywhere in the describe-volumes output, which is good enough to guess that we probably shouldn't try to use it.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the leading and trailing .* are there to consume all the other stuff we don't care about.

@golharam
Copy link
Contributor

golharam commented Feb 14, 2024

Using 'sh install.sh -d /dev/nvme2n1 -f lvm.ext4', this seems to work on AWS Linux 2023, where /dev/nvme2n1 is a 200GB gp3 disk

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

Successfully merging this pull request may close these issues.

5 participants