|
From: Albrecht G. <alb...@un...> - 2005-11-03 11:27:01
|
the mailing-list archiver did not like my copy-pasted script snippet, so here a little bit modified again for the archive only: Hi, reading the announcement I tought it should be possible to make a readonly mounted path (eg. part of a mounted cdrom) writable by adding a COW layer on top of it (as other layer filesystems like unionfs, minifo_fs, mulafs do ...). I tried the following cd /tmp dd if=3D/dev/zero of=3D/tmp/ro.img bs=3D1M count=3D2 mkfs.ext2 -F /tmp/ro.img mkdir /tmp/ro-tree mount -o loop /tmp/ro.img /tmp/ro-tree echo "test" > /tmp/ro-tree/test.txt=20 mkdir /tmp/ro-tree/dir cp /tmp/ro-tree/test.txt /tmp/ro-tree/dir sync umount /tmp/ro-tree mount -o loop,ro /tmp/ro.img /tmp/ro-tree Now I have i readonly filesystem mounted at /tmp/ro-tree with some files in it: # ls /tmp/ro-tree dir lost+found test.txt # touch /tmp/ro-tree/xxx touch: cannot touch `/tmp/ro-tree/xxx': Read-only file system Now I want to mount this path with mapfs to /tmp/rw-tree where I would like to see the files from /tmp/ro-tree an would like to be able to modify/add/delete files in the /tmp/rw-tree (virtually including the files from /tmp/ro-tree). The rw directories: mkdir /tmp/rw-tree mkdir -p /tmp/mapfs/view mkdir -p /tmp/mapfs/overlay I tried mount -t mapfs -o \ root=3D/tmp/ro-tree,\ view=3D/tmp/mapfs/view,\ overlay=3D/tmp/mapfs/overlay,\ cow_base=3D/overlay none /tmp/rw-tree Does not work, the test.txt files from /tmp/ro-path are not visible in /tmp/rw-tree (Tough I can create and edit files in /tmp/rw-tree resulting in new files in the view and overlay location) # ls -l /tmp/rw-tree total 0 I even tried to move the (rw) view and overlay directories with mount --bind into the ro-tree: umount /tmp/rw-tree umount /tmp/ro-tree mount -o loop /tmp/ro.img /tmp/ro-tree mkdir /tmp/ro-tree/mapfs sync umount /tmp/ro-tree mount -o loop,ro /tmp/ro.img /tmp/ro-tree mount --bind /tmp/mapfs /tmp/ro-tree/mapfs and now: mount -t mapfs -o \ root=3D/tmp/ro-tree,\ view=3D/tmp/ro-tree/mapfs/view,\ overlay=3D/tmp/ro-tree/mapfs/overlay,\ cow_base=3D/mapfs/overlay none /tmp/rw-tree Still /tmp/rw-tree is empty. Do I miss something? Thanks Albrecht --=20 // Albrecht Gebhardt Tel.: (++43 463) 2700/3118 // Institut fuer Mathematik Fax : (++43 463) 2700/3198 // Universitaet Klagenfurt mailto:alb...@un... // Universitaetsstr. 65 http://www.math.uni-klu.ac.at/~agebhard // A-9020 Klagenfurt, Austria // GPG PK: http://www.math.uni-klu.ac.at/~agebhard/agebhard.asc // GPG FP: F46F 656E E83C 9323 CE30 FF8F 9DBA D1A3 B55A 78A6 |