Skip to content

Instantly share code, notes, and snippets.

@djwong
Created October 1, 2013 00:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save djwong/6772237 to your computer and use it in GitHub Desktop.
Save djwong/6772237 to your computer and use it in GitHub Desktop.
fuse2fs fake /bin/mount script. Sort of.
#!/bin/bash
# Mount ext4 via fuse. If you're using this with icsum.sh to use fuse2fs
# instead of the kernel driver, put the fuse2fs binary and this script in a
# directory; rename this script to "mount"; and then put the directory
# containing this script at the head of $PATH before running icsum.sh.
for arg in "$@"; do
if [ -b "${arg}" ]; then
DEV="${arg}"
elif [ -d "${arg}" ]; then
MNT="${arg}"
fi
done
if [ -z "${DEV}" -o -z "${MNT}" ]; then
echo "Please specify a device and a mountpoint."
fi
DIR="$(dirname "$0")"
# CHEAP TRICK
umount "${MNT}" > /dev/null 2> /dev/null
export FUSE2FS_LOGFILE=/dev/ttyprintk
if [ -f "${FUSE2FS_LOGFILE}" ]; then
rm -rf "${FUSE2FS_LOGFILE}"
fi
exec "${DIR}/../e2fsprogs-csum/misc/fuse2fs" "${DEV}" "${MNT}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment