LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Mount initrd.img? (https://www.linuxquestions.org/questions/linux-general-1/mount-initrd-img-414713/)

sti2envy 02-12-2006 08:28 PM

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.

homey 02-12-2006 08:37 PM

Here's my Fedora notes on an initrd.img which is inside /isolinux.
You can adjust to whatever you have.
Code:

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


REMAKE MODIFIED INITRD.IMG

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


sti2envy 02-12-2006 08:49 PM

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?

homey 02-12-2006 08:53 PM

Sorry, no I don't know.


All times are GMT -5. The time now is 06:33 AM.