fsck of large volume with small memory

Pieter de Goeje pieter at degoeje.nl
Wed Jun 13 23:38:46 UTC 2007


On Thursday 14 June 2007, Andreas Kuehl wrote:
> Hi all
>
> Is there any possibillity to fsck a 1.2 TB 40% filled volume with a
> machine that has not that much memory, in this case only 1.5 GB.
>
> The fsck gives me a friendly
>
> # fsck /dev/da1
> ** /dev/da1
> ** Last Mounted on /fileserver
> ** Phase 1 - Check Blocks and Sizes
> fsck_ufs: cannot alloc 4290901164 bytes for inoinfo
>
> and quits.
>
> While the volume was not that full, fsck had no problems.
>
> Any hint to tune sysctl.conf or loader.conf or the kernel or anything
> else to give fsck the needed memory?
>
> I'm not yet at the point to mount readonly, scrap everything from the
> disk and repartition the volume to smaller pieces.
>
> Regards
>     Andreas Kuehl

You seem to be running 32bit FreeBSD which has a limit of 4GB memory per 
process. fsck_ufs is obviously trying to allocate more (4.2GB) than your 
system would ever be able to provide, so it fails. The only solution in your 
case would be to put the disk (array) in a 64bit system, and running fsck 
from there.

FYI, normally one can increase the memory available to processes with the 
kern.maxdsiz kenv variable, settable in loader.conf. On 32bit FreeBSD it is 
limited to 4G max, but on 64bit FreeBSD it is virtually unlimited. For 
example, I have here an AMD64 machine with 1GB memory, but it has a limit of 
33GB per process. You can see what the current limit is by running 'limits' 
and looking at 'datasize'.

HTH,
Pieter de Goeje

>
> ---
> Still owning my first cdrom containing 1.1.5
>
> -------------schnipp-------------
> # swapinfo
> Device          1K-blocks     Used    Avail Capacity
> /dev/da0s1b       1048576        0  1048576     0%
> /dev/da0s2b       1048576        0  1048576     0%
> /dev/da0s3b       1048576        0  1048576     0%
> /dev/da0s3d       1048576        0  1048576     0%
> /dev/da0s3f       1048576        0  1048576     0%
> Total             5242880        0  5242880     0%
>
> # uname -a
> FreeBSD friend.local 6.2-RELEASE-p5 FreeBSD 6.2-RELEASE-p5 #0: Tue Jun
> 12 23:13:07 CEST 2007
> akuehl at friend.local:/build/obj/build/src/sys/SERVER  i386
>
> System is rebuild with freshly cvsuped /usr/src
> Kernel is GENERIC with added
> options         SMP
> and removed unused controllers.
>
>
> # dmesg | less
> Copyright (c) 1992-2007 The FreeBSD Project.
> Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
>         The Regents of the University of California. All rights reserved.
> FreeBSD is a registered trademark of The FreeBSD Foundation.
> FreeBSD 6.2-RELEASE-p5 #0: Tue Jun 12 23:13:07 CEST 2007
>     akuehl at friend.local:/build/obj/build/src/sys/SERVER
> ACPI APIC Table: <A M I  OEMAPIC >
> Timecounter "i8254" frequency 1193182 Hz quality 0
> CPU: Intel(R) Xeon(TM) CPU 2.40GHz (2400.10-MHz 686-class CPU)
>   Origin = "GenuineIntel"  Id = 0xf27  Stepping = 7
> Features=0xbfebfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MC
>A,CMOV,PAT,PSE36,CLFL USH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE>
>   Features2=0x400<CNTX-ID>
>   Logical CPUs per core: 2
> real memory  = 1610547200 (1535 MB)
> avail memory = 1568907264 (1496 MB)
> (...)
> da1 at ahc0 bus 0 target 12 lun 0
> da1: <IFT IFT-7250 0213> Fixed Direct Access SCSI-4 device
> da1: 80.000MB/s transfers (40.000MHz, offset 31, 16bit), Tagged Queueing
> Enabled
> da1: 1248592MB (2557116416 512 byte sectors: 255H 63S/T 159173C)
> (...)


More information about the freebsd-questions mailing list