[BusyBox] Changing from ramdisk to ramfs

Gavin Dolling gavind at lsil.com
Fri Oct 12 08:19:53 UTC 2001


I have an embedded system which is presently running from a ramdisk. This is
obviously wasteful of memory and as such I would like to convert it to a ram
fs. From the archive (5th Jun 2001), a way is given, however due to a bug
that was being chased at that time the exact method is not detailed.

Below is what I am doing. I do not understand the chroot command (I
understand chroot but am not sure about the console bits) and seeing as I
don't understand it - it is not surprising that at this point it all goes
wrong. As soon as this bit works I would be able to unmount and thus free
the ramdisk.

If anyone could correct what is below I would be extremely grateful.

Thanks for your time,

Gavin.


bash-2.03#
bash-2.03# busybox mount -t ramfs ramfs /mnt
bash-2.03# busybox cp -a bin dev etc lib sbin usr var mnt
bash-2.03# cd /mnt
bash-2.03# mkdir proc initrd
bash-2.03# busybox pivot_root . initrd
bash-2.03# busybox mount /proc /proc -t proc
bash-2.03# exec chroot . /sbin/init <dev/console >dev/console 2>&1
BusyBox v0.60.1 (2001.10.12-11:04+0000) multi-call binary
No help available.

Please press Enter to activate this console.
mount: proc already mounted
mknod: /dev/ttyAM0: File exists
mknod: /dev/ttyAM1: File exists
bash-2.03#
bash-2.03# umount initrd
umount: initrd: device is busy
bash-2.03# freeramdisk /dev/ram0
freeramdisk: failed ioctl on /dev/ram0: Device or resource busy
bash-2.03#






More information about the busybox mailing list