eatmydata(1)

✨ NAME ✨

okay bestie, eatmydata(1) from the General Commands Manual is literally the tool for making your programs stop waiting on the disk πŸ’…. Its whole job is to transparently disable fsync() and other data-to-disk synchronization calls 🫢.

πŸŽ€ SYNOPSIS πŸŽ€

eatmydata [--] command [ command arguments ... ]

πŸ’– DESCRIPTION πŸ’–

okay so eatmydata runs a command in a world where data-to-disk synchronization calls (like fsync(), fdatasync(), sync(), msync() and the open() O_SYNC / O_DSYNC flags) have no effect 😭. The secret sauce is the LD_PRELOAD library libeatmydata, which overrides those C library calls with its own functions. They don't trigger any synchronization, but they still report success anyway πŸ’…βœ¨.

You can use eatmydata in two ways, and both are giving different vibes πŸ¦‹:

  • Normal mode β€” just run eatmydata directly and hand it the command you want to run, plus its arguments, on the command line.
  • Symlink mode β€” make a symlink to /usr/bin/eatmydata that is named after another program (its filename, a.k.a. basename) that lives somewhere in your PATH, then run eatmydata through that symlink. eatmydata will find that program in the PATH and run it inside the libeatmydata environment, passing along all of your command line options 🌸.

πŸ‘‘ OPTIONS πŸ‘‘

Heads up, eatmydata does not process any command line options in symlink mode πŸ™ˆ. Every option gets passed straight through to the underlying executable, exactly as-is.

  • command β€” the command you want to run πŸ“. It can be a full path or just the name of a command in PATH. If the command can't be found in PATH, eatmydata will fail.
  • command arguments β€” any number of arguments you want to hand to the command being run 🧚.
  • -- β€” an optional command separator, included so it feels familiar to similar utilities πŸ’œ. It's ignored at the moment.

🌈 EXAMPLES 🌈

Say PATH is /usr/bin and both /usr/bin/aptitude and /usr/bin/eatmydata are installed. Then this:

$ ln -s /usr/bin/eatmydata ./aptitude
$ ./aptitude moo

is the same as this:

$ eatmydata -- aptitude moo

So yes, you can use symlink mode to automatically run specific programs in the libeatmydata environment whenever you launch them from PATH πŸ”₯. For example, with standard PATH settings, you just do:

# ln -s /usr/bin/eatmydata /usr/local/bin/aptitude

and boom, sync-free aptitude system-wide πŸ«ΆπŸ’….

πŸ™ˆ CAVEAT πŸ™ˆ

Watch out, bestie! When you use eatmydata with setarch (including aliases such as linux32), or with chroots that have a different architecture than the host's, make sure you install the matching architecture of libeatmydata1 in both the setarch environment and on the host πŸ’€.

Trying to load libeatmydata manually (without the wrapper script) and then using it through a chroot is probably going to fail 😭, especially if the eatmydata versions differ between outside and inside, due to the library being in a different spot on the file system πŸ₯Ί. The safest way to load libeatmydata manually is to set these two environment variables (shell syntax):

LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+"$LD_LIBRARY_PATH:"}/usr/lib/libeatmydata
LD_PRELOAD=${LD_PRELOAD:+"$LD_PRELOAD "}libeatmydata.so

These two variables account for the case of a Debian Jessie host with a Debian Wheezy chroot, where the library's location changed ✨.


Manual page eatmydata(1), November 2014. Stay synced with your besties πŸŒΈπŸ’–