LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices

Reply
 
Search this Thread
Old 11-09-2012, 08:47 AM   #1
chinabenjamin66
Member
 
Registered: Mar 2012
Location: Shenzhen Chian
Posts: 73

Rep: Reputation: Disabled
How to detect file system of a ramdisk.img?


Hello friends,

I would like to see what are inside of ramdisk.img and system.img

please see the properties of this img:
Code:
root@benjamin-virtual-machine:/GPL/tmp# file ramdisk.img 
ramdisk.img: u-boot legacy uImage, hRamdisk, Linux/ARM, RAMDisk Image (Not compressed), 168988 bytes, Mon Oct 10 14:45:04 2011, Load Address: 0x41000000, Entry Point: 0x41000000, Header CRC: 0x103531EB, Data CRC: 0xABED82A4
root@benjamin-virtual-machine:/GPL/tmp#
root@benjamin-virtual-machine:/GPL/tmp# file system.img 
system.img: VMS Alpha executable
root@benjamin-virtual-machine:/GPL/tmp#
I am new learner of embedded system. Can any friend here teach me what is the basic procedure for viewing the contents of a ramdisk.img or system.img?
Any ideas will be appreciated.
 
Old 11-09-2012, 10:34 AM   #2
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,395
Blog Entries: 2

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
Usually, RAM disks are compressed cpio archives. How to View, Modify and Recreate initrd.img has a decent summary of how to manipulate one.

--- rod.
 
Old 11-10-2012, 02:06 AM   #3
chinabenjamin66
Member
 
Registered: Mar 2012
Location: Shenzhen Chian
Posts: 73

Original Poster
Rep: Reputation: Disabled
Hello theNbomr,

As you can see the code, it(ramdisk.img) is Not compressed. Anyway, I have tried your advice.

Code:
  root@gpl-vm:/GPL# mv ramdisk.img ramdisk.gz
root@gpl-vm:/GPL# gunzip ramdisk.gz 

gzip: ramdisk.gz: not in gzip format
root@gpl-vm:/GPL#

Last edited by chinabenjamin66; 11-10-2012 at 02:10 AM.
 
Old 11-10-2012, 10:29 AM   #4
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,395
Blog Entries: 2

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
So, then skip the decompression part. Just de-archive it with cpio.
--- rod.
 
1 members found this post helpful.
Old 11-11-2012, 01:09 AM   #5
chinabenjamin66
Member
 
Registered: Mar 2012
Location: Shenzhen Chian
Posts: 73

Original Poster
Rep: Reputation: Disabled
Hello theNbomr,

You are right, I tried this:
Code:
root@benjamin-virtual-machine:/GPL/tmp/ramdisk# file ramdisk.img 
ramdisk.img: u-boot legacy uImage, hRamdisk, Linux/ARM, RAMDisk Image (Not compressed), 168988 bytes, Mon Oct 10 14:45:04 2011, Load Address: 0x41000000, Entry Point: 0x41000000, Header CRC: 0x103531EB, Data CRC: 0xABED82A4
root@benjamin-virtual-machine:/GPL/tmp/ramdisk# dd if=ramdisk.img of=./out64c bs=64c skip=1
2640+1 records in
2640+1 records out
168988 bytes (169 kB) copied, 0.0275843 s, 6.1 MB/s
root@benjamin-virtual-machine:/GPL/tmp/ramdisk# ll
total 344
drwxr-xr-x 2 root root   4096 Nov 11 10:45 ./
drwxr-xr-x 6 root root   4096 Nov 11 10:29 ../
-rw-r--r-- 1 root root 168988 Nov 11 10:45 out64c
-rw-r--r-- 1 root root 169052 Nov  9 21:56 ramdisk.img
root@benjamin-virtual-machine:/GPL/tmp/ramdisk# file out64c 
out64c: gzip compressed data, from Unix
root@benjamin-virtual-machine:/GPL/tmp/ramdisk# cp out64c out64c.gz
root@benjamin-virtual-machine:/GPL/tmp/ramdisk# mv out64c ../
root@benjamin-virtual-machine:/GPL/tmp/ramdisk# gzip  -d out64c.gz 
root@benjamin-virtual-machine:/GPL/tmp/ramdisk# ll
total 448
drwxr-xr-x 2 root root   4096 Nov 11 12:08 ./
drwxr-xr-x 6 root root   4096 Nov 11 12:08 ../
-rw-r--r-- 1 root root 276736 Nov 11 12:07 out64c
-rw-r--r-- 1 root root 169052 Nov  9 21:56 ramdisk.img
root@benjamin-virtual-machine:/GPL/tmp/ramdisk# cpio -i -F out64c 
541 blocks
root@benjamin-virtual-machine:/GPL/tmp/ramdisk# ll
total 608
drwxr-xr-x 8 root root   4096 Nov 11 14:46 ./
drwxr-xr-x 6 root root   4096 Nov 11 12:08 ../
drwxrwx--x 2 root root   4096 Nov 11 14:46 data/
-rw-r--r-- 1 root root    118 Nov 11 14:46 default.prop
drwxr-xr-x 2 root root   4096 Nov 11 14:46 dev/
-rwxr-x--- 1 root root 107736 Nov 11 14:46 init*
-rwxr-x--- 1 root root   1677 Nov 11 14:46 init.goldfish.rc*
-rwxr-x--- 1 root root  17429 Nov 11 14:46 init.rc*
-rw-r--r-- 1 root root 276736 Nov 11 12:07 out64c
drwxr-xr-x 2 root root   4096 Nov 11 14:46 proc/
-rw-r--r-- 1 root root 169052 Nov  9 21:56 ramdisk.img
drwxr-x--- 2 root root   4096 Nov 11 14:46 sbin/
drwxr-xr-x 2 root root   4096 Nov 11 14:46 sys/
drwxr-xr-x 2 root root   4096 Nov 11 14:46 system/
root@benjamin-virtual-machine:/GPL/tmp/ramdisk#
Thank you very much.
 
  


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
how to unpack a img file's file system? chinabenjamin66 Linux - Newbie 21 11-14-2012 07:20 AM
Q: Build a ramdisk with root file system for x86. wdli Linux - Kernel 5 01-10-2012 08:37 AM
detect file deletion on an operating system and trace the file history or activity? lovsis Linux - Security 2 10-19-2010 08:52 AM
Building a file system ( Ramdisk) ayoub Linux - Newbie 1 11-10-2005 08:48 PM
Core file creation problem on ramdisk system hasse69 Linux - General 1 05-12-2005 03:06 PM


All times are GMT -5. The time now is 01:22 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration