[Celinux-dev] mount error when I mount ext2 block file in Ubuntu 6.06

Paolo Giarrusso p.giarrusso at gmail.com
Sat Sep 16 08:19:53 PDT 2006


On 9/16/06, chenggh <chenggh04 at st.lzu.edu.cn> wrote:
> Hi:
>         Maybe I find what the problem is ^_^. It is very strange. Please look at as
> something as following:

>         If I set the file with 4M it failed when I mount it.
No, it fails when you format it - as reported by:
# file rootfs
rootfs: data
above.

The problem is that this command, while being correct, fails for a bug
due to the filename - it is likely that your /etc/mtab is a symlink to
/proc/mounts.

On any modern Linux system:
$ head -n 1 /proc/mounts
rootfs / rootfs rw 0 0

Here, rootfs does not refer to your file but to a "fake" mount.

After seeing the output of this command, you can see that mkfs does
not understand this simple fact:

# mkfs.ext2 rootfs
mke2fs 1.38 (30-Jun-2005)
rootfs is not a block special device.
Proceed anyway? (y,n) y
rootfs is mounted; will not make a filesystem here!

What you did not note is that it did not format it then.

You could make it complete the format anyway, despite its wrong answer
to "is this mounted?", with the "force" option (I do not remember the
syntax). Or simply by not using "rootfs" as filename.

Bye


More information about the Celinux-dev mailing list