mkfs

Now first, why would i want to format another ramdisk ?

Simple, the next processes (rrdtool/thttpd and protftp) (are able to) generate a lot of data, which will not fit in the image itself. So the solution is to format new ramdisks, and store their data there.

The least byte-costing option will be to build it into busybox, which supports the minix filesystem. And if i, later on, change the image also to minix, i can build the kernel so that it only supports minix.

But, now, step-by-step.

First i will rebuild busybox ...
Use the same configuration as before, but uncomment BB_MKFS_MINIX, and build busybox again.
For me, the size of busybox increased only 5 KB ! Really amazing. Now copy the new busybox to your image, and make a symbolic link to it which is called mkfs.minix.

The next thing is to build a kernel that supports minix ...
This also allows me to further strip down the kernel, by removing some unused options.
The base configuration should be the configuration you used in the first part of this document.
Now go to the filesystems part, and deselect second extended fs support, and activate minix fs support.i Save your config, and rebuild the kernel.

Now we have to migrate the image to a minix filesystem, which made me happy, because the filesystem is less complex, there is more space for programs !
Mount your image, and copy the whole content of the image to a directory on your harddrive, do this with cp -Rap [mountpoint of your image]/* [dir on your HD]
Now make a new image, with dd if=/dev/zero of=[new_image_name] bs=1024 count=8k, and do mkfs.minix [new_image_name]
This wel create an other 8 MB image, and copy the stuff back using cp -Rap.

Now copy the new image and new kernel to your /boot directory, and change your bootloader's configuration. Don't forget to run grub-install or lilo after that.

Now reboot to test if everything is still working. For me, there where no problems. When you've booted, also try this:
mkfs.minix /dev/ram2
mkdir /tmp
mount /dev/ram2 /tmp
It should work, and with df you will see it's capacity.

Back