I work in two PCs and I sync all my files from my primary PC to a USB flash memory. In my second PC, I mount the USB flash memory to the same path to work on my files as I were on my primary PC.
Now for the sake of performance and flash memory lifetime, I need to use any type of differencing, aka overlay, aka union, file-system (like unionfs or aufs) to let me use the USB flash disk as read-only and write changes to a temp directory and at the end allows me to write the changes back to the USB flash at once.
Any help?
Any hope?
Update:
Thanks for all your answers and comments. I am interested in Linux and my question is: Does any of the above file-systems allow committing the writes to the lower file-systems when required? If yes, how?
Best Answer
There is a new dm target called "snapshot-merge".
If you format your USB flash memory as a LVM physical volume, and then locate your desired filesystem atop it in a logical volume, you can
This should achieve close to what you've asked for, although it requires a scratch block device rather than a temporary directory.
Substitute the parts enclosed in {braces} as appropriate.
Untested, but all the LVM commands have manpages so you should be able to figure things out from here. You might need a
vgscan
invocation in there somewhere, if the volume group doesn't get automatically detected when you plug the USB drive in.