答复: [ale] how to mount an initrd file?

Yu, Jerry Jerry.Yu at Voicecom.com
Thu May 5 15:33:11 EDT 2005


same case under RHEL 4.0. Fortunately therein, 'file' actually tells the truth, as makes life a whole lot easier!
 
/boot$ file initrd-2.6.9-5.0.3.EL.img
initrd-2.6.9-5.0.3.EL.img: gzip compressed data, from Unix, max compression
/boot$ gunzip -dc initrd-2.6.9-5.0.3.EL.img > /tmp/junk
/boot$ file /tmp/junk
/tmp/junk: ASCII cpio archive (SVR4 with no CRC)

-----Original Message-----
From: ale-bounces at ale.org ´ú±í Michael H. Warfield
Sent: 2005-5-5 (ÐÇÆÚËÄ) 15:02
To: Atlanta Linux Enthusiasts
Subject: Re: [ale] how to mount an initrd file?
 
On Tue, 2005-05-03 at 01:08 -0400, Christopher Bergeron wrote:
> Guys - thanks for all the replys to this thread.  I ran "file" against 
> the initrd file, and the result was "raw data".  At that point, I 
> emailed this list and figured I'd have my answer within a few hours. 

> As expected, you guys came through.  As it turns out, the file was 
> Gzipped.  After ungzipingit I was able to mount it and get to the goods.

> Thanks to all whom replied (and particular thanks to Jason Fritcher).   
> I completely overlooked the fact that the file could have been compressed.

	Uh...  Just a little heads up.  Your mileage may vary and things may
change...

	I just found out that the initrd files under Fedora Core for the 2.6
kernels can not be mounted.  They are not file systems.  They're gzip
compressed cpio archives.  Surprise surprise...  Had to paw through
mkinitrd (it's just a shell script) to figure out what was going on.

> Great regards,
> Chris Bergeron

	Mike


> Randal Jarrett wrote:
> 
> >Here is a tail end of a bash script that I used on a past project.
> >I'm sure that now othere will post in perl, python, tkl...... :-)
> >
> >echo " Unziping initrd.img  "
> >gunzip -c isolinux/initrd.img >/tmp/initrd.img
> >
> >echo " Mounting /tmp/initrd.img as /mnt/loop "
> >sudo mount -o loop /tmp/initrd.img /mnt/loop
> >
> >echo " Copying ks.cfg to /mnt/loop/ks/ks.cfg "
> >cp -f ks.cfg /mnt/loop/ks/ks.cfg 
> >
> >echo " Unmounting /mnt/loop  "
> >sudo umount /mnt/loop
> >
> >echo " Gziping /tmp/initrd.img >isolinux/initrd.img  "
> >gzip -c9v /tmp/initrd.img >isolinux/initrd.img 
> >
> >echo " Removing /tmp/initrd.img "
> >rm -f /tmp/initrd.img
> >
> >echo " Making ISO image build_base.iso  "
> >mkisofs -b isolinux/isolinux.bin \
> >	-c isolinux/boot.cat \
> >	-no-emul-boot -boot-load-size 4 -boot-info-table \
> >	-V 'LDAP & MySQL' \
> >	-o ../ISOs/build_base.iso .
> >
> >
> >echo " Make sure that there is a blank CD in drive then press enter "
> >read x
> >
> >cd ..
> >
> >cdrecord -v speed=16 -eject -blank=fast  dev=/dev/hdd
> >driveropts=burnfree ISOs/build_base.iso 
> >
> >echo " Finished  "
> >
> >
> >Randal
> >
> >
> >On Sun, 2005-05-01 at 18:26 -0400, Christopher Bergeron wrote:
> >  
> >
> >>I thought this was a straightforward task, but I'm having trouble 
> >>mounting an initrd.img file.  When I try:
> >>
> >>mount -o loop initrd.img directory_to_mount_to
> >>
> >>I'm getting a "must specify filesystem" error.  Does anyone have any 
> >>idea on what I'm doing wrong?  Can I not mount this initrd.img file or 
> >>am I in fact, not specifying the correct filesystem?  I've tried -t 
> >>ext2  and -t ext3 (and -t tmpfs and -t cramfs), but to no adeu.
> >>
> >>Does anyone have any ideas?
> >>
> >>Thanks in advance,
> >>CB
> >>
> >>
> >>_______________________________________________
> >>Ale mailing list
> >>Ale at ale.org
> >>http://www.ale.org/mailman/listinfo/ale
> >>    
> >>
> 
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://www.ale.org/mailman/listinfo/ale


This email and any attached files herein contain information that is intended only for the use of the individual or entity to whom it is addressed and may contain information that is legally privileged, confidential or otherwise exempt from disclosure under applicable laws. If the reader of this message is not the recipient, any disclosure, dissemination, distribution, copying or other use or retention of this communication or its substance is prohibited.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/ms-tnef
Size: 4439 bytes
Desc: not available




More information about the Ale mailing list