From owner-freebsd-fs@freebsd.org Sun Dec 25 10:11:54 2016 Return-Path: Delivered-To: freebsd-fs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C296C90229 for ; Sun, 25 Dec 2016 10:11:54 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: from mail-wj0-x244.google.com (mail-wj0-x244.google.com [IPv6:2a00:1450:400c:c01::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D75BD1279 for ; Sun, 25 Dec 2016 10:11:53 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: by mail-wj0-x244.google.com with SMTP id j10so45728022wjb.3 for ; Sun, 25 Dec 2016 02:11:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:in-reply-to:references:reply-to :mime-version:content-transfer-encoding; bh=9eoC4Jcfvv22zJV+YREk5iHOsdkTTnkH1GbgZAHN1Cc=; b=n4S0gGmndSjvmT8mivX/A5bMgtr0ycg0y2SFji0uxr3jwdldx0s5xgxUFM/bgUTTYW /pYlW8Xiauc6+VgWkCBBruBM9VYZ+fHh4tl2gzE2MQPn94DUGHE7FlkghJArJl3O0VL9 7zlbITePZP+TrO2iKg0CuuY2/YUoy+hXvkSIjCPzPqPU5UzQbY6FEfb76zdE/Qgv2+SC OEJiPVrJirBIU9G2tavWuorHkaYG3+QcuZ5uieSft7swCI2P+wnklR4eMOHM3jyjQ7mE vRi860wcDm60vytemA6jNkTZuptoUCpJfThCjG/g5feCuB3mRY6ivSLawsnDD0mR3OI/ Pkjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:in-reply-to :references:reply-to:mime-version:content-transfer-encoding; bh=9eoC4Jcfvv22zJV+YREk5iHOsdkTTnkH1GbgZAHN1Cc=; b=FM0TeyNSurtpm1tWDJtAJARY+IqzsDyTNTSgi2ED22ZE+yGwULMmQXIshXZ/7UJtL7 VszU953ny8MGn4IwJSbDeIy23e0mleNO9/krHZZW1DbepRD9MdXChu3KoL1BIXZoP3PB uMojoGtESh5GYrDl4mO957xPPKdpVrlTAMCRsjqLlDf7cuLg5jaeKX7inuo66jlsSa9E smGoeZKRwVcQacOOIgI/MnoOKbkDTGNRCwW534wvJtO72+xnUm/wYOJKfL+darHcC/AP jNcR876D+vejKtm8sWaQZAIwvRLz9qkS4fmnHXxfZhpRPD3UGPeLwYSEyLKroy0weiLP kXTw== X-Gm-Message-State: AIkVDXIjPY4djZcfdWDQj/GJLWvJA3/6OSE+P4jNQwmrCiQ7+zYAfGjG3ImI28ikAzw/tw== X-Received: by 10.194.5.165 with SMTP id t5mr21658587wjt.107.1482660711120; Sun, 25 Dec 2016 02:11:51 -0800 (PST) Received: from ernst.home (p578E2DF8.dip0.t-ipconnect.de. [87.142.45.248]) by smtp.gmail.com with ESMTPSA id jz1sm23960646wjc.38.2016.12.25.02.11.49 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 25 Dec 2016 02:11:50 -0800 (PST) Date: Sun, 25 Dec 2016 11:11:48 +0100 From: Gary Jennejohn To: freebsd-fs@freebsd.org Subject: Re: when ufs is 99% full, current seems to limit creat to 28672 bytes Message-ID: <20161225111148.6ee769b8@ernst.home> In-Reply-To: <201612250331.uBP3Un70004592@fire.js.berklix.net> References: <201612250331.uBP3Un70004592@fire.js.berklix.net> Reply-To: gljennjohn@gmail.com X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.29; amd64-portbld-freebsd12.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Dec 2016 10:11:54 -0000 On Sun, 25 Dec 2016 04:30:49 +0100 "Julian H. Stacey" wrote: > A puzzle below, that I think I've solved, but comments welcome: > When ufs is 99% full, current limits creat to 28672 bytes. > > On current, > mount > /dev/ada0s4f on /data (ufs, NFS exported, local, soft-updates) > > /bin/df /data > Filesystem 1K-blocks Used Avail Capacity Mounted on > /dev/ada0s4f 868629268 863272592 5356676 99% /data > > csh > foreach i ( `cd /host/fire/0s4/ftp/pub/FreeBSD/mail/ports ; /bin/ls -1 [0-9]*`) > # Above just a trick to generate 3000 numeric names. > # ( testblock -v -b 512 tb.$i ) # My little C program > # http://berklix.com/~jhs/src/bsd/jhs/bin/public/testblock/ > # OR a simpler standard dd ... > ( dd if=/dev/zero of=dd.$i ) > end > > Produces loads of little files of size 28672 bytes = 0x7000 > > A foreground fsck of FS shows no errors. No ZFS in use. Where > does all the extra space come from ? Why does it keep allowing > more little files ? But not files bigger than 7K ? > > The last 5 Gig seems unusable space not in the meta space of normal > free blocks for big files. Presumably instead in the payload of > initial data space pre allocated along with each unused inode ? So > 1K for inode & 7K data ? > > ffsinfo | more > bsize int32_t 0x00008000 > fsize int32_t 0x00001000 > > > df -i /dev/ada0s4f > Filesystem 1K-blocks Used Avail Capacity iused ifree %iused > /dev/ada0s4f 868629268 863272592 5356676 99% 9595016 102683126 9% > > dc 102683126 28672 * p # 2 944 130 588 672 > 3G not 5.3G as above from df, but seems not too dissimilar. > > If this 0x7K phenomena is not documented in manuals somewhere ? it > perhaps should be ? > > How I noticed: > I wanted to soak up every last block on FS, (cos Ive been having > block device errors, so I wanted to force a read write on all > unused blocks to hopefully get IDE drive to re-allocate anything flakey.) > ada0: 953869MB (1953525168 512 byte sectors) > > Tips very welcome on [usb scsi] Commands/Manuals/ ports/ to either: > rescan partition > (I could achive a crude reallocation of discovered bad blocks, > using drivers inside disk or FreeBSD, by writing new test data > on my partition with dd or my testblock -b 60k /dev/ada0s4f > reformat disk. > Maybe man fsck See Also should ref camcontrol ? > I suspect this ia a result of how UFS is designed. Did you use the standard options for block and fragment size? How about inodes? Is the file system UFS1 or UFS2? UFS is a very compex bit of software and I imagine there are all kinds of interesting surprises when the file system is 99% full. Anyway, the newfs man page may provide some clues. Or look at Wikipedia, there's a UFS entry there, but it doesn't go into the gorey details. -- Gary Jennejohn