clacker
Group: Members
Posts: 570
Joined: June 2004 |
|
Posted: April 17 2006,19:42 |
|
mikshaw, the real use is to start with a directory that isn't writeable and make it writeable, but it also makes the files that were in the read only directory writeable. If you used the cp -s command, yes, you would wind up with a writeable directory populated with links to the files in the read only directory. But you wouldn't be able to change or write to those files without deleting the link and replacing it yourself with the real file. With unionfs, if you needed to overwrite a something.conf file that was in the original directory, it would do it without an error. Your way would say that the file is write only.
So sure, the ln -s or cp -s way works, but only if none of those files need to change. Take the example of the /usr/src/linux-2.4.26 directory. If I had a .config file in there when I started, I wouldn't be able to write over it after running make menuconfig. Using unionfs you could. For the remastering and creating the source/KNOPPIX directory I gave, your way doesn't work because the mkisofs command creates an iso of the links and not the files as well as not allowing file modifications.
clivesay, yes you can make uci files writeable using unionfs. This is similar to what slax does in their distro. You would mount the something.uci file (really a compressed file system created with mkisofs and create_compressed_fs) to /opt/something_ro rather than to /opt/something like you normally would, create /opt/something and /opt/something_rw directories, and use unionfs to merge them into a writeable directory in /opt/something. You could do:
mount -t unionfs -o dirs=/opt/something_rw=rw:/opt/something_ro=ro unionfs /opt/something
Now the /opt/something directory is writeable, as are the files it already contained. Any changed files get added to the /opt/something_rw directory.
|