Forum menu
Unix/Linux experts ...
 

[Closed] Unix/Linux experts - linked directories/filesystems

Posts: 0
Free Member
Topic starter
 
[#7443289]

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.


 
Posted : 08/11/2015 10:51 pm
Posts: 7124
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.


 
Posted : 08/11/2015 10:53 pm
 pdw
Posts: 2206
Free Member
 

overlayfs


 
Posted : 08/11/2015 10:57 pm
Posts: 0
Free Member
Topic starter
 

Thanks for the help, but neither of those seem to work with PXE ๐Ÿ™


 
Posted : 09/11/2015 12:08 am
Posts: 1862
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!


 
Posted : 09/11/2015 12:23 am
Posts: 0
Free Member
Topic starter
 

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:
[code]cp -ral original new[/code]

...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.


 
Posted : 09/11/2015 1:37 am