Code Sample |
mkdir /ramdisk/bin mkdir /ramdisk/bin_holder mount -t unionfs -o dirs=/ramdisk/bin_holder=rw:/KNOPPIX/bin=ro unionfs /ramdisk/bin ln -sf /ramdisk/bin / |
Code Sample |
#!/bin/bash #first handle the easy directories for i in bin boot lib sbin usr do mkdir /ramdisk/$i mkdir /ramdisk/${i}_holder mount -t unionfs -o dirs=/ramdisk/${i}_holder=rw:/KNOPPIX/$i=ro unionfs /ramdisk/$i ln -sf /ramdisk/$i / done # Then take care of /etc by making a copy of it mkdir /ramdisk/etc_holder mkdir /ramdisk/etc cp -rp /etc /ramdisk/etc_copy mount -t unionfs -o dirs=/ramdisk/etc_holder=rw:/ramdisk/etc_copy=ro unionfs /ramdisk/etc # copy mtab or their may be problems since there is another entry in the current one cp /etc/mtab /ramdisk/etc/mtab rm -rf /etc ln -sf /ramdisk/etc / # to undo the above section you need the following: # rm /etc # cp -r /ramdisk/etc_copy /etc # umount /ramdisk/etc # now handle the /var directory mkdir /ramdisk/var mkdir /ramdisk/var_holder mv /ramdisk/var /ramdisk/var_old mount -t unionfs -o dirs=/ramdisk/var_holder=rw:/KNOPPIX/var=ro:/ramdisk/var_old=ro unionfs /ramdisk/var # to undo the above section you need the following: # umount /ramdisk/var # rm -r /ramdisk/var # mv /ramdisk/var_old /ramdisk/var |
Quote |
Is there a file that gets run at shutdown, before anything is unmounted automatically? If so I could add the lines I nned to unmount the /ramdisk/etc and /ramdisk/var direstories. The other directories work fine. |