LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 01-21-2013, 05:47 AM   #1
antriksh
Member
 
Registered: Aug 2010
Location: In my world
Distribution: Oracle Linux 6
Posts: 83

Rep: Reputation: 0
Unhappy How to extract the contents of initramfs?


Hi. I am using RHEL 6.3. I need to extract the contents of

Code:
/boot/initramfs-2.6.32-279.el6.i686.img
Can someone help me? Which type of archive is this file?
 
Old 01-21-2013, 06:04 AM   #2
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
It seems a disk image file, and you can check it's type using:
Code:
~$ file /boot/initramfs-2.6.32-279.el6.i686.img
Post output of this command.
 
Old 01-21-2013, 06:06 AM   #3
antriksh
Member
 
Registered: Aug 2010
Location: In my world
Distribution: Oracle Linux 6
Posts: 83

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by shivaa View Post
It seems a disk image file, and you can check it's type using:
Code:
~$ file /boot/initramfs-2.6.32-279.el6.i686.img
Post output of this command.
It's a gzip compressed data file.
 
Old 01-21-2013, 06:12 AM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
It is a bzipped or gzipped file of a cpio archive.

Use "file /boot/initramfs-2.6.32-279.el6.i686.img" to see which archive is used.

Assuming bzip2:
Code:
bzcat /boot/initramfs-2.6.32-279.el6.i686.img > $HOME/initramfs-2.6.32-279.el6.i686.cpio
cd $HOME
mkdir initramfs
cd initramfs
cpio -vid < ../initramfs-2.6.32-279.el6.i686.cpio
For an initramfs file compressed with gzip, use zcat instead of bzcat.
 
Old 01-21-2013, 06:20 AM   #5
antriksh
Member
 
Registered: Aug 2010
Location: In my world
Distribution: Oracle Linux 6
Posts: 83

Original Poster
Rep: Reputation: 0
Thanks jschiwal. Your solution worked.
 
  


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
Kernel 2.6.30 extract internal InitRamFS from it? cadillackid Linux - Kernel 2 10-27-2010 12:18 AM
extract contents between two empty lines vikas027 Programming 6 12-19-2008 09:52 AM
How to extract a .exe file to read its contents BobNutfield Slackware 13 07-30-2008 07:07 PM
sed command extract contents withing body tag of html Fond_of_Opensource Linux - Newbie 6 06-04-2007 07:55 AM
Extract contents from an ISO General Linux - Software 3 12-10-2005 07:46 PM


All times are GMT -5. The time now is 02:20 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration