Magic number ? what is a magic number?

Magic number ? what is a magic number?

Post by Mike Stubblefiel » Fri, 12 Mar 1999 04:00:00



I am a former Linux user who has seen the necessity to upgrade to Freebsd.
This is due to a very agressive webserver which is running in excess of 400
processes at one time. Linux gets a little confused at such things...

I installed the freebsd distribution via ftp according to the instrcutiocns.
So far no problems. I was smart in that I installed it on a new drive,
leaving my already used linux drives alone - we'll come back to that in a
minute.

Well, I went to mount these drives as ext2fs so I could transfer the
material off of them onto new drives... I have one ext2fs drive which all
the drive is one partition. I was able to mount -t ext2fs /dev/wd2s1 /stats
just fine. I then went to my other drive to mount 1 of the three partitions
in order to get the material off of it and reinit it under UFS. There are
four partitions on this drive /wd3 -  - /wd3s1, wd3s2, wd3s3, and wd3s4.
Wd3s2 is a swap partition under the old linux env. so we won't even pay any
attention to that one...

I can mount wd3s1, and wd3s3 no problam - see the syntax above, but when I
go to mount wd3s4 I get this error message:

Wrong Magic Number - C233 (Expected EF53 for EXT2FS)
and no successful mount.

And of course that is the only partition I really need the data off of. BTW,
this partition boots fine under linux and is visable to the fdisk program as
well as the freebsd partition editor - (No I didnt actidentally delete the
partition).

HELP!!!

 
 
 

Magic number ? what is a magic number?

Post by David Malo » Sat, 13 Mar 1999 04:00:00



>I can mount wd3s1, and wd3s3 no problam - see the syntax above, but when I
>go to mount wd3s4 I get this error message:
>Wrong Magic Number - C233 (Expected EF53 for EXT2FS)
>and no successful mount.

The magic number is a number which is supposed to be at the start
of the filesystem, to stop you mounting random data as a filesystem
by accident.

Quote:>And of course that is the only partition I really need the data off of. BTW,
>this partition boots fine under linux and is visable to the fdisk program as
>well as the freebsd partition editor - (No I didnt actidentally delete the
>partition).

It might be worth trying wd3s5-wd3s8, just in case it is an extended
partition - or whatever the DOS people call it.

        David.

 
 
 

1. magic numbers, /etc/magic and the Real World(tm)

Hi,

        As an idle programming exercise I have been perusing the
contents of .o files (partly to see why C++ gobbles so much space, but
that's another matter).  Flushed with success I thought it would be
neat to rummage around libraries as well since they're just a whole
bunch of .o's with some `other' info.

        The problem then arose, how do I tell the difference between
files, ie given that I'm a good boy and parse /etc/magic... but wait!
What am I looking for in /etc/magic?  Rather than hardcode a magic
number, I am obliged to hardcode some arbitrary string to look for in
/etc/magic to identify my magic number but who's to say that that
string is the same in your /etc/magic?  And round we go again.

        Is there a sensible solution?

--
Cheers,

        Ian

-------------------------------------------------------------------------------

   Fulcrum Communications ltd., Fordrough Lane, Birmingham, B9 5LD

2. add partition to IDE without losing existing data

3. At Boot: hd(40) Unix Bad Magic Number

4. NVIDIA GeForce2 and RH Linux 8.0

5. DUMB: bad sblock magic number

6. Intel OR840 Motherboard

7. Bad magic number in disk label

8. Uptime (with load average) for AIX 2.2.1.

9. e2fsck gives "bad magic number..."! Help!

10. Boot failure returns bad Magic Number

11. [TRIVIAL] Get rid of magic numbers in drivers/block/genhd.c

12. kmem-ps-1.3.95+ magic number?

13. MGA Millennium and XF86 3.2 - magic numbers