OverlayFS

From Extremely Corporate Wiki
Jump to navigation Jump to search


Idk. When a mommy filesystem and a daddy filesystem love each other very much. They create a virtual file system which has a replicated filesystem of the original but without actually affecting the original.

The idea for this was brought about from some programmer's inability to keep a clean workspace especially when using one off software.

A script was created for those inept people.

#!/bin/bash

NAME=$1

LOWER_DIR=/
UPPER_DIR=/tmp/ovfs_upper/$NAME
WORK_DIR=/tmp/ovfs_work/$NAME
MERGED_DIR=/tmp/ovfs/$NAME

mkdir -p $UPPER_DIR
mkdir -p $WORK_DIR
mkdir -p $MERGED_DIR

mount -t overlay overlay -o lowerdir=/,upperdir=$UPPER_DIR,workdir=$WORK_DIR $MERGED_DIR
chroot $MERGED_DIR
cd

External Resources