From stock@stokkie.net Sun Jun 1 23:40:23 2003 +0200 Date: Sun, 1 Jun 2003 23:40:23 +0200 (CEST) From: "Robert M. Stockmann" To: "Ronald W. Henderson" Subject: Re: CRK increase RAM disk size problem... In-Reply-To: <000001c3287e$bb472c60$13dede0a@rwhn800v> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Status: RO X-Status: X-Keywords: On Sun, 1 Jun 2003, Ronald W. Henderson wrote: > Robert: > > I have been playing around with your CRK (v2.4.20) software (nice job!) and > have added additional linux programs in the utils directory. I have > exhausted the 12MB RAM disk. I need to increase the size for inclusion of > all the programs I want to add. I have tried many attempts to increase this > size but failed... > > To date this is what I have done: > > On my /dev/hda1 mounted as /mnt/root I have increased the size of the > ramdisk_size parameter to 32768: > > 1) Gunziped untarred: diskfiles2420-rwh-crk.tar.gz into /mnt/root > > 2) Changed /etc/lilo.conf > > [root@shopper etc]# cat lilo.conf > boot=/dev/hda > map=boot/map > install=boot/boot.b > message=etc/message.txt > compact > prompt > > image=vmlinuz > label=linux > append="root=/dev/ram0 ramdisk_size=32768" > initrd=boot/rootrh80.gz > root=/dev/ram0 > read-only > > 3) Update MBR with lilo: lilo -C etc/lilo.conf > > 4) Then created a "diskimage.img" file using: > > # dd if=/dev/had of=./diskimage.img bs=1k count=32768 > > 5) I used the "strings" command to investigate the "diskimage.img" file to > make sure it including the changes.. > > After creating a new iso image using your method with: mkisofs and then > creating a CDROM... > > I still get a RAM disk size of 12MB.... > Can you help? Hi! sure :) ehh you forgot one thing actually . And that is to also expand the container of the life root filesystem as it runs as the CRK is booted: [Jackson:root]:(/tmp)# mkdir foo [jackson:root]:(/tmp)# cd foo [jackson:root]:(/tmp/foo)# tar xvzpf /mnt/data2/crash.2.4.20-usb2/boot/disk diskfiles2420-usb2.tar.gz diskimage.img [jackson:root]:(/tmp/foo)# tar xvzpf /mnt/data2/crash.2.4.20-usb2/boot/diskfiles2420-usb2.tar.gz boot/ boot/boot.b boot/map boot/boot-menu.b boot/boot-text.b boot/boot.0700 boot/boot.0800 boot/chain.b boot/os2_d.b boot/rootrh80.gz dev/ dev/fd0 dev/ram dev/ram0 etc/ etc/lilo.conf etc/message.txt vmlinuz [jackson:root]:(/tmp/foo)# cp boot/rootrh80.gz /tmp/ [jackson:root]:(/tmp/foo)# cd /tmp/ [jackson:root]:(/tmp)# gunzip rootrh80.gz [jackson:root]:(/tmp)# ll [jackson:root]:(/tmp)# ll total 12708 -rw-r--r-- 1 root root 12582912 Jun 1 23:17 rootrh80 [jackson:root]:(/tmp)# losetup /dev/loop0 /tmp/rootrh80 [jackson:root]:(/tmp)# mkdir /mnt/root [jackson:root]:(/tmp)# mount /dev/loop0 /mnt/root/ [jackson:root]:(/tmp)# cd /mnt/root/ [jackson:root]:(/mnt/root)# ll total 34 drwxr-xr-x 2 root root 1024 Nov 9 2002 bin/ drwxr-xr-x 2 root root 1024 Nov 22 1996 boot/ drwxr-xr-x 2 root root 1024 Nov 23 1996 cdrom/ drwxr-xr-x 3 root root 8192 Mar 29 2002 dev/ drwxr-xr-x 4 root root 1024 Nov 9 2002 etc/ drwxr-xr-x 2 root root 1024 May 18 1996 floppy/ drwxr-xr-x 5 root root 1024 Nov 9 2002 lib/ drwx------ 2 root root 12288 Nov 9 2002 lost+found/ drwxr-xr-x 2 root root 1024 Jun 24 1995 mnt/ drwxr-xr-x 2 root root 1024 Nov 22 1996 proc/ drwxr-xr-x 2 root root 1024 Nov 24 1995 root/ drwxr-xr-x 2 root root 1024 Nov 9 2002 sbin/ drwxr-xr-x 2 root root 1024 Jan 30 1994 tag/ drwxrwxrwt 2 root root 1024 Nov 22 1996 tmp/ drwxr-xr-x 6 root root 1024 Mar 25 2000 usr/ drwxr-xr-x 9 root root 1024 Nov 22 1996 var/ [jackson:root]:(/mnt/root)# cd .. [jackson:root]:(/mnt)# What we have here is the life ram root filesystem when the CRK is booted. Whats wrong with it now ? it only occupies 12 Mb disk space :) [jackson:root]:(/mnt)# df Filesystem 1K-blocks Used Available Use% Mounted on /dev/loop0 11895 6457 5438 55% /mnt/root [jackson:root]:(/mnt)# so we need to create a 32 Mb container. Let's make that 64 Mb. In order to do that you need your current Linux system also to boot with a RAM disk size supported upto 65536 kb. For this see the kernel source documentation /usr/src/linux/Documentation/ramdisk.txt So then do as follows on a ordinary redhat machine : # dd if=/dev/zero of=/dev/ram0 bs=1k count=65536 # mke2fs -vm0 /dev/ram0 65536 # mount -t ext2 /dev/ram0 /mnt/floppy # cd /mnt/root # tar -cpf - --exclude=lost+found . |( cd /mnt/floppy ; tar xvpf - ) # cd / # sync # sync # sync # umount /mnt/floppy # umount /mnt/root # dd if=/dev/ram0 bs=1k count=65536 | gzip -v9 > /tmp/rootrh80-32.gz Put that /tmp/rootrh80-32.gz back into the diskimage like you created that above. Actually the boot/diskimage on the iso itself doesn't nessesarily have to be 32 MB also :) rerun the lilo... and you have your big rootfilesystem. Regards, Robert