Skip to content

Conversation

Copy link

Copilot AI commented Jan 7, 2026

The grow-ssd one-shot service marks itself down on exit. If it runs before /ssd mounts, it exits immediately and never retries, leaving the partition ungrown.

Changes

  • Add 60-second wait loop that polls for /ssd mount before attempting partition growth
  • Skip wait if /ssd already mounted at service start
  • Differentiate error messages based on whether timeout occurred

Implementation

# Wait for /ssd to be mounted (up to 60 seconds)
MAX_WAIT=60
WAITED=0
SSD_DEV=$(findmnt -n -o SOURCE /ssd 2>/dev/null || echo "")

case "$SSD_DEV" in
    /dev/*) 
        # Already mounted, proceed
        ;;
    *)
        # Not yet mounted, wait for it
        echo "grow-ssd: waiting for /ssd to be mounted..."
        while [ $WAITED -lt $MAX_WAIT ]; do
            SSD_DEV=$(findmnt -n -o SOURCE /ssd 2>/dev/null || echo "")
            case "$SSD_DEV" in
                /dev/*)
                    echo "grow-ssd: /ssd is mounted on $SSD_DEV"
                    break
                    ;;
            esac
            sleep 1
            WAITED=$((WAITED + 1))
        done
        ;;
esac

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@coderabbitai
Copy link

coderabbitai bot commented Jan 7, 2026

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI and others added 4 commits January 7, 2026 21:53
The service now waits up to 60 seconds for /ssd to be mounted
before attempting to detect and grow the partition. This prevents
the service from exiting early if /ssd hasn't been mounted yet
at boot time, which would cause it to never run again since it's
a one-shot service that marks itself down on exit.

Co-authored-by: kristapsk <[email protected]>
- Initialize SSD_DEV before the loop to avoid undefined variable errors
- Only print waiting message if /ssd is not already mounted
- Use parameter expansion with default value for WAITED in error message

Co-authored-by: kristapsk <[email protected]>
- Initialize WAITED and MAX_WAIT before any checks
- Use consistent case statement logic for device path validation
- Provide better error messages based on whether waiting occurred
- Remove trailing whitespace on line 15

Co-authored-by: kristapsk <[email protected]>
Copilot AI changed the title [WIP] Update SSD partition and filesystem grow at boot based on feedback Add mount wait loop to grow-ssd service Jan 7, 2026
Copilot AI requested a review from kristapsk January 7, 2026 21:59
@kristapsk kristapsk closed this Jan 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants