I'm using an overlayfs for different folders. Now I'm thinking about a backup and restore process. I didn't found anything via google, which answered my question.

An overlayfs has an upper, lower, workdir and overlay. The overlay shows a combination of upper and lower dir. The lower dir is a read only folder. The upper dir has the changes from the user.

Delta backup A delta backup would be taken from the upper dir which just has the changed files and folders.

Full backup A full backup would be taken from the overlay dir, which combines upper and lower.

Restore Delta backup putting the delta backup to the overlay folder should work easily and the result in the upper should be the same as before.

Restore Full backup restore a full backup to the overlay folder will result in a complete copy inside the upper folder.

Questions I have not yet an answer:

  1. What is with the workdir folder? Can I ignore it on backup/restore?
  2. Did I miss any possible problem?

1 Answer 1


I've found the best 'overlay' filesystem documentation to be https://www.kernel.org/doc/html/latest/filesystems/overlayfs.html https://www.kernel.org/doc/Documentation/filesystems/overlayfs.txt

-> 'What is with the workdir folder?'... I recall reading (I don't recall where) that this folder is required for the Ubuntu kernel build, so it may not be required for all contexts. In my case (Linux Mint 19.3), it's required whenever the overlay includes a writeable upper layer (upperdir). Don't you require this for your current overlay scheme?

-> ...'Can I ignore it on backup/restore?' If you are restoring from an overlay backup you probably won't need it for the backup, since a backup is not modified during a restore operation. The restore target (if it's an overlay) would require an upperdir+workdir, since it must be writeable.

-> 'Did I miss any possible problem?' - Since Linux Kernel version 14 (ca 2015) the integrated overlay filesystem features a 'multiple lower layers' feature. This may give you additional inspiration for designs.

  • You mention full backup taken from the overlay directory... does your lower layer change over time?

  • Restore Full backup into the overlay... Why would you do that? This would hide any content of the lower layer. Would you not want to restore the full backup into an empty non-overlay directory and use this as the lowerdir of your overlay?

  • Thx @Gaudeamos. The lower dir can change on a version update of the operating system. So sometimes a full backup would make sense to completly restore a device and ignoring the underlying lower dir (this can lend to other problems, but that's another topic)
    – svanschu
    Commented Apr 6, 2020 at 7:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .