Repository navigation
fix: format and mount Denvr data disk - #169
Open
jtripathi1 wants to merge 2 commits into
Open
jtripathi1 wants to merge 2 commits into
jtripathi1 wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
For Denvr instances available through Shadeform, the console displays the full storage capacity associated with the instance type. However, only the root disk is mounted and accessible within the instance, while the remaining storage is attached as a raw block device without a filesystem or mount point. As a result, users can access only the smaller root volume, while most of the advertised storage remains attached but is not configured for use.
Solution
Extended the Shadeform launch-configuration script to automatically format and mount the additional disk during instance creation.
Renamed GenerateFirewallScript to GenerateBootstrapScript, which now accepts the underlying cloud identifier and uses a shouldMountDataDisk check against denvr, ensuring firewall rules apply to all clouds while disk formatting and mounting are limited to Denvr.
Implemented disk-mounting logic that selects the largest whole non-root disk with no filesystem, partitions, or blkid signature and a minimum size of 100 GiB, formats it using mkfs.ext4 only when blank, mounts it at /data, and persists the mount through a UUID-based /etc/fstab entry with nofail,x-systemd.device-timeout=5.
Added an idempotency guard to ensure the script runs safely on every boot, as Shadeform installs it as a systemd service. The brev_mount_data_disk function returns early when /data is already mounted, ensuring the setup runs only once.
Added unit tests verifying that the disk-mounting block is included for Denvr, excluded for other Shadeform-backed providers, and that the mountpoint -q guard is present in the generated script.