2

I just received a few-dozen-gigabyte squashfs that contains a PostgreSQL database. In order to be able to conveniently query it, I need to have a write access, which makes it complicated. Is there a filesystem similar to (or a setting for) overlayfs/autofs that would enable this use case? I'm getting the impression that when I ran select * from tbl limit 1;, overlayfs was trying to rewrite the whole file, which is not acceptable in my situation.

  • Odd that it needs to write. Have you tried default_transaction_read_only = on; in your PostgreSQL config? Also, move the WAL logs—they may need to be writable. – derobert Jan 28 '16 at 18:31
  • @derobert: And pidfile? – d33tah Jan 28 '16 at 18:42
  • Yeah, though that's tiny so you could just let overlay etc. take care of that. I'm not sure if pg can actually run w/o writing to the data files.. Also, any reason for it to be a squashfs? Could it be something typically writable like ext4 instead? – derobert Jan 28 '16 at 18:44
  • @derobert: this is what I have basically. – d33tah Jan 28 '16 at 18:45
1

You could take a look at the project squashmount. It mounts a directory with both a squashfs and an autofs/overlay/overlayfs system to allow for squashing ro access as well as write access. Completely configurable on how much change requires re-squashing, its a nice to use for database storage, repos spools, etc.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.