RE: [iPAQ] Ramdisk

From: Jamey Hicks <jamey.a.t.crl.dec.com>
Date: Thu Aug 31 2000 - 14:12:25 EDT

Let me elaborate on what George said in his message.

First, when we talk about a ramdisk, we're usually talking about an image of
an ext2 filesystem and not necessarily the ramdisk device driver. We often
use the ramdisk device driver, copying in the ramdisk image, mounting the
filesystem, etc., but we could also use the flash block device driver or the
loopback driver. George gave instructions on how to use the loopback device
to access an ext2 image, in which case ramdisk is not really involved at
all.

How to create an ext2 filesystem:
        mkfs -t ext2 specialfile
where specialfile is something like /dev/ram1 (for a ramdisk), /dev/flash3
(for a flash device), /dev/fd0 (for a floppy), e.g.:
        
This is the equivalent of formatting the drive. Instead of ext2, we could
use another filesystem type, such as reiserfs, fat, etc.

To extract an image of an ext2 filesystem, we can use dd from the block
device
        dd if=specialfile of=imagefile
e.g.,
        dd if=/dev/ram1 of=init-ramdisk-2-35

Finally, we almost always compress the image before making copies of it, and
we install the compressed filesystem image for the initial ramdisk, because
the initrd driver knows how to recognize and unzip compressed filesystem
images. We use the highest level of compression to minimize xmodem download
times.

        gzip -9 init-ramdisk-2-35

Given a filesystem image, one can access it as follows via ramdisk:
        mkdir mnt
        zcat init-ramdisk-2-35.gz > /dev/ram1
        mount /dev/ram1 mnt

Or via loopback:
        gunzip init-ramdisk-2-35.gz
        mount -o loop init-ramdisk-2-35 mnt

In both of these cases, we omitted the '-t fstype' option from mount because
it will read the superblock to determine the filesystem type. I've found
that I often need to supply the type when mounting fat filesystems, but
maybe that's just me.

Accessing cramfs is similar, except that cramfs is a filesystem new to 2.4
so most 2.2.x-based development machines do not support it:
        mount -o loop -t cramfs cramfs-usr-2-36 mnt

Some filesystems are created differently. Since cramfs is readonly, you
cannot 'mkfs -t cramfs' and then populate. The mkcramfs utility creates an
image of a cramfs filesystem from a directory tree.

-Jamey

> -----Original Message-----
> From: Peters Arne [mailto:Arne_Peters@danfoss.com]
> Sent: Thursday, August 31, 2000 1:08 PM
> To: 'ipaq@handhelds.org'
> Subject: [iPAQ] Ramdisk
>
>
> Hi,
>
> I have have just got the v0.13 working on my iPaq, able to
> recompile kernel,
> make new cramfs and cramfs-usr, but I am not sure how to make
> the ramdisk.
>
> Where can I find the contents (files/directories) for the ramdisk ?
> Which utility program is used for generating the ramdisk ?
>
> Best Regards
> Arne Peters
>
> _______________________________________________
> iPAQ mailing list
> iPAQ@handhelds.org
> http://handhelds.org/mailman/listinfo/ipaq
>
Received on Thu Aug 31 11:10:09 2000

This archive was generated by hypermail 2.1.8 : Tue May 04 2004 - 09:43:41 EDT