Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: tag sd* drives as ephemeral also #363

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/os/ephemeral-storage.rules
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ENV{DEVTYPE}!="disk", GOTO="ephemeral_storage_end"
# Known sources of ephemeral disks:
# - EC2 instance types with instance storage volumes
# - KVM VMs with additional virtio disks
KERNEL!="nvme*|vd*", GOTO="ephemeral_storage_end"
KERNEL!="nvme*|vd*|sd*", GOTO="ephemeral_storage_end"
Copy link
Contributor

Choose a reason for hiding this comment

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

To create symlinks under /dev/disk/ephemeral for the non-system disks, you'd also need a rule like this after the nvme* and vd* ones below:

# Create symlinks for any matching SCSI devices.
KERNEL=="sd*", \
  SYMLINK+="disk/ephemeral/virtio-$env{ID_SERIAL}"


# We can't be sure that devices with similar kernel names are all ephemeral.
# Our udev helper checks for known system partitions to classify the device.
Expand Down
3 changes: 2 additions & 1 deletion packages/os/supplemental-storage.rules
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ SUBSYSTEM!="block", GOTO="supplemental_storage_end"
ENV{DEVTYPE}!="partition", GOTO="supplemental_storage_end"

# Only these drivers have "interesting" volume types.
KERNEL!="nvme*|xvd*|vd*", GOTO="supplemental_storage_end"
KERNEL!="nvme*|xvd*|vd*|sd*", GOTO="supplemental_storage_end"

# Set the volume type for each supported driver, annotating it with the volume
# sub-type, if any.
Expand All @@ -18,6 +18,7 @@ ENV{BOTTLEROCKET_VOLUME_TYPE}!="?*", KERNEL=="nvme*", ATTRS{model}=="Amazon Elas
ENV{BOTTLEROCKET_VOLUME_TYPE}!="?*", KERNEL=="nvme*", ENV{BOTTLEROCKET_VOLUME_TYPE}="nvme"
ENV{BOTTLEROCKET_VOLUME_TYPE}!="?*", KERNEL=="xvd*", ENV{BOTTLEROCKET_VOLUME_TYPE}="xen"
ENV{BOTTLEROCKET_VOLUME_TYPE}!="?*", KERNEL=="vd*", ENV{BOTTLEROCKET_VOLUME_TYPE}="virtio"
ENV{BOTTLEROCKET_VOLUME_TYPE}!="?*", KERNEL=="sd*", ENV{BOTTLEROCKET_VOLUME_TYPE}="scsi"

ENV{ID_PART_ENTRY_UUID}=="?*" SYMLINK+="disk/by-volume-type-partuuid/$env{BOTTLEROCKET_VOLUME_TYPE}-$env{ID_PART_ENTRY_UUID}"

Expand Down