Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - General
User Name
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.


  Search this Thread
Old 02-12-2006, 09:28 PM   #1
Registered: Sep 2004
Posts: 43

Rep: Reputation: 15
Mount initrd.img?

im trying to mount initrd to remove some modules, but unable to mount it. This is what I did:
[root@dunhill mnt]# mv initrd-2.6.9-22.EL.img initrd.gz
[root@dunhill mnt]# ls -l
total 1076
drwxr-xr-x 2 root root 4096 Feb 13 14:45 initmnt
-rw-r--r-- 1 root root 1084859 Feb 13 15:15 initrd.gz
[root@dunhill mnt]# gunzip initrd.gz
[root@dunhill mnt]# ls -l
total 2308
drwxr-xr-x 2 root root 4096 Feb 13 14:45 initmnt
-rw-r--r-- 1 root root 2346496 Feb 13 15:15 initrd
[root@dunhill mnt]# mount initrd initmnt/
mount: initrd is not a block device (maybe try `-o loop'?)
[root@dunhill mnt]# mount initrd initmnt -o loop
mount: you must specify the filesystem type
[root@dunhill mnt]# mount initrd initmnt -o loop -t ext2
mount: wrong fs type, bad option, bad superblock on /dev/loop0,
or too many mounted file systems
(could this be the IDE device where you in fact use
ide-scsi so that sr0 or sda or so is needed?)
Any ideas what I'm doing wrong? I've google it, seems like all instructions were just to mount with -o loop. Thanks.
Old 02-12-2006, 09:37 PM   #2
Senior Member
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 59
Here's my Fedora notes on an initrd.img which is inside /isolinux.
You can adjust to whatever you have.
This method seems to work nicely with Fedora initrd.img

EXTRACT and EDIT INITRD.IMG (The Linux Filesystem)

# unpack the current initrd.img
mkdir /home/cdimgextract
cd /home/cdimgextract
gzip -dc < /home/isolinux/initrd.img | cpio -i
cd /home
# make any changes you need to the initrd.img in cdimgextract


cd /home/cdimgextract
# create the new initrd
rm -f /home/isolinux/initrd.img
find . | cpio -o -c | gzip -9 > /home/isolinux/initrd.img
# cleanup
cd /home
rm -rf cdimgextract
Old 02-12-2006, 09:49 PM   #3
Registered: Sep 2004
Posts: 43

Original Poster
Rep: Reputation: 15
Thanks, that works. Do you know where/what file i need to edit in the initrd.img of the first fedora installation cd to force it to load ahci module instead of ata_piix as my scsi_hostadapter?
Old 02-12-2006, 09:53 PM   #4
Senior Member
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 59
Sorry, no I don't know.


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Initrd.img spaguzz Slackware 4 12-16-2004 04:35 AM
Initrd.img spaguzz Linux - Software 1 12-09-2004 04:21 PM
What's an initrd.img? hotel-lima Linux - Newbie 2 06-11-2004 06:50 PM
initrd.img php_rocks Linux - Newbie 1 09-01-2003 12:20 AM
Initrd-x.x.x-x.img File bas12547 Linux - Software 1 07-05-2003 08:47 AM

All times are GMT -5. The time now is 10:13 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