Einstein Oliveira
2005-May-18 13:54 UTC
fsck_ufs: cannot alloc 647172276 bytes for inoinfo
Hi, I'm using FreeBSD 5.4-RELEASE-p1 and I found some messages about a problem like this in freebsd-current a few months ago. The fact is that this problem has just ocurred (on 5.4-RELEASE-p1), probably because of a power outage (I didn't find anything in logs that would cause a forced reboot). Here is some information: [fsck] # fsck /usr ** /dev/ad0s1f ** Last Mounted on /usr ** Phase 1 - Check Blocks and Sizes fsck_ufs: cannot alloc 647172276 bytes for inoinfo [dumpfs] # dumpfs /usr .... cg 11: magic 806e54b3 tell 7e584000 time Fri Nov 26 01:12:38 1943 cgx -1312777034 ndblk -931553057 niblk -2017999697 initiblk -1985690579 nbfree 2120952272 ndir 831365510 nifree 93179446 nffree -1130132161 rotor -541929111 irotor 1807500773 frotor -1630357508 frsum 237144368 -1927321463 -1872608999 -481058689 811654083 830922798 -91646688 sum of frsum: 1537687372 Segmentation fault (core dumped) I found in the discussion mentioned above http://www.freebsd.org/cgi/getmsg.cgi?fetch=195794+200562+/usr/local/www/db/text/2005/freebsd-current/20050417.freebsd-current this possible solution:> At line 92 in src/sbin/fsck_ffs/pass1.c, you should see the following > block of code: > > for (c = 0; c < sblock.fs_ncg; c++) { > inumber = c * sblock.fs_ipg; > setinodebuf(inumber); > getblk(&cgblk, cgtod(&sblock, c), sblock.fs_cgsize); > if (sblock.fs_magic == FS_UFS2_MAGIC) > inosused = cgrp.cg_initediblk; > else > inosused = sblock.fs_ipg; > > Try changing > inosused = cgrp.cg_initediblk; > to > inosused = (cgrp.cg_initediblk <= sblock.fs_ipg) ? > cgrp.cg_initediblk : sblock.fs_ipg;but it doesn't solve the problem. Any ideas ? -- Einstein Oliveira einstein@yawl.com.br ___________________________________________________ Yawl Internet Ltda. http://www.yawl.com.br/
Einstein Oliveira wrote:> Hi, > > I'm using FreeBSD 5.4-RELEASE-p1 and I found some messages about a > problem like this in freebsd-current a few months ago. > > The fact is that this problem has just ocurred (on 5.4-RELEASE-p1), > probably because of a power outage (I didn't find anything in logs that > would cause a forced reboot). > > Here is some information: > > [fsck] > > # fsck /usr > ** /dev/ad0s1f > ** Last Mounted on /usr > ** Phase 1 - Check Blocks and Sizes > fsck_ufs: cannot alloc 647172276 bytes for inoinfo > > [dumpfs] > > # dumpfs /usr > .... > cg 11: > magic 806e54b3 tell 7e584000 time Fri Nov 26 > 01:12:38 1943 > cgx -1312777034 ndblk -931553057 niblk -2017999697 > initiblk -1985690579 > nbfree 2120952272 ndir 831365510 nifree 93179446 nffree > -1130132161 > rotor -541929111 irotor 1807500773 frotor -1630357508 > frsum 237144368 -1927321463 -1872608999 -481058689 > 811654083 830922798 -91646688 > sum of frsum: 1537687372 > Segmentation fault (core dumped) > > > I found in the discussion mentioned above > > http://www.freebsd.org/cgi/getmsg.cgi?fetch=195794+200562+/usr/local/www/db/text/2005/freebsd-current/20050417.freebsd-current > > > this possible solution: > >> At line 92 in src/sbin/fsck_ffs/pass1.c, you should see the following >> block of code: >> >> for (c = 0; c < sblock.fs_ncg; c++) { >> inumber = c * sblock.fs_ipg; >> setinodebuf(inumber); >> getblk(&cgblk, cgtod(&sblock, c), sblock.fs_cgsize); >> if (sblock.fs_magic == FS_UFS2_MAGIC) >> inosused = cgrp.cg_initediblk; >> else >> inosused = sblock.fs_ipg; >> >> Try changing >> inosused = cgrp.cg_initediblk; >> to >> inosused = (cgrp.cg_initediblk <= sblock.fs_ipg) ? >> cgrp.cg_initediblk : sblock.fs_ipg; > > > but it doesn't solve the problem. > > Any ideas ? >Hi, This unfortunately looks to be a case of filesystem damage that fsck can't cope with. Power failures are especially brutal on ATA disks because of their write cache and they way they optimize writes. You might try something like ffsinfo to locate a alternate superblock that is more sane. Scott
On 18 May, Einstein Oliveira wrote:> Hi, > > I'm using FreeBSD 5.4-RELEASE-p1 and I found some messages about a > problem like this in freebsd-current a few months ago. > > The fact is that this problem has just ocurred (on 5.4-RELEASE-p1), > probably because of a power outage (I didn't find anything in logs that > would cause a forced reboot). > > Here is some information: > > [fsck] > > # fsck /usr > ** /dev/ad0s1f > ** Last Mounted on /usr > ** Phase 1 - Check Blocks and Sizes > fsck_ufs: cannot alloc 647172276 bytes for inoinfo > > [dumpfs] > > # dumpfs /usr > .... > cg 11: > magic 806e54b3 tell 7e584000 time Fri Nov 26 > 01:12:38 1943 > cgx -1312777034 ndblk -931553057 niblk -2017999697 > initiblk -1985690579 > nbfree 2120952272 ndir 831365510 nifree 93179446 > nffree -1130132161 > rotor -541929111 irotor 1807500773 frotor -1630357508 > frsum 237144368 -1927321463 -1872608999 -481058689 > 811654083 830922798 -91646688 > sum of frsum: 1537687372 > Segmentation fault (core dumped) > > > I found in the discussion mentioned above > > http://www.freebsd.org/cgi/getmsg.cgi?fetch=195794+200562+/usr/local/www/db/text/2005/freebsd-current/20050417.freebsd-current > > this possible solution: > >> At line 92 in src/sbin/fsck_ffs/pass1.c, you should see the following >> block of code: >> >> for (c = 0; c < sblock.fs_ncg; c++) { >> inumber = c * sblock.fs_ipg; >> setinodebuf(inumber); >> getblk(&cgblk, cgtod(&sblock, c), sblock.fs_cgsize); >> if (sblock.fs_magic == FS_UFS2_MAGIC) >> inosused = cgrp.cg_initediblk; >> else >> inosused = sblock.fs_ipg; >> >> Try changing >> inosused = cgrp.cg_initediblk; >> to >> inosused = (cgrp.cg_initediblk <= sblock.fs_ipg) ? >> cgrp.cg_initediblk : sblock.fs_ipg; > > but it doesn't solve the problem.It turns out that cg_initediblk is signed, and in your case the sign bit is set, so it is being interpreted as a large negative value. Try this change instead: inosused = (cgrp.cg_initediblk <= sblock.fs_ipg && cgrp.cg_initediblk > 0) ? cgrp.cg_initediblk : sblock.fs_ipg;