Jump to content

[Linux] Managing addons & saving disk space with UnionFS/AuFS


Fail-Man 3D

Recommended Posts

I've recently started using unionfs-fuse to manage addons, it helps take the pain out of keeping multiple modded copies of KSP up to date and in sync with each other. It also eliminates the overhead (on non-deduplicating filesystems) of having multiple copies of KSP.

Example: I have one KSP prefix with regular ModularFuels (to build stuff for release on Spaceport), and another with Realistic ModularFuels (for actually playing the game). The directory structure would be set up as follows:


bases/
bases/KSP_linux/#contents of Squad's ksp-linux-$version.zip, the KSP executable lives here
bases/ModularFuels-regular/GameData/ModularFuels/ # contents of the Modular Fuels distribution zip
bases/ModularFuels-realistic/GameData/ModularFuels/ # contents of the Realistic Modular Fuels distribution zip
prefixes/realistic/ # UnionFS storage dir for KSP with realistic modular fuels
prefixes/normal/ # UnionFS storage dir for KSP with normal modular fuels
mounts/realistic/ # mountpoint for realistic
mounts/normal/ # mountpoint for normal
realistic.sh # bash script to handle RealisticFuels mounting
normal.sh # another one for normal ModularFuels

The source of realistic.sh (public-domain):

#!/bin/bash
KSPPREFIX="realistic"
KSPDIR="${HOME}/.local/ksp022"

# initial read-write entry for the prefix must NOT be the same as the mountpoint or *BAD THINGS* HAPPEN!
KSPPATH="${KSPDIR}/prefixes/${KSPPREFIX}=RW" # UnionFS writes all changes to this dir, if this==mountpoint then an infinite loop happens & hangs the unionfs driver (requires reboot to fix)
KSPPATH+=":${KSPDIR}/bases/ModularFuels-realistic=RO" # load realistic modular fuels overlay
KSPPATH+=":${KSPDIR}/bases/KSP_linux=RO" # apply all the previous lines to this base...

/usr/bin/unionfs -o default_permissions,use_ino \
-o cow,statfs_omit_ro \
"${KSPPATH}" \
"${KSPDIR}/mounts/${KSPPREFIX}" # ...and mount it here (must NOT be the same as the read-write prefix!)

When done, I unmount with

fusermount -u ~/.local/ksp022/mounts/realistic

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...