Unix/Linux experts ...
 

  You don't need to be an 'investor' to invest in Singletrack: 6 days left: 95% of target - Find out more

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

5 Posts
4 Users
0 Reactions
41 Views
Posts: 0
Free Member
Topic starter
 

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 9:51 pm
Posts: 7076
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 9:53 pm
 pdw
Posts: 2206
Free Member
 

overlayfs


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

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


 
Posted : 08/11/2015 11:08 pm
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 : 08/11/2015 11:23 pm
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 12:37 am

6 DAYS LEFT
We are currently at 95% of our target!