From owner-freebsd-hackers@FreeBSD.ORG Wed Oct 6 14:45:06 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EC24416A4CE for ; Wed, 6 Oct 2004 14:45:06 +0000 (GMT) Received: from tower.berklix.org (bsd.bsn.com [194.221.32.7]) by mx1.FreeBSD.org (Postfix) with ESMTP id EC8C343D1D for ; Wed, 6 Oct 2004 14:45:05 +0000 (GMT) (envelope-from jhs@flat.berklix.net) Received: from js.berklix.net (pD9E4DF91.dip.t-dialin.net [217.228.223.145]) (authenticated bits=0) by tower.berklix.org (8.12.9p2/8.12.9) with ESMTP id i96Ej2hB066075; Wed, 6 Oct 2004 16:45:03 +0200 (CEST) (envelope-from jhs@flat.berklix.net) Received: from laps.jhs.private (laps.jhs.private [192.168.91.56]) by js.berklix.net (8.12.11/8.12.11) with ESMTP id i96E1RBo002535; Wed, 6 Oct 2004 16:01:28 +0200 (CEST) (envelope-from jhs@flat.berklix.net) Received: from laps.jhs.private (localhost [127.0.0.1]) by laps.jhs.private (8.13.1/8.13.1) with ESMTP id i96E1Rqg003851; Wed, 6 Oct 2004 16:01:27 +0200 (CEST) (envelope-from jhs@laps.jhs.private) Received: (from jhs@localhost) by laps.jhs.private (8.13.1/8.13.1/Submit) id i96E1QfJ003850; Wed, 6 Oct 2004 16:01:26 +0200 (CEST) (envelope-from jhs) Date: Wed, 6 Oct 2004 16:01:26 +0200 (CEST) Message-Id: <200410061401.i96E1QfJ003850@laps.jhs.private> To: freebsd-hackers@freebsd.org From: "Julian Stacey" Organization: http://berklix.com/~jhs/ Fcc: sent-mail User-agent: EXMH http://beedub.com/exmh/ on FreeBSD http://freebsd.org X-Mailman-Approved-At: Thu, 07 Oct 2004 12:07:22 +0000 cc: jhs@berklix.com Subject: fsck: How to reduce memory usage - to avoid out of swap on boot ? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2004 14:45:07 -0000 On 4.10-RELEASE with real memory = 10485760 (10240K bytes) & big disc partition: disklabel ad0s1 sectors/unit: 160071597 # size offset fstype [fsize bsize bps/cpg] h: 156613309 3458288 4.2BSD 2048 16384 89 # (Cyl. 215*- 9963*) On a dirty reboot, fsck hangs single user saying: out of swap space. This on an embedded headless host, delivered to remote sites. Plugging in a monitor card is problematic, so it needs to come up multi user & net reachable. Options: - Split the partition in several. - Ugly, Maybe I could remerge them with ccd or vinum?] not tried those before, but still an ugly solution. - More memory: Mainboard has 2M & just 1 slot, currently with an 8M RAM, but I'm looking for a 16M slice & will see if mboard accepts it & if fsck considers that enough. ( After forcing it multiuser I saw: # UID PID PPID CPU PRI NI VSZ RSS WCHAN STAT TT TIME COMMAND # 0 455 419 113 42 0 7064 1820 - R+ p1 2:42.52 fsck -y /usr1& for comparison on another 4.10-RELEASE box with an 18G drive it grew to # 0 625 553 0 -6 0 7580 7448 physst DL+ p0 0:12.50 fsck -y /usr3 (Could man fsck document roughly how much ram needed for what size disc ? ) - Add ,noato to /etc/fstab & manually fsck & mount /usr1 from rc.local (I imagine swapinfo by then reports more swap available) - ugly. & I think Ive tried that before somewhere else recently, (on 5-current admittedly) I recall no clean bit caused a hang, even thouth ,noauto - /usr/src/sbin/fsck/fsck.h, maybe I could eg halve one or both of these: #define MAXBUFSPACE 40*1024 /* maximum space to allocate to buffers */ #define INOBUFSIZE 56*1024 /* size of buffer to read inodes in pass1 */ I quickly paged through all of /usr/src/sbin/fsck/ but didnt see much else likely. Any suggestion what to hack ? Must be some define type `take so much RAM' lines in there :-) PS I think it's pass1 that's running out of swap, but maybe pass2, I can't check till backup complete. Ideas ? - Julian Stacey. Unix,C,Net & Sys. Eng. Consultant, Munich. http://berklix.com Mail Ascii; Html deleted as Spam. Ihr Rauch = mein allergischer Kopfschmerz.