Skip to contentSkip to conversation

problem mounting ramdisk

DISCUSSION Andreas Schreckenberg 3 participants 4 messages Jan 4, 2001 – Jan 9, 2001

lore
Share & tools
lore
#1 lore raw
In reply to Andreas Schreckenberg

Hi,
It looks to me like you made your ramdisk bigger than 4MB, which is the default ramdisk size. You can either modify drivers/block/rd.c and change the value of rd_size, add the "ramdisk_size=" parm to the boot command line, or create a smaller ramdisk image.
-Jim Lewis

Quoted 67 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]]On Behalf Of Andreas
Schreckenberg
Sent: Thursday, January 04, 2001 12:50 PM
To: [email protected]
Subject: problem mounting ramdisk

hello,

My linux (modified kernel 2.2.14) starts
on my custom PPC board (PPC750/128MB)
but when I mount the ramdisk, the kernel issues:

...
Serial driver version 4.27 with no serial options enabled ttyS00 at 0x12000000 (irq = 16) is a 16550A
RAM disk driver initialized: 16 RAM disks of 4096K size
RAMDISK: Compressed image found at block 0
attempt to access beyond end of device
01:00: rw=0, want=8196, limit=4096
dev 01:00 blksize=1024 blocknr=8195 sector=16390 size=1024 count=1 EXT2-fs error (device ramdisk(1,0)): read_block_bitmap:
Cannot read block bitmap - block_group = 1, block_bitmap = 52428800 attempt to access beyond end of device
01:00: rw=0, want=16386, limit=4096
dev 01:00 blksize=1024 blocknr=16385 sector=32770 size=1024 count=1 EXT2-fs error (device ramdisk(1,0)): read_block_bitmap:
Cannot read block bitmap - block_group = 2, block_bitmap = 20971520 attempt to access beyond end of device
01:00: rw=0, want=24580, limit=4096
... (and so on)

... (later)
VFS: Mounted root (ext2 filesystem).
Freeing unused kernel memory: 40k init 28k prep 4k pmac 12k open firmware
...

... (last)
EXT2-fs error (device ramdisk(1,0)): ext2_read_inode:
unable to read inode block - inode=4001, block=16389

Kernel panic: No init found.  Try passing init= option to kernel.

Rebooting in 5 seconds..
...

The fs image contains no shell at the moment, so the last kernel panic is okay.

What is the Problem with EXT2-fs error ?
I used the following script on my x86 host (<- the problem ?) to build the compressed image:

#!/bin/sh
dd if=/dev/zero of=/dev/ram bs=1k count=4096 mke2fs -m0 /dev/ram
mkdir -p /mnt/ram
mount /dev/ram /mnt/ram
(cd file_system; cp -a * /mnt/ram)
umount /mnt/ram
rmdir /mnt/ram
dd if=/dev/ram of=fs_images/ramdisk.image bs=1k count=4096 (cd fs_images;gzip -v9f ramdisk.image)

Quoted 8 lines

every help would be appreciated...

bye
Andreas
--
Life's not fair. But the root password helps ! :-)
http://schrecky.home.pages.de

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#0 lore raw

hello,

My linux (modified kernel 2.2.14) starts
on my custom PPC board (PPC750/128MB)
but when I mount the ramdisk, the kernel issues:

...
Serial driver version 4.27 with no serial options enabled
ttyS00 at 0x12000000 (irq = 16) is a 16550A
RAM disk driver initialized: 16 RAM disks of 4096K size
RAMDISK: Compressed image found at block 0
attempt to access beyond end of device
01:00: rw=0, want=8196, limit=4096
dev 01:00 blksize=1024 blocknr=8195 sector=16390 size=1024 count=1
EXT2-fs error (device ramdisk(1,0)): read_block_bitmap: Cannot read block bitmap - block_group = 1, block_bitmap = 52428800 attempt to access beyond end of device
01:00: rw=0, want=16386, limit=4096
dev 01:00 blksize=1024 blocknr=16385 sector=32770 size=1024 count=1
EXT2-fs error (device ramdisk(1,0)): read_block_bitmap: Cannot read block bitmap - block_group = 2, block_bitmap = 20971520 attempt to access beyond end of device
01:00: rw=0, want=24580, limit=4096
... (and so on)

... (later)
VFS: Mounted root (ext2 filesystem).
Freeing unused kernel memory: 40k init 28k prep 4k pmac 12k open firmware
...

... (last)
EXT2-fs error (device ramdisk(1,0)): ext2_read_inode: unable to read inode block - inode=4001, block=16389

Kernel panic: No init found.  Try passing init= option to kernel.

Rebooting in 5 seconds..
...

The fs image contains no shell at the moment, so the last kernel panic is okay.

What is the Problem with EXT2-fs error ?
I used the following script on my x86 host (<- the problem ?) to build the compressed image:

#!/bin/sh
dd if=/dev/zero of=/dev/ram bs=1k count=4096 mke2fs -m0 /dev/ram
mkdir -p /mnt/ram
mount /dev/ram /mnt/ram
(cd file_system; cp -a * /mnt/ram)
umount /mnt/ram
rmdir /mnt/ram
dd if=/dev/ram of=fs_images/ramdisk.image bs=1k count=4096 (cd fs_images;gzip -v9f ramdisk.image)

every help would be appreciated...

bye
Andreas
--
Life's not fair. But the root password helps ! :-)
http://schrecky.home.pages.de

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#2 lore raw

I had a similar problem (with the "attempt to access beyond end of device" symptom) when the size of my initrd exceeded the kernel ramdisk_size. I don't see the problem with your script but I used a slightly different method so I am including the script which eventually worked for me (on an x86 host, by the way). Might be worth a try. You also might try increasing the kernel's idea of the ramdisk size to see if it helps (one way is to edit ramroot_string in arch/ppc/boot/misc.c, I use "root=/dev/ram ramdisk_size=6144").

Here's my script:

# NOTE: (bs * count) <= ramdisk_size

# the ramdisk uncompress/init code will NOT complain if you exceed ramdisk_size,
# but you may see "attempt to access beyond end of device" messages
dd if=/dev/zero of=/tmp/ramimage.tmp bs=1k count=4096
/sbin/mke2fs -m 0 -i 2000 /tmp/ramimage.tmp
mount -o loop -t ext2 /tmp/ramimage.tmp /mnt
cd file_system; tar cf - * | (cd /mnt; tar xf -)
umount /mnt
dd if=/tmp/ramimage.tmp bs=1k | gzip -v9 > ramdisk.gz
du -ch file_system > file_system.txt

The last line is just for informational purposes.

Good luck.
Tania

Quoted 51 lines · Andreas Schreckenberg

hello,

My linux (modified kernel 2.2.14) starts
on my custom PPC board (PPC750/128MB)
but when I mount the ramdisk, the kernel issues:

...
Serial driver version 4.27 with no serial options enabled
ttyS00 at 0x12000000 (irq = 16) is a 16550A
RAM disk driver initialized: 16 RAM disks of 4096K size
RAMDISK: Compressed image found at block 0
attempt to access beyond end of device
01:00: rw=0, want=8196, limit=4096
dev 01:00 blksize=1024 blocknr=8195 sector=16390 size=1024 count=1
EXT2-fs error (device ramdisk(1,0)): read_block_bitmap: Cannot read block bitmap - block_group = 1, block_bitmap = 52428800 attempt to access beyond end of device
01:00: rw=0, want=16386, limit=4096
dev 01:00 blksize=1024 blocknr=16385 sector=32770 size=1024 count=1
EXT2-fs error (device ramdisk(1,0)): read_block_bitmap: Cannot read block bitmap - block_group = 2, block_bitmap = 20971520 attempt to access beyond end of device
01:00: rw=0, want=24580, limit=4096
... (and so on)

... (later)
VFS: Mounted root (ext2 filesystem).
Freeing unused kernel memory: 40k init 28k prep 4k pmac 12k open firmware
...

... (last)
EXT2-fs error (device ramdisk(1,0)): ext2_read_inode: unable to read inode block - inode=4001, block=16389

Kernel panic: No init found.  Try passing init= option to kernel.

Rebooting in 5 seconds..
...

The fs image contains no shell at the moment, so the last kernel panic is okay.

What is the Problem with EXT2-fs error ?
I used the following script on my x86 host (<- the problem ?) to build the compressed image:

#!/bin/sh
dd if=/dev/zero of=/dev/ram bs=1k count=4096 mke2fs -m0 /dev/ram
mkdir -p /mnt/ram
mount /dev/ram /mnt/ram
(cd file_system; cp -a * /mnt/ram)
umount /mnt/ram
rmdir /mnt/ram
dd if=/dev/ram of=fs_images/ramdisk.image bs=1k count=4096 (cd fs_images;gzip -v9f ramdisk.image)

Quoted 8 lines

every help would be appreciated...

bye
Andreas
--
Life's not fair. But the root password helps ! :-)
http://schrecky.home.pages.de

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#3 lore raw
Quoted 1 line · Tania Oka

Hello,

Quoted 2 lines

I had a similar problem (with the "attempt to access beyond end of device" symptom) when the size of my initrd exceeded the ...

Thanks a lot. Yes indeed the problem was the ramdisk size.

#!/bin/sh
dd if=/dev/zero of=/dev/ram bs=1k count=4096
mke2fs -m0 /dev/ram

I changed Line 3 (give mke2fs the right number of blocks):
mke2fs -vm0 /dev/ram 4096 and add the line ramdisk_size=4096 to the kernel.

...
RAM disk driver initialized: 16 RAM disks of 4096K size
RAMDISK: Compressed image found at block 0
VFS: Mounted root (ext2 filesystem).
Freeing unused kernel memory: 36k init 28k prep 4k pmac 12k open firmware
...

Vola. The ramdisk starts.

But my sash do not come up.
The kernel hangs without panic issues.

I used in /bin (the sash seems to be a little big):

-rwxr-xr-x   1 root     root       467284 Jan  5 11:32 sash
lrwxrwxrwx   1 root     root            4 Jan  5 17:19 sh -> sash

from:
hhl-ppc_7xx-sash-3.4-5.noarch.rpm (alien -t because I use debian)

                         ^ ??? (the problem)

-> hhl-ppc_7xx-sash-3.4.tgz
(from the Monta Vista Hardhat /pub/CDK/1.2/latest/PowerPC/ppc_7xx/RPMS)

I compiled the kernel with CONFIG_BINFMT_ELF without CONFIG_SASH. Do I need CONFIG_BINFMT_ELF32 or CONFIG_SASH ? What the difference ?

When I try to cross compile the sash:
...
powerpc-linux-gcc -static -s -o sash sash.o cmds.o cmd_dd.o cmd_ed.o cmd_grep.o cmd_ls.o cmd_tar.o cmd_gzip.o cmd_find.o cmd_file.o cmd_chattr.o cmd_ar.o utils.o
/usr/local/powerpc-linux/bin/ld: cannot open crt1.o: No such file or directory
collect2: ld returned 1 exit status
make: *** [sash] Error 1
...

crt1.o = "c run time environment"

What's my problem ? I'm a bloody newbie to linux kernel/cross development :-) Hope I am not offtopic here.

I installed gcc-2.95.2 and binutils-2.9.5.0.22 on my host described in
http://members.nbci.com/greyhams/linux/PowerPC-Embedded-HOWTO.html
(enough to build the kernel)

Is there anybody who can give me a valid ramdisk_image for a PPC750 System. I need: cat,ls,insmod,bash and sash
(the ramdisk should be not greater then 16M)
Write to: [email protected]

Any help would be welcome...

bye
Andreas
--
Life's not fair. But the root password helps ! :-)
http://schrecky.home.pages.de

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/