Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 09-29-2008, 07:27 AM   #1
Registered: Nov 2007
Posts: 88

Rep: Reputation: 15
Create an initrd


i want to create a initial Ramdisk i dont know how but i think i must create an initrd to load my kernel on my board flash when i create the initrd the dd command it's my problem when i use it as following :

dd if=/dev/zero of=initrd bs=4096

then no thing stops here and no thing to be done,

if you have an experience about the kernel Ramdisk and how to load it on at91rm9200dk board please help me
Old 09-29-2008, 07:40 AM   #2
LQ Guru
Registered: Mar 2004
Distribution: Slackware
Posts: 6,230

Rep: Reputation: 714Reputation: 714Reputation: 714Reputation: 714Reputation: 714Reputation: 714Reputation: 714
You need to tell to dd how much blocks you want to copy with count= option

Now usually the initrd are not image file made with dd, but rather an image made with cpio program
Are you sure you don't have a script that makes all the initrd procedure for you ?
like mkinitrd or mkramfs or a command with similar name

Which Linux distribution are you using ?
Old 09-29-2008, 08:02 AM   #3
Senior Member
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50
An initramfs image will take up less space than initrd; create the directory structure, let's say it's in a directory called '/stuff'. According to the documentation in the Linux source directory you'd do something like:

cd /stuff
find . | cpio -o -H newc | gzip > ../myinitrd.img

Note: the documentation states that the 'cpio' documentation gives bad advice on how to generate the image, so don't follow any cpio docs on how to create the initramfs image.

The trick now is in the booting; for a genuine initrd, you need to pass the kernel "init=blah" to tell the kernel what to use for init (for example: init=/bin/sh), but for an initramfs you need "rdinit=blah".

But - if you really want an initrd:
dd if=/dev/zero of=myinitrd bs=512 count=40000
mke2fs myinitrd
mount myinitrd /mnt -o loop

and so on ... and after copying files into the image:
gzip myinitrd


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to create new initrd.gz (or initrd.img) file? kkpal Programming 2 12-10-2007 09:38 AM
to create initrd on CD on fedora what is used tkmsr Linux - Software 11 10-31-2007 04:42 AM
Create initrd namit Linux - Software 8 08-12-2007 06:50 PM
failed to create initrd gunnix Debian 1 01-05-2007 08:01 PM
create initrd alaios Debian 5 01-19-2005 10:54 AM > Forums > Linux Forums > Linux - Software

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

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration