1847823 Members
4003 Online
104021 Solutions
New Discussion

Re: Bad Magic number

 
kiran bachu
Occasional Contributor

Bad Magic number

With online JFS, increased the size of the filesystem from 120GB to 141GB. Then tried to take the backup of the filesystem with new size 141GB.

Our software complains - Bad magic number.

My code looks like this -
/*
* Get super block
*/
if (lseek(fd, VX_SUPERBOFF, SEEK_SET) != VX_SUPERBOFF) {
Error("Can't seek to super block: %s\n", strerror(errno));
return 1;
}
if (read(fd, (char *) psb, sizeof(*psb)) != sizeof(*psb)) {
Error("Can't read super block: %s\n", strerror(errno));
return 1;
}
/*
* Validate super block
*/

/*
* Check magic number
*/
if (psb->fs_c.fsc_magic != VX_MAGIC) {
Error("Bad super block (bad magic number)\n");
return 1;
}

Please let me know if anbody has any idea on this.

thanks
kiran
"A will finds a way"
2 REPLIES 2
James Murtagh
Honored Contributor

Re: Bad Magic number


Hi Kiran,

First thing to check is the version of hpux and vxfs filesystem :

# uname -r
B.11.11

# fstyp -v /dev/vg00/rlvol9|grep -i version
version: 4

(lvol 9 as an example)

You need to be on at least hpux 11.00 and have vxfs version 3 or above for JFS 3.1 or 3.3 to have a filesystem over 128GB.

Next I would create a new program to print the magic numbers of the filesystem and cross check it with fsdb.

To get the fsdb output :

# echo "8b;p S" | fsdb -F vxfs /dev/vg00/rlvol9
super-block at 00000008.0000
magic a501fcf5 version 4
ctime 1030658989 334384 (Thu Aug 29 23:09:49 2002 BST)
log_version 9 logstart 0 logend 0
bsize 1024 size 36864 dsize 36864 ninode 0 nau 0
defiextsize 0 oilbsize 0 immedlen 96 ndaddr 10
aufirst 0 emap 0 imap 0 iextop 0 istart 0
bstart 0 femap 0 fimap 0 fiextop 0 fistart 0 fbstart 0
nindir 2048 aulen 32768 auimlen 0 auemlen 8
auilen 0 aupad 0 aublocks 32768 maxtier 15
inopb 4 inopau 0 ndiripau 0 iaddrlen 8 bshift 10
inoshift 2 bmask fffffc00 boffmask 3ff checksum e277df6e
free 33463 ifree 0
efree 1 3 2 1 0 3 1 2 1 2 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
flags 0 mod 0 clean 3c
time 1033171147 70001 (Sat Sep 28 00:59:07 2002 BST)
oltext[0] 33 oltext[1] 1282 oltsize 1
iauimlen 1 iausize 4 dinosize 256
checksum2 62b
checksum3 0

So you can see the magic number is a501fcf5.

You should then be able to see what variable is wrong in the code.

Regards,

James.


Jeff Schussele
Honored Contributor

Re: Bad Magic number

Hi Kiran,

James has it.
You must be >=11.0 AND >=JFS 3+ to go beyond 128Gb.

If you meet these requirements then you can go to 1Tb & up to 2Tb at best.

Check your versions as the 1st thing.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!