LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 08-12-2009, 08:53 PM   #1
firewiz87
Member
 
Registered: Jan 2006
Distribution: OpenSUSE 11.2, OpenSUSE 11.3,Arch
Posts: 240

Rep: Reputation: 37
What is an initrd image???


I have been trying to boot am ISO image from an External Hard disk, so that i can install linux without burning ISOs to a CD/DVD.

I did manage to get the distro image to boot from Ext.HDD using syslinux, but the installation failed because the installer expects the installation media to be in a CD/DVD media.

After doing some research, i found that this problem was caused by the initrd image that was used for installation n by using a custom initrd image, the problem could be rectified.

I would like to know what exactly this initrd image is. Is it in anyway linked to the Kernel image that is provided?? Can we use the initrd/ kernel image of distro (say ubuntu) to install another distro (say OpenSUSE)??

thanx in advance for your help.....
 
Old 08-12-2009, 09:16 PM   #2
linus72
Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: PocketWriter/MinimalX
Posts: 5,057

Rep: Reputation: 328Reputation: 328Reputation: 328Reputation: 328
I dig what your saying...

But what distro are you using??

I know of a couple ways

1) kexec support, google about it..
netbootcd-3.1.2 uses kexec.bzI kernel
http://netbootcd.tuxfamily.org/

2) Unetbootin uses a kernel and initrd named ubnkernel ubninitrd or similar to boot various distro's, maybe that can help

usually, I think, the initrd is a cpio gzipped file with sometimes folders, modules, etc inside
you can open the netbootcd using this, as netbootcd is tinycore based
http://wiki.tinycorelinux.com/tiki-i...ge=Remastering

this is Hip too
http://en.wikipedia.org/wiki/Initrd
 
Old 08-12-2009, 09:46 PM   #3
mike10
Member
 
Registered: Aug 2005
Distribution: Debian amd64 with 32bit libs and Debian 32 bit laptop
Posts: 119

Rep: Reputation: 16
http://en.opensuse.org/SuSE_install_from_USB_drive

Quote:
Originally Posted by firewiz87 View Post
installation failed
What is the error message?
Quote:
Originally Posted by firewiz87 View Post

I would like to know what exactly this initrd image is.
http://google.com
in this casewikipedia has a nice article about it
Quote:
Originally Posted by firewiz87 View Post
Can we use the initrd/ kernel image of distro (say ubuntu) to install another distro (say OpenSUSE)??
It is possible
 
Old 08-12-2009, 11:07 PM   #4
firewiz87
Member
 
Registered: Jan 2006
Distribution: OpenSUSE 11.2, OpenSUSE 11.3,Arch
Posts: 240

Original Poster
Rep: Reputation: 37
Quote:
Originally Posted by mike10 View Post
thanks for the link..... dont know how i missed it.... Thanks a lot for pointing me to the link...

Quote:
Originally Posted by mike10 View Post
What is the error message?
Upon booting the ISO, the installation GUI (OpenSUSE installation wizard) never loads... gives me the text based install... not a problem actually.
I said the installation "fails" because i get stuck at a screen saying
"Check installation media1 is in the drive" or somethin...

Possibly because the installer expects the media to be a CD/DVD.

I read that this problem can be rectified by booting using a custom initrd image rather than the one in the DVD.

I did read the wiki before posting.... I did understand that
"The initial ramdisk, or initrd is a temporary file system commonly used in the boot process of the Linux kernel. It is typically used for making preparations before the real root file system can be mounted."

I was just asking why/how an initrd image can limit the installer to searching only the CD/DVD for installation media.... and how changing the initrd image can rectify the problem.....

Hope i am clear...
 
Old 08-13-2009, 10:41 AM   #5
malekmustaq
Senior Member
 
Registered: Dec 2008
Location: /root
Distribution: Slackware & BSD
Posts: 1,206

Rep: Reputation: 229Reputation: 229Reputation: 229
firewiz87:

Query: "I was just asking why/how an initrd image can limit the installer to searching only the CD/DVD for installation media...."

Answer:
Because the installer USES the initrd image, and the initrd image bound with your .iso(?) which is located in HDD somewhere WAS COMPILED to specify the basic CD/DVD drive, not a certain hardisk. Initrd handles the pre-kernel load, thus, it must have compiled with it the basic modules required by peripherals involved at boot up, here in your example the hard disk. So, you have to recompile an initrd image your self containing the modules required for the hard disk first, otherwise the initrd is missing something that it cannot explain to itself. Use --$: mkinitrd command. I shall not reinvent the lecture here, there is a suse tutorial for this, visit this site:
http://www.stress-free.co.nz/quick_h...ux_suse_kernel
this may also be useful: http://www.lugs.org.sg/pipermail/slu...ay/004740.html

========x

Query: "and how changing the initrd image can rectify the problem....."

Answer:
By providing the kernel the right environment so that it responds with the right modules.

========x

My linux talent is limited. If you are doing this for some objective purpose, you should compile together the suse kernel and the initrd image and place it into the external hdd, by this you shall have a 99.9% success.

But since you can boot from the external drive there are other possible ways of installing linux therefrom rather than fumbling with initrd issues. Have you tried mounting the iso image in a loopback? by this then the iso itself is already treated as CD/DVD, then you can proceed.

I hope this can help.

good luck and enjoy.
 
Old 08-13-2009, 11:08 PM   #6
firewiz87
Member
 
Registered: Jan 2006
Distribution: OpenSUSE 11.2, OpenSUSE 11.3,Arch
Posts: 240

Original Poster
Rep: Reputation: 37
Quote:
Originally Posted by malekmustaq View Post
If you are doing this for some objective purpose, you should compile together the suse kernel and the initrd image and place it into the external hdd, by this you shall have a 99.9% success.

But since you can boot from the external drive there are other possible ways of installing linux therefrom rather than fumbling with initrd issues. Have you tried mounting the iso image in a loopback? by this then the iso itself is already treated as CD/DVD, then you can proceed.
Yes, using a custom built initrd image..... did work. But since i am trying to avoid burning new dvd images just for installation, extracting ISOs n then replacing the kernel n initrd images every time is just not practical....

So i suppose a loopback system would be better.... but then only GRUB2 supports loopback rt??

Since its DVD images i am talking about... i cant use FAT32. That means i ll have to use either NTFS or a linux file system for my hard disk to store the DVD images... does GRUB2 have NTFS support??? Dont want to use a linux file system on an external hard disk simply because the windozz systems never detects it.... damn

Quote:
Originally Posted by malekmustaq View Post
For multi-booting Linux read Grub first:
http://www.dedoimedo.com/computers/grub.html
Thats one of the best grub tutorials.... thanx again!!

Last edited by firewiz87; 08-13-2009 at 11:14 PM.
 
Old 08-14-2009, 12:13 AM   #7
mike10
Member
 
Registered: Aug 2005
Distribution: Debian amd64 with 32bit libs and Debian 32 bit laptop
Posts: 119

Rep: Reputation: 16
have you read though http://en.opensuse.org/SuSE_install_from_USB_drive?

why not use the method outlined there?

what distro are you trying to install?
 
Old 08-14-2009, 03:27 AM   #8
firewiz87
Member
 
Registered: Jan 2006
Distribution: OpenSUSE 11.2, OpenSUSE 11.3,Arch
Posts: 240

Original Poster
Rep: Reputation: 37
Quote:
Originally Posted by mike10 View Post
have you read though http://en.opensuse.org/SuSE_install_from_USB_drive?

why not use the method outlined there?

what distro are you trying to install?
Yes i did go through the link.... i did use the method to install openSUSE n it did boot... though i didn't go through the installation process... so am not sure it really works... but i see no reason why it should nt.

I must thank you again for the link...

The reason i am still looking for other possibilities is that i need to install different Linux ISOs (like ubuntu, fedora etc)from the same ext.HDD....so i am trying to find a method which is disto independent.

However this method which uses syslinux needs the ISO images to be extracted and also has problems accessing multiple partitions....

Do correct me if i am wrong.... i am in no way an expert in any of this.....in fact i have never even "used" boot loaders to such an extend, before this....

Last edited by firewiz87; 08-14-2009 at 03:35 AM.
 
Old 08-14-2009, 07:40 PM   #9
mike10
Member
 
Registered: Aug 2005
Distribution: Debian amd64 with 32bit libs and Debian 32 bit laptop
Posts: 119

Rep: Reputation: 16
I have a dvd that dose what you want so it can be done on a dvd

http://pcquest.ciol.com/content/ente.../105070101.asp

multi-boot Live Linux DVD

let me know how things go or if you need more help. Will try to be of more help on monday

Quote:
Originally Posted by firewiz87 View Post
i need to install different Linux ISOs (like ubuntu, fedora etc)from the same ext.HDD
I misunderstand what you were trying to do, I thought this was a one off thing
 
Old 08-14-2009, 07:45 PM   #10
linus72
Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: PocketWriter/MinimalX
Posts: 5,057

Rep: Reputation: 328Reputation: 328Reputation: 328Reputation: 328
I believe you can use netbootcd to netinstall any major distro from HD

it is a tinycore remaster, it runs totally in ram..

I keep it in my /boot partition and usse it to install minimal installs, etc

http://netbootcd.tuxfamily.org/
 
Old 08-14-2009, 08:04 PM   #11
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 11,022
Blog Entries: 1

Rep: Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364
Hi,

Quote:
Originally Posted by firewiz87 View Post
<snip>
The reason i am still looking for other possibilities is that i need to install different Linux ISOs (like ubuntu, fedora etc)from the same ext.HDD....so i am trying to find a method which is disto independent.
Why not just mount your ISO image with the 'loop' device? Most installers will allow you to select the source. Of course you would still need to do a boot for the installer but there are several different methods that have been done before. You could source several distributions this way.

Edit: I forgot to include some information for the initrd.

Last edited by onebuck; 08-14-2009 at 08:07 PM.
 
Old 08-14-2009, 10:04 PM   #12
Erik_FL
Member
 
Registered: Sep 2005
Location: Boynton Beach, FL
Distribution: Slackware
Posts: 793

Rep: Reputation: 245Reputation: 245Reputation: 245
An initrd is a RAM disk image that is loaded into RAM by the boot loader along with the Linux kernel. The RAM disk file system driver is built into the kernel so Linux can access the initrd. The purpose of the initrd is to load any modules or perform any other steps required to access the root file system.

For example, the driver for a SCSI hard disk controller might be a separate module. If that module is included in an initrd then Linux can still boot from the SCSI hard disk. The boot loader calls the SCSI BIOS to load the kernel and the initrd into RAM. The "init" script in the initrd loads the driver for the SCSI hard disk, mounts the root file system on the SCSI hard disk and then starts the normal Linux init task.

In essence the "initrd" is a temporary root file system mounted by the Linux kernel using the RAM disk image in memory. The real root file system is mounted by the initrd "init" script just before it starts the normal Linux init task. When there is no initrd the Linux kernel mounts the real root file system directly but it also has to have the driver for that device built into the kernel image (not as a module).

Another way that I've used initrd is to detect RAID arrays and configure the Linux device mapper before Linux mounts the root file system on the RAID array. There is a program called "dmraid" that recognizes fake hardware RAID configurations and creates Linux device mappings. The normal initrd "init" script is designed to load modules and configure Linux OS RAID. However it is possible to create a custom "init" script and do other things with "initrd".

For a CD-ROM boot disc the initrd can provide the entire root file system. After the CD is booted, the Linux kernel and the RAM disk are both in memory and the CD can be removed. Because the file system is in RAM it can be changed. Files can be created, deleted or modified. However, the changes are not saved across a reboot since they exist only in RAM. You can create mount points, mount other file systems or copy files from other devices. The amount of storage is limited by the size of the RAM disk.

When booting from the hard disk, the initrd is only temporarily loaded into RAM. After the "init" script finishes, that starts the normal Linux init task. The initrd RAM data is freed and the RAM is available for normal allocation.

To support booting from a large number of different block storage devices the initrd image created for most distros contains all the modules for devices that are not build into the kernel image.

You can think of the initrd as a part of the kernel because it usually contains modules that are tied to the kernel. For CD booting the initrd is also the initial contents of the root filesystem. It is possible to avoid using an initrd by building all the required device drivers and file systems for the root device into the kernel. If unusual steps are required to access the root file system then one can't avoid using an initrd because the "init" script has to perform the other steps. In addition to being a container for modules the initrd has an "init" script to do things that are required before the root file system is mounted.

The concept of "initrd" is very flexible since it uses an ordinary file system and an ordinary shell script. One can put additional files in the "initrd" or make changes to the shell script. The standard "init" script has been extended to add support for encrypted file systems, OS RAID and other new features that required special steps before mounting the root file system.

One reason to use modules instead of building all the drivers into the kernel is to reduce the amount of RAM required by the kernel. Only the modules actually needed are kept in RAM and the remainder are never loaded, or they are unloaded as soon as they have determined that the associated device is not present.

Last edited by Erik_FL; 08-14-2009 at 10:09 PM.
 
Old 08-15-2009, 02:41 PM   #13
firewiz87
Member
 
Registered: Jan 2006
Distribution: OpenSUSE 11.2, OpenSUSE 11.3,Arch
Posts: 240

Original Poster
Rep: Reputation: 37
Quote:
Originally Posted by onebuck View Post
Why not just mount your ISO image with the 'loop' device?
I think thats the best way to go ie in my case.... from what i have read from the net, the only boot loader that supports loop device is grub2. And since grub2 is still in development stage.... a live CD install as in the case of grub legacy is not possible... meaning i ll have to build it from source.... lack of documentation is not helping either.... anyway i ll give it a try this week end...

Quote:
Originally Posted by onebuck View Post
Most installers will allow you to select the source. Of course you would still need to do a boot for the installer but there are several different methods that have been done before. You could source several distributions this way.
Can you please elaborate on that??
 
Old 08-15-2009, 03:04 PM   #14
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 11,022
Blog Entries: 1

Rep: Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364
Hi,

Generally you can install your ISO image on another machine then mount the image via the loop device. You could then use pxe over the network or even a 'NFS' install. Just do a search here on LQ as I know this very subject has been covered before.

If you want to use on your machine then just mount it on a loop device then point to as a source for the installer. Most distribution installers do allow a source to be used. You may have too read some documentation but alternate install means are available for most.
 
Old 08-16-2009, 07:09 AM   #15
firewiz87
Member
 
Registered: Jan 2006
Distribution: OpenSUSE 11.2, OpenSUSE 11.3,Arch
Posts: 240

Original Poster
Rep: Reputation: 37
Quote:
Originally Posted by linus72 View Post
I believe you can use netbootcd to netinstall any major distro from HD

it is a tinycore remaster, it runs totally in ram..

I keep it in my /boot partition and usse it to install minimal installs, etc

http://netbootcd.tuxfamily.org/
Can you point me to a tutorial or documentation of netbootcd?? I am not exactly clear how this netbootcd works....

Quote:
Originally Posted by onebuck View Post

Generally you can install your ISO image on another machine then mount the image via the loop device. You could then use pxe over the network or even a 'NFS' install. Just do a search here on LQ as I know this very subject has been covered before.
Are you talking about PXE boot?? Well it is one of the installation but not exactly what i am trying to achieve.

Quote:
Originally Posted by onebuck View Post
If you want to use on your machine then just mount it on a loop device then point to as a source for the installer. Most distribution installers do allow a source to be used. You may have too read some documentation but alternate install means are available for most.
I get your point about the loop device... but from what i understand... dont we need an OS or a boot loader (only grub2, as far as i know) to actually mount iso as a loop device?? Or are there other methods to do this??

Last edited by firewiz87; 08-16-2009 at 07:24 AM.
 
  


Reply


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
Make new initrd image qewldude Fedora - Installation 3 02-15-2008 09:56 AM
large initrd image link1 Linux - General 4 02-10-2008 04:13 AM
is really initrd image required. shellarchive Red Hat 2 01-02-2008 10:33 PM
mounting the initrd image d0tc0mguy Linux - Newbie 1 09-29-2006 05:16 AM
What's initrd image? Nerox Linux - Newbie 2 08-25-2004 04:53 PM


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

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