Skip to content

Put PG data to second drive#224

Merged
akremenetsky merged 1 commit intomasterfrom
feat/218/pg-data-second-drive
Feb 25, 2026
Merged

Put PG data to second drive#224
akremenetsky merged 1 commit intomasterfrom
feat/218/pg-data-second-drive

Conversation

@akremenetsky
Copy link
Member

@akremenetsky akremenetsky commented Jan 18, 2026

The bootstrap.sh and install.sh scripts were reworked to configure the second drive and put PG data on it. Also some improvements done for future update procedure. The PG version was switched 16 -> 18.

Closes #218

@akremenetsky akremenetsky self-assigned this Jan 18, 2026
@gemini-code-assist
Copy link

Summary of Changes

Hello @akremenetsky, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the system's robustness and maintainability by automating the provisioning of a secondary disk for PostgreSQL data and streamlining the PostgreSQL installation and data management process. It ensures that critical data resides on a dedicated, persistent volume and refines the service startup sequence for improved reliability and future updates.

Highlights

  • Automated Secondary Disk Provisioning: The bootstrap.sh script now automatically detects, partitions (GPT), formats (ext4), and mounts a secondary disk at /var/lib/genesis/data, ensuring persistent mounting via /etc/fstab. This includes robust error handling and idempotent operations.
  • PostgreSQL Data Relocation: PostgreSQL data is now automatically moved from its default location to the newly provisioned secondary disk (/var/lib/genesis/data/postgresql/<version>/main) during the bootstrap process, enhancing data persistence and portability.
  • Refined PostgreSQL Setup and Configuration: The install.sh script now installs a specific PostgreSQL version (18) from the PGDG repository and handles initial user/database creation. The bootstrap.sh script then configures PostgreSQL to use io_uring for I/O and manages the data directory relocation.
  • Service Enablement Logic Shift: Genesis core services are now enabled by bootstrap.sh after the database is confirmed to be ready and configured, rather than by install.sh, ensuring a more reliable startup sequence.
  • Improved Update Procedure Readiness: The install.sh script now explicitly applies database migrations, with added comments clarifying its role in speeding up initial runs, enabling build-time debugging, and supporting future update procedures.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request reworks the bootstrap and installation scripts to support moving PostgreSQL data to a secondary drive. The changes in bootstrap.sh are extensive, adding logic for disk detection, partitioning, formatting, and mounting, as well as relocating the PostgreSQL data directory. The install.sh script is updated to accommodate these changes, primarily by moving service enablement to the bootstrap phase.

My review focuses on improving the robustness and maintainability of the new shell scripting logic. I've suggested making file operations more atomic, removing redundant code, and adhering to scripting best practices. Specifically, I've pointed out issues with non-atomic file updates to /etc/fstab, duplicated systemctl calls, and the use of source in a script. In install.sh, I've noted minor formatting issues. Overall, the changes are well-structured and address the goal of the pull request, but could benefit from these refinements.

@akremenetsky akremenetsky force-pushed the feat/218/pg-data-second-drive branch 2 times, most recently from f77cedc to 4f08058 Compare January 19, 2026 19:59
@akremenetsky akremenetsky marked this pull request as ready for review January 19, 2026 19:59
The bootstrap.sh and install.sh scripts were reworked
to configure the second drive and put PG data on it.
Also some improvements done for future update procedure.

Signed-off-by: Anton Kremenetsky <anton.kremenetsky@gmail.com>
@akremenetsky akremenetsky force-pushed the feat/218/pg-data-second-drive branch from 4f08058 to fe3de80 Compare February 25, 2026 12:29
@akremenetsky akremenetsky merged commit 76245dd into master Feb 25, 2026
20 checks passed
@akremenetsky akremenetsky deleted the feat/218/pg-data-second-drive branch February 25, 2026 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Put internal PG data to second drive

3 participants