How do I mount a cramfs when I copy it to tmpfs?

Denys Vlasenko vda.linux at googlemail.com
Fri Nov 16 19:37:01 UTC 2007


On Friday 16 November 2007 10:45, Mike Wilson wrote:
> Hope someone here can help me. I am running Busybox on Linux 2.6.10, on
> MIPS. My active filesystem is cramfs in MTD0. I copy this to /tmp (tmpfs).
> Now I want to mount this copy, then pivot_root / chroot and execute from
> there.
>
> This is the result:
>
> # ls
> cram0     ifstate   log       messages
> # mount -t cramfs /tmp/cram0 /mnt
> mount: Mounting /tmp/cram0 on /mnt failed: Block device required

This is not a busybox's mount, or it's old busybox:

$ grep -r Mounting .
(nothing)
$

for mounting filesystem image in the file, try -o loop.

> # mkdir /mnt/cram0
> mkdir: Cannot create directory `/mnt/cram0': Read-only file system
> # mkdir /tmp/cmp
> # mount -t cramfs /tmp/cram0 /tmp/cmp
> mount: Mounting /tmp/cram0 on /tmp/cmp failed: Block device required
> # mount -t cramfs /tmp/cram0 /tmp
> mount: Mounting /tmp/cram0 on /tmp failed: Block device required
>
> - what needs to be a block device?

First argument of mount frequently has to be blockdev.

> - Can I use the tmpfs, or do I need some other device to place the copy of
> the cramfs into? - How can I prepare the cramfs to be used in RAM?

Assuming that you want to mount a file which contains a filesystem image,
yes, tmpfs can be used for storing that file, and
    mount -o loop -t fstype file dir
should work.
--
vda



More information about the busybox mailing list