LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 01-02-2010, 09:12 AM   #1
peaceful_lad
LQ Newbie
 
Registered: Jan 2010
Location: Bahrain
Posts: 8

Rep: Reputation: 0
Question cramfsck: superblock magic not found (Scientific Linux)





Good evening everyone!
I have come across a problem on my Scientific Linux, I have searched the forum but couldn't find what I am looking for, so I decided to post my question here.

well, here what I did: under the Terminal I got Cramfs-1.1.tar.gz installed, and then i used the "make" command to build the cramfsck and mkcramfs and it was all successful.

so now I have an image I called it "backup.img", and I tried following command:

./cramfsck -x ./output backup.img

but unfortunetly I got the following message:

./cramfsck: superblock magic not found

So I kept on thinking what is this Superblock magic thingy? I did a google search but I kind of got lost and didn't end up finding anything useful, but I am just thinking it could be some kind of package which I need to install? I tried the following command:

apt-get install magic

but it seems there is not such package exists with that name.

So, could anyone please guide me to the right way or help me with few tips or hints? I would really appreciate it!

Thanks in Advance!

Best wishes,

~sam~

















 
Old 01-03-2010, 04:11 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,292

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
Switch off the bold type please.

Cramfsck is a Cram File System ChecKer. In your command, It should be putting a cramfs, backup.img in ./output/ Correct?

Now it's not finding superblock magic in backup.img. Superblock magic is a code that identifies this as a cramfs, extfs, whatever, That leads me to suspect backup.img, as many .img files are compressed with cpio

try file backup.img and see what it reports.
 
Old 01-03-2010, 10:53 PM   #3
peaceful_lad
LQ Newbie
 
Registered: Jan 2010
Location: Bahrain
Posts: 8

Original Poster
Rep: Reputation: 0
Smile


Hi Business,
thanks for the reply. I have switched off the bold, I am sorry about that, it is just that I have certain vision problems due to my diabetis condition and I thought the bold would help me see the fonts better but now I see it is only when it gets posted the bold shows off.

Thanks for the explaination Business, now I understand what that message meant, I'll use the "file" command and see what it gives me and I'll post it on here.

Best wishes,

~sam~

 
Old 01-04-2010, 12:22 AM   #4
peaceful_lad
LQ Newbie
 
Registered: Jan 2010
Location: Bahrain
Posts: 8

Original Poster
Rep: Reputation: 0
Smile


Hi Business,
I tried the "File" command and It gave me quite a nice report, I am not sure how to embed the code or the repotr in here so I decided to take a snapshot and attache it with this post. but it did report that the backup.img file is a "linux compressed Rom File system data, big endian size 1093632 version #2 stored_dirs CRC 0x44c75ad4, edition 0, 282 blocks, 6 files".

I think I can understand some of it, but not sure what a big endian is, and it has some kind of version too, and it actually doesn't mention cramfs file system, so I guess that means that this img file won't work with "cramfsck" and probably needs something else.

what do you think Business? can you make out anything useful out of this report?

Thanks in advance.

Best wishes,

~sam~



Attached Thumbnails
Click image for larger version

Name:	Capture.JPG
Views:	242
Size:	83.8 KB
ID:	2411  
 
Old 01-04-2010, 04:37 AM   #5
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,292

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
Big endian & little endian refers to data storage. If you have a 64 bit number occupying 8 consecutive bytes, do you start with the big(most significant) or little(least significant) end? The answer is I don't care, as long as you start with the same one always. x86 systems use little endian, and that file is big endian, so you have a problem. You also have a non native file (i.e. not for a pc)

There are utilities to swap the endian-ness of a file, but they are usually wrapped up in java objects or compilers. They have to be able to read this thing,and to do that they have to know how wide to read. There is also middle endian, but I don't want to be responsible for headaches.
http://en.wikipedia.org/wiki/Endianness
 
1 members found this post helpful.
Old 01-04-2010, 06:04 AM   #6
peaceful_lad
LQ Newbie
 
Registered: Jan 2010
Location: Bahrain
Posts: 8

Original Poster
Rep: Reputation: 0
Smile



Hi Business,
Thanks for the reply!
that is really interesting. I'm going through the Wikipedia link which you have shared with me and I'll try to learn more about this.

Thank you very much! This is going to be a fun experience for me, this is really all new for me so I am all excited about learning it.

Best wishes,

~sam~
 
Old 01-05-2010, 05:13 AM   #7
peaceful_lad
LQ Newbie
 
Registered: Jan 2010
Location: Bahrain
Posts: 8

Original Poster
Rep: Reputation: 0
Smile


Good afternoon Business! Good afternoon everyone!
I am glad to say that I managed to mount the image file I was having trouble with, I read a bit more about converting a big endian to a little endian and found out that there is a package that does that, I also found that it the convertion can be done by swaping bytes done programmtically with a simple say perl or c++ script and I would feel that would be more exciting, but here what I did:

First I went on searching for things related to Cramfs:

apt-cache search cramfs

and cameup with the following list of packages (attachement Capture1.jpg).

now the interesting thing is I found a package called: "cramfsswap", and it has a description next to it that says "swap endian file system", so I got it installed with the following command:

apt-get install cramfsswap


after that it was very simple, just used the default command for it:

cramfsswap backup.img newbackup.img

and It did it

Then I was able to mount the newbackup.img onto a new directory I made, here what I did:

mkdir tmpMount

then

mount -o loop newbackup.img ./tmpMount

and that is it! then I was able to access the mount point like this:

cd ./tmpMount

and I was able to access the content of the image file. how cool is that

But I must admit, I was a bit disappointed after accessing the backup img filee, because its content wasn't as I expected, I found that the content is organized into folders, it is like this:

root> platform > kernel

and within the "kernel" folder I found two files "bild" and "os". it is not really what I expected, I thought I would see more files and folders, so now I am trying to find out what those two files are. my main objective when I first started this is to retrieve certain files from the img file, but now I can see it is not as simple as it sounds, but I am having alot of fun trying to find a way.

Thanks again Business Kid for putting me on the right tarck!

Best wishes,

~sam~





Attached Thumbnails
Click image for larger version

Name:	Capture1.JPG
Views:	195
Size:	41.4 KB
ID:	2414  
 
  


Reply



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
Bad magic number in superblock, again! R00T.OSIRIS Linux - Hardware 4 10-26-2007 09:49 PM
bad magic number superblock niallmccune Linux - Newbie 7 10-25-2007 03:19 PM
harddrive won't mount: bad magic number in superblock sohmc Linux - Software 2 01-18-2006 07:35 AM
bad magic number in superblock crazynachos Linux - Games 1 04-15-2004 01:43 PM
bad magic number in superblock crazynachos Linux - Newbie 1 04-14-2004 02:09 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:26 PM.

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
Open Source Consulting | Domain Registration