[Unionfs] mountpoint over branch (nonempty style)
Simon
turner25 at gmail.com
Sat Jun 27 14:59:15 EDT 2009
Hi there,
I'm interested in speeding up the reads on my system for some
specific work. I have EeePC 701 and it is heavilly space constrained
(my budget is too...). So i have extended its HD with a large USB
key. Reading from the key takes a bit long (longer than the SSD
driver inside, and longer than a regular IDE drive). I thought of
speeding the process of reading by using unionfs. I'd like to know if
what i'm about to try is possible. I do not use unionfs at the
moment, but it is already builtin to my kernel 2.6.29.4...
I'm going to analyse what files are read/accessed from the root
filesystem when an operation is done (using strace, typical tests are
done on a compilation where lots of files are accessed). Once i have
a list of the files, i would create a directory in /dev/shm where i
would copy those files. Reading from RAM is usually at least 10x the
speed of the fastest drive i've personally encountered...
Then, i would use unionfs to mount these files over the root
filesystem (mountpoint=/, nonempty). But i'm a bit confused as to how
to build the dirs= option. Priority for writing should be on the root
filesystem, but priority for reading should be on the ram filesystem.
Since the first branch has to be rw, i am forced to put the root fs
there, but reading priority will be on it too.
The only way i can make this work would be to mount the whole thing
on another directory with the ram branch set to rw with highest
priority, add root as second ro branch and chroot to the mountpoint to
do the fast reads. In fact, using this i would probably put a first
"written" branch rw, all other branches ro, so once everything is
over, i can just rsync the "written" branch over root. This idea has
a few more advantages too but requires a bit more work.
But can it be done without the extra steps through chroot? Is it
possible to distinguish read priority from write priority? Or am i
way too confused and not looking in the right direction? ;)
Thanks in advance!
Simon
More information about the unionfs
mailing list