1826958 Members
4376 Online
109705 Solutions
New Discussion

CG 3: Bad Magic Number

 
SOLVED
Go to solution
Yu Ting LIU
Advisor

CG 3: Bad Magic Number

Hi,

I got complain below after I fsck the hard disk of HP-UX 10.20.

# fsck /dev/c0t6d0
.
.
.
CG 3: Bad Magic Number

Anybody can tell me what it means?

Thanks in advance!

Regards!
Yu Ting

12 REPLIES 12
Sanjiv Sharma_1
Honored Contributor

Re: CG 3: Bad Magic Number

Ravi_8
Honored Contributor

Re: CG 3: Bad Magic Number

Hi,

fsck is for file checking, here you are trying to check the device hence the error.
#fsck /dev/vgxx/lvolx

file system must be unmounted before fsck'ing
never give up
Shaikh Imran
Honored Contributor

Re: CG 3: Bad Magic Number

Hi,
Try giving
#fsck /dev/rdsk/c0t6d0
OR
#fsck -F vxfs

Regards,

I'll sleep when i am dead.
Yu Ting LIU
Advisor

Re: CG 3: Bad Magic Number

My system is a very old system - HP9000/745 and only have one partition /dev/c0t6d0. It doesn't have VLM and the file system is HFS.

Regards!
Yu Ting

Shaikh Imran
Honored Contributor

Re: CG 3: Bad Magic Number

Hi,
OK !
Just search for the file sbtab most probably it will be in /etc directory.
just exceute
#cat sbtab
You will have different superblock numbers there. e.g. 8,16,32 etc.., and so on
Don't Worry if you are not able to locate the sbtab You can use the following Numbers as a trial which works 80% of time.

# fsck -b 16 /dev/rdsk/c0t6d0
or
# fsck -b 32 /dev/rdsk/c0t6d0

Regards,
I'll sleep when i am dead.
Senthil Kumar .A_1
Honored Contributor

Re: CG 3: Bad Magic Number

hello yu Ting,

If you dont't specify -F option to fsck,It is most likely to take the file system type from /etc/default/fs.check whether HFS or JFS is specified in this file.

My guess is your /etc/default/fs contains jfs and your command fsck /dev/c#t#d# without -F option was assuming jfs instead of HFS.Hence you get bad magic number.

please try fsck -F hfs /dev/...

If the /etc/default/fs indeed contain HFS,probably your superblock may be inconsitent,You can try alternate superblock by cecking the /var/adm/sbtab.

you can try fsck -F hfs -b 16 /dev/...

or
fsck -F hfs -b (any other number you find in /var/adm/sbtab) /dev/....


best of luck

senthil
Let your effort be such, the very words to define it, by a layman - would sound like a "POETRY" ;)
Yu Ting LIU
Advisor

Re: CG 3: Bad Magic Number

Hi,

Thank you all!

My hard disk /dev/dsk/c0t6d0 is a dd backup hard disk. So will it crash if I do

fsck -b 32 /dev/rdsk/c0t6d0

Thanks again!

Regards!
Yu Ting
Yu Ting LIU
Advisor

Re: CG 3: Bad Magic Number

Hi, folks,

fsck with any option can not remove this complain.

I searched on this forum and got what "Bad Magic Number" is. It indicates that we have installed and attempted to run a binary compiled on an uncompatible platfrom / or compiled for different hardware or in this case maybe we have an existing library for an older application that is not compatible with the new one.

My operating system is dd copy from another HP workstation and that might be the reason.

Now anybody knows what "CG 3" means for the fsck command?

Thanks & Regards!
Yu Ting
Shaikh Imran
Honored Contributor
Solution

Re: CG 3: Bad Magic Number

Hi,
CG 3 is nothing but the error code for series 700 machine.
The description of this error code is
Bad Magic Number.

Same way for series 800 machines the error code for Bad Magic Number is CE18
The description of this error code is
Utility file header inconsistent: Bad magic number.


Regards
I'll sleep when i am dead.
Yu Ting LIU
Advisor

Re: CG 3: Bad Magic Number

Thanks! I got it.

Regards!
Yu Ting
Yu Ting LIU
Advisor

Re: CG 3: Bad Magic Number

New question: what might be the reason for fsck to have "Bad Magic Number" complain? Because the Magic Number is more to the libraries and system calls.

Thanks!

Regards!
Yu Ting
Shaikh Imran
Honored Contributor

Re: CG 3: Bad Magic Number

Hi,
The mkfs command constructs an HFS file system by writing on the special file special. The mkfs command builds the file system with a root directory and a lost+found directory.
The FS_CLEAN magic number for the file system is stored in the superblock.
And for your info fsck for HFS checks for the following inconsistencies:
· Blocks claimed by more than one inode or the free list.
· Blocks claimed by an inode or the free list outside the range of the file system.
· Incorrect link counts.
· Size checks:
. Directory size not of proper format.
· Bad inode format.
· Blocks not accounted for anywhere.
· Directory checks:
. File pointing to unallocated inode.
. Inode number out of range.
--- Superblock checks:
. More blocks for inodes than there are in the file system.
· Bad free block list format.
· Total free block and/or free inode count incorrect.
· Invalid continuation inode number in a primary inode

So if the FS_CLEAN FLAG IN the superblock is set to 1 then it reports bad Magic Number.
This has nothing to do with the sys
I'll sleep when i am dead.