Uses of unionfs in Slackware ---------------------------- Suppose you have a couple of Slackware install CD's and you want to use these as the base of network installation (or even an install from a pre-mounted directory). Usually, you'd loopmount the ISO images, copy the contents of the ISO out of the mount point to a destination directory on the hard drive, and then unmount the ISO images. This takes a lot of extra disk space, and maybe you don't want that. In fact, with unionfs, it is no longer necessary at all. With the unionfs kernel module loaded, you can loopmount your ISO images onto separate mount points, and then mount these again as a union onto the final, single mountpoint. The result is a directory content that is indistinguishable from the content you would have created by copying the files out of the ISO to hard disk. As an example, let's see how to make the content of Slackware CD1 and CD2 available as an NFS export using this principle. Assuming I've downloaded the ISO images to directory /isos ; First, create the mountpoints: ------------------------------ # mkdir -p /mnt/sw10.2.cd1 # mkdir -p /mnt/sw10.2.cd2 # mkdir -p /live/slackware-10.2 Mount the two ISO images: ------------------------- # mount -o loop /isos/slackware-10.2-install-d1.iso /mnt/sw10.2.cd1 # mount -o loop /isos/slackware-10.2-install-d2.iso /mnt/sw10.2.cd2 Now, create a union mount of these two mount points. ---------------------------------------------------- The contents of the two moint points will be "merged" into the final mount point: # mount -t unionfs -o dirs=/mnt/sw10.2.cd1=ro:/mnt/sw10.2.cd2=ro none /live/slackware-10.2 As a result, the directory /live/slackware-10.2 now has the sum of contents of CD1 and CD2 available. The directory can then be exported through NFS. This will only work with recent distributions where you can use "fsid" option in the exports file. For instance, the /etc/exports should have a line like this: /live/slackware-10.2 *(ro,fsid=42,async,insecure,all_squash) ------------------------------------------------------------------------------- $Id: 00README.slackware,v 1.1 2005/10/12 12:15:40 root Exp root $ Eric Hameleers