LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-14-2009, 12:02 PM   #1
salilgk
LQ Newbie
 
Registered: Jun 2009
Posts: 20

Rep: Reputation: 0
Help to access cdrom in initrd


Hello

I am trying to create a live CD from my RHEL5.3 installed machine. This is for some internal testing purpose !! The following is what I am doing

1. I took syslinux and replaced initrd and vmlinuz in isolinux directory with the one in the server.
2. I created a file of ext3 file system and copied every thing under / in the server ( except dev, proc, sys, tmp )
3. Copied the file to CD
4. I need to modify initrd init script to mount the file ( file system ) to some directory and create required devices, mount proc and switch root.
5. Switch root to the newly mounted directory.

Here I am not sure how to get the handle to cdrom in initrd. Could some one help me give me some tips on how to do this in init script please.

If you have a better way to make a liveCD from an already existing system, please let me know. I don't want to dump every thing in initrd :-(.

Thanks
Salil
 
Old 06-17-2009, 01:55 PM   #2
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Arch/Manjaro, might try Slackware again
Posts: 1,851
Blog Entries: 14

Rep: Reputation: 284Reputation: 284Reputation: 284
I probably don't understand the question, because the answer seems too easy! On my machine the cdrom devices are simply /dev/hdc and /dev/hdd, as they're both IDE devices. To mount either one in the init script in the initrd, you would need the filesystem modules and then simply issue e.g.: mount /dev/hdc /MountPointInInitrd. I presume the modules needed would depend on the cdrom; iso9660, joliet, RockRidge. I *think* those are all included in the fat support and if I recall you need the nls and codepage modules also...
 
Old 06-18-2009, 12:47 AM   #3
salilgk
LQ Newbie
 
Registered: Jun 2009
Posts: 20

Original Poster
Rep: Reputation: 0
Hello Harmless

Thanks for the reply. I think I will have to scan the devices like hdc or hdd ( or is it going to srX in case of scsi devices ?? )

One more thing I am getting stuck is - I am not able to change the init script in the initrd. In RHEL based initrd nash is being used as the shell - which has very limited features !! So I thought of adding sh or bash ( statically linked ) in the /bin directory of initrd and change init script to run sh. But that doesn't work some how. I don't know if the kernel has any hard binding to nash or not !!!.

Thanks
salil
 
Old 06-19-2009, 10:13 AM   #4
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Arch/Manjaro, might try Slackware again
Posts: 1,851
Blog Entries: 14

Rep: Reputation: 284Reputation: 284Reputation: 284
Rather than trying sh or bash, you'd be better off copying over busybox into the initrd-tree/bin; that will enable you to use mount, ls and everything else you need.
 
Old 06-20-2009, 12:19 PM   #5
salilgk
LQ Newbie
 
Registered: Jun 2009
Posts: 20

Original Poster
Rep: Reputation: 0
Yeah busybox can be added .. but the point is - I am not able to execute a command in nash environment.

Salil
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to mount cdrom after booting into initrd from CD !!! ENVee Linux - Kernel 1 04-19-2008 11:37 AM
How to create new initrd.gz (or initrd.img) file? kkpal Programming 2 12-10-2007 08:38 AM
how do i get access to the cdrom arnon Linux - Newbie 5 12-31-2006 11:19 AM
How do I put kernel and initrd on a CDROM? krzysw Red Hat 1 02-19-2004 05:03 PM
Cant access first cdrom after adding second cdrom Zero-0-Effect Slackware 2 02-18-2004 09:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:28 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration