LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   dd: bs=2X , count=?X (https://www.linuxquestions.org/questions/linux-general-1/dd-bs%3D2x-count%3D-x-33880/)

adam_boz 10-27-2002 01:03 AM

dd: bs=2X , count=?X
 
Hi all. I am following a how-to on creating a bootable cd of an lfs system. One of the commands is this:

dd if=/dev/zero of=$LFS/boot/initrd bs=1024 count=6144
mke2fs -m 0 -i 1024 -F $LFS/boot/initrd

but that didn't give me enough space to put the libraries and executables that I needed in $LFS/boot/initrd, so I simply doubled the bs= and count= values, as well as the -i value for mke2fs.

Is that the correct way to do it? I'm wondering, because when I try to boot the cd now, I get this:

vfs: mounted root (ext2 filesystem) readonly
Freeing unused kernel memory: 88k freed
attempt to access beyond end of device
01:00: rw=0 want 16390, limit= 16384
ext2-fs error (device ramdisk (1,0)): ext2_read_inode: unable to read inode block
-inode=8194, block=16389
warning: unable to open an initial console
attempt to access beyond end of device
01:00: rw=0 want 16390, limit= 16384
ext2-fs error (device ramdisk (1,0)): ext2_read_inode: unable to read inode block
-inode=8193, block= 16389
kernel panic: no init found. try passing init= option to kernel

B.T.W.(if it makes a difference)- when I had the system I am burning booted, I mounted /dev/loop0 onto /mnt and got this from df:

df -h /mnt
size used avail
3.9M 1.3K 3.8M


Any help with this would be greatly appreciated.

-Adam

Mara 10-27-2002 08:18 AM

How much have you increased count? It's the size of image, but it must not be bigger than kernel RAMDISK size. Chek in kernel configuration how big can it be. Correct me if I'm wrong.

adam_boz 10-27-2002 04:28 PM

I doubled the count value, because I doubled the bs value. It looks like that was the wrong thing to do, because bs is the size of each block? well, I did it again with

dd if=/dev/zero of=$LFS/boot/initrd bs=1024 count=12288 (doubled from before)
mke2fs -m 0 -i 1024 -F $LFS/boot/initrd

OOH by the way... the next step is to mount $LFS/boot/initrd to $LFS/mnt and put everything needed in it (some executables, and some libraries, and a startup script:

mount -o loop $LFS/boot/initrd $LFS/mnt

ok, well... when I doubled the count value and not the bs value, it still doesn't give me enough space for what need in there (I just quadrupled the count value and it works... but I don't know if that'll solve my problem).

Also, after putting everything in there, you gzip it.

the kernel says that "default ramdisk size= 4096"

but the config file for isolinux (the bootloader we're using) says this:

default bootcd

label bootcd
kernel lfskernel
append initrd=initrd.gz root=/dev/ram0 init=/linuxrc ramdisk_size=16384

#####################################################

ok, well I was just trying to give you a little more info. This is all way over my head, but I think I'm slowly starting to get some of it. I am going to allow ramdisk on my current system right now, and try passing that "ramdisk_size=16384" message to it from lilo.conf

I'll post when/if I get anywhere. Please reply if you have any suggestions.

thanks in advance

-Adam

p.s.- the how-to I'm trying to figure out is here:
http://hints.linuxfromscratch.org/hi...ot-cd_easy.txt

(huh! easy... right :-)

adam_boz 10-27-2002 07:18 PM

I GOT IT WORKING!!!!

ok, so I guess when I doubled both the bs and the count values, I was really X4'ing the filesystem I made.

so I left bs the same and quadrupled the count value (like I said before) and I X4'd the amount of ramdisk that was being passed to the kernel.... now the system boots!!

so, no... you weren't wrong. Thanks for the insight.

-Adam


All times are GMT -5. The time now is 08:18 AM.