Using CRAM Filesystem
Using cram Filesystem
The following demonstrates how to configure cramfs to preserve some space. Only convert directories to cramfs if you are sure those directories are read-only, ie you are never going to change or add any files there. You will need either [cramfs-1.1_arm.bin.tar.gz] or [mkcramfs.tar.gz], or install gcc which also includes it. Here is an example for compressing and mounting the jre directory:
# su # mkcramfs /usr/lib/jdk1.3 /hdd3/jre13.cramfs # rm -r /usr/lib/jdk1.3/* # mount -t cramfs -o loop /hdd3/jre13.cramfs /usr/lib/jdk1.3
So far I have crammed the following:
* /usr/lib/jdk1.3 * /usr/lib/firefox0.9gtk * /usr/lib/thunderbird-0.6
Note that mkcramfs stores the whole image in memory before writing it to disk, so make sure you have a sufficiently sized swap file enabled before running mkcramfs.
Also, there are only 2 loop devices by default on the C3000, but you can create more loop devices. You will need to recreate them each time you reboot, so it would be better to automate it in a start script which you can use to automatically mount the cram archives as well. Here is how you create /dev/loop2 to /dev/loop6
# for i in 2 3 4 5 6 > do > mknod /dev/loop$i b 7 $i > done
You might also want to add an entry into fstab so the cramfs archives can be automatically mounted. Copy mntloop to /etc/rc.d/init.d and link it to rc5.d and rc6.d
# su # cp /home/zaurus/Documents/custom/mntloop /etc/rc.d/init.d # ln -s /etc/rc.d/init.d/mntloop /etc/rc5.d/S50mnt # ln -s /etc/rc.d/init.d/mntloop /etc/rc6.d/K50mnt # echo "/hdd3/jre13.cramfs /usr/lib/jdk1.3 cramfs loop,ro 0 0" >> /etc/fstab
mntloop will create new loop devices and check /etc/fstab at bootup time and mount any valid entry for cramfs it finds. The Linux boot process will mount entries in /etc/fstab by default, but it can only mount 2 loop partitions because there are only that many default loop devices, so any additional entries in /etc/fstab will fail to mount. mntloop will mount any additional entries it finds after creating the extra loop devices. At system shutdown or reboot, it will cleanup and unmount anything mounted as a loop device.
The automounter package [automounter-c3000_0.3_arm.ipk] will install mntloop and also install the usb automounter.