Viewing 6 posts - 1 through 6 (of 6 total)
  • Unix/Linux experts – linked directories/filesystems
  • aracer
    Free Member

    Just wondering if there’s any way to have a linked copy of a directory structure but to have one file different in the each copy? It’s another one I feel I should know, but can’t even work out what to search for.

    It’s a complete filesystem (several GB) I want to do this with – doing a PXE boot and want to simultaneously boot two different clients and see what difference a small change makes.

    oldnpastit
    Full Member

    Can you use lndir?

    It creates a shadow directory containing a symlink for each file (recursively). You could then modify the one file you want to change.

    It might go wrong though if the PXE boot fails to follow the symlinks.

    pdw
    Free Member

    overlayfs

    aracer
    Free Member

    Thanks for the help, but neither of those seem to work with PXE 🙁

    rossburton
    Free Member

    If PXE has problems with symlinks then a hard link farm (shame lndir can’t do those for you) will work, but you’ll have to be careful that when you make the modifications to the copy you don’t change the original at the same time!

    aracer
    Free Member

    Yay, that did the trick, thanks! I new there had to be a simple trick.

    Easier to set up than I was expecting as well, just did:
    cp -ral original new

    …and I did remember to unlink and copy before editing

    Only tricky bit is that this was the base of a filesystem, so as I couldn’t hard link across filesystems I had to create a new top level directory and move the rest down so I had space to make the copy on the same filesystem.

Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘Unix/Linux experts – linked directories/filesystems’ is closed to new replies.