GnuRAMage - automated approach to RAM discs
Mateusz Okulanis

Mateusz Okulanis @mateusz_okulanis

Location:
Gdynia
Joined:
May 29, 2025

GnuRAMage - automated approach to RAM discs

Publish Date: May 30
0 0

🚀 Introducing GnuRAMage: Sync Your HDDs to Blazing-Fast RAM Disks (and Keep Your Sanity!)

Ever dreamed of using multi-terabyte RAM disks for ludicrous speed but shuddered at the thought of data loss during a power flicker or the dreaded cat-on-keyboard scenario? 🙀

Meet GnuRAMage, a sophisticated (yet humble!) Bash tool designed to bridge the gap between your "sluggish rotating rust" (HDDs) and "blazing fast silicon heaven" (RAM disks). Think of it as your tireless digital intern, ensuring your frequently accessed files are always on the fast track while being safely backed up.

The Problem: Terabytes of RAM, Tons of Risk

You've got the RAM – maybe even terabytes of shiny DDR5. You want speed. But RAM is volatile. Without a robust sync strategy, that expensive RAM disk is a ticking time bomb for your data. Manual syncing? Ain't nobody got time for that, especially when dealing with huge datasets.

The Solution: GnuRAMage to the Rescue! 🛡️

GnuRAMage acts as your faithful guardian:

  • Copies files to RAM disk: For that sweet, sweet speed.
  • Periodically syncs back: Changes are regularly saved to persistent storage.
  • Protects your data: From power outages, crashes, and feline sabotage.
  • Peace of mind: Lets you leverage that RAM investment without the anxiety.

✨ Key Features That'll Make You Smile

GnuRAMage isn't just a one-trick pony. It's packed with features:

  • 🧠 Automatic File Copying: Intelligently moves files from HDD to RAM disk.
  • ⏱️ Periodic Synchronization: Regular, configurable sync-back to your HDD.
  • 🚫 Exclusion Patterns: Don't want your node_modules or *.tmp files hogging precious RAM? No problem!
  • ⚙️ INI Configuration: Human-readable and easy to set up.
  • 📝 Comprehensive Logging: Multiple log levels, because knowing is half the battle.
  • 🧪 Dry Run Mode: Test your setup without actually moving anything. Perfect for the cautious.
  • 💨 One-time Mode: For those quick, single sync needs.
  • ** gracefully Signal Handling:** Shuts down gracefully, ensuring a final sync.
  • 🔐 Checksum Verification: Optional data integrity checks for the truly paranoid (we get it).
  • 📜 Script Generation: Creates standalone scripts for easy automation with cron or systemd timers.

⚙️ How GnuRAMage Works: The Process

Under the hood, GnuRAMage follows a clear lifecycle:

  1. Initialization: Parses your configuration (GnuRAMage.ini), checks for dependencies (like rsync), and validates the paths you've provided.
  2. Initial Copy: Performs the first big lift – copying your specified files and directories from the slow source storage to the fast RAM disk.
  3. Monitoring Loop: This is where the ongoing magic happens. GnuRAMage periodically (based on sync_interval) rsyncs any changes made on the RAM disk back to your persistent source storage.
  4. Graceful Shutdown: If you interrupt GnuRAMage (e.g., with Ctrl+C), it aims to perform one final synchronization to ensure recent changes are saved before it exits.

The GNU Way filosofia

True to the GNU spirit, GnuRAMage is:

  • Free (as in freedom): Use it, share it, modify it.
  • Extensible: Tinker to your heart's content.
  • Well-documented: We try our best!

🛠️ Quick Start (The Traditional Way)

  1. Clone the repository:

    git clone git@github.com:FPGArtktic/GnuRAMage.git
    cd GnuRAMage
    
  2. Make it executable:

    chmod +x gramage.sh
    
  3. Configure it:
    Copy GnuRAMage.ini.example to GnuRAMage.ini and edit it to match your setup:

    cp GnuRAMage.ini.example GnuRAMage.ini
    # Now edit GnuRAMage.ini with your favorite editor
    # For example: nano GnuRAMage.ini
    

    Your GnuRAMage.ini should look something like this:

    [SETTINGS]
    sync_interval = 180 # Sync every 3 minutes
    log_level = INFO
    verify_checksums = false
    
    [DIRECTORIES]
    source_dir = /mnt/my_hdd/important_data # Your persistent storage
    ramdisk_dir = /mnt/ramdisk # Your blazing-fast RAM disk
    
    [EXCLUDE]
    *.bak
    *.tmp
    # Add other patterns as needed
    
  4. Run it!

    ./gramage.sh
    

    For a test drive (highly recommended first!):

    ./gramage.sh --dry-run --verbose
    

🤔 Who's This For?

  • Sysadmins managing large datasets.
  • Developers working with build systems or databases that benefit from fast I/O.
  • Data scientists crunching numbers on large files.
  • Anyone with a beefy RAM disk who wants to use it safely and efficiently!

💬 Want to Know More or Contribute?

Dive into the GitHub repository for the full README, including more on:

  • Detailed Usage & All CLI Options
  • Comprehensive Testing Suite
  • Troubleshooting Tips
  • How to Contribute (PRs welcome!)
  • Future Enhancements

GnuRAMage was born from a real need by Mateusz Okulanis (FPGArtktic). Let's make RAM disks both fast and reliable!

What are your strategies for managing large RAM disks? Share your thoughts below! 👇

bash #linux #sysadmin #ramdisk #performance #opensource #gnu #datasync

Comments 0 total

    Add comment