From nobody Thu Nov 07 01:01:36 2024 X-Original-To: questions@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XkP0x0Dntz5c5M1 for ; Thu, 07 Nov 2024 01:01:53 +0000 (UTC) (envelope-from dewayne@heuristicsystems.com.au) Received: from heuristicsystems.com.au (hermes.heuristicsystems.com.au [203.41.22.115]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2560 bits) client-digest SHA256) (Client CN "hermes.heuristicsystems.com.au", Issuer "Heuristic Systems Type 4 Host CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XkP0t0kqYz4Xdh for ; Thu, 7 Nov 2024 01:01:49 +0000 (UTC) (envelope-from dewayne@heuristicsystems.com.au) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=heuristicsystems.com.au header.s=hsa header.b="TyhU/qpL"; spf=pass (mx1.freebsd.org: domain of dewayne@heuristicsystems.com.au designates 203.41.22.115 as permitted sender) smtp.mailfrom=dewayne@heuristicsystems.com.au; dmarc=none Received: from [10.0.5.4] (bigears.hs [10.0.5.4]) (authenticated bits=0) by heuristicsystems.com.au (8.15.2/8.15.2) with ESMTPA id 4A711afw005612 for ; Thu, 7 Nov 2024 12:01:37 +1100 (AEDT) (envelope-from dewayne@heuristicsystems.com.au) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=heuristicsystems.com.au; s=hsa; t=1730941297; x=1731546098; bh=KWOQFuI6pcr+e40S6tS3AFo73ess3YLZNxvlRZu28Nk=; h=Message-ID:Date:From:Subject:To; b=TyhU/qpLhGCKlDDWzF9hEjSfFfnlZ6hhIsU82LukmnxNkGWg0IuwrmCZ7jf6QKX4c jYKtNi41JfoBusgJiuIXobMO0F7snZ0/HsTyFF2hpqLiSHriK4p+SvkG5K+26s9ZrX F9Qo2dG7VzkG5OdmUJizIGLOmztIYH2o9B7P0vJlKqTldUuzYl7vl X-Authentication-Warning: b3.hs: Host bigears.hs [10.0.5.4] claimed to be [10.0.5.4] Message-ID: <8a3381ec-d67c-4e51-85d9-e323ec3465fe@heuristicsystems.com.au> Date: Thu, 7 Nov 2024 12:01:36 +1100 List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: freebsd-questions@freebsd.org Sender: owner-freebsd-questions@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-GB From: Dewayne Geraghty Subject: du measures in 4K blocks resulting in inaccuracies To: questions@freebsd.org Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spamd-Result: default: False [-5.92 / 15.00]; DWL_DNSWL_MED(-2.00)[heuristicsystems.com.au:dkim]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.83)[-0.828]; RCVD_DKIM_ARC_DNSWL_MED(-0.50)[]; R_SPF_ALLOW(-0.20)[+mx]; R_DKIM_ALLOW(-0.20)[heuristicsystems.com.au:s=hsa]; RCVD_IN_DNSWL_MED(-0.20)[203.41.22.115:from]; MIME_GOOD(-0.10)[text/plain]; ONCE_RECEIVED(0.10)[]; XM_UA_NO_VERSION(0.01)[]; MIME_TRACE(0.00)[0:+]; RCPT_COUNT_ONE(0.00)[1]; DMARC_NA(0.00)[heuristicsystems.com.au]; ARC_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_COUNT_ONE(0.00)[1]; ASN(0.00)[asn:1221, ipnet:203.40.0.0/13, country:AU]; TO_DN_NONE(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; DKIM_TRACE(0.00)[heuristicsystems.com.au:+]; PREVIOUSLY_DELIVERED(0.00)[questions@freebsd.org]; MID_RHS_MATCH_FROM(0.00)[]; MLMMJ_DEST(0.00)[questions@freebsd.org]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_XAW(0.00)[] X-Rspamd-Queue-Id: 4XkP0t0kqYz4Xdh X-Spamd-Bar: ----- I'm trying to size a disk. Unfortunately /usr/bin/du is misleading. An example referencing two files, one 60 Bytes, other 908 Bytes: unset BLOCKSIZE echo ; ls -l /projectx/adm/README /projectx/adm/gen_pw.sh echo "1 ---" ; ls -lh /projectx/adm/README echo "2 ---" ; du /projectx/adm/README echo "3 ---" ; du -ckh /projectx/adm/README /projectx/adm/gen_pw.sh -rw-r----- 1 sysman wheel 60 Jul 28 2023 /projectx/adm/README #60B -rwx------ 1 sysman wheel 968 Jul 28 2023 /projectx/adm/gen_pw.sh 1 --- -rw-r----- 1 sysman wheel 60B Jul 28 2023 /projectx/adm/README 2 --- 8 /projectx/adm/README <<< 8 sectors 3 --- 4.0K /projectx/adm/README <<< min count is 4K, so sectorsize? 4.0K /projectx/adm/gen_pw.sh 8.0K total <<< Expect at most 2K # diskinfo -v /dev/ada2p3 /dev/ada2p3 512 # sectorsize Perhaps my understanding is wrong, so to authority "man du" -k Display block counts in 1024-byte (1 kiB) blocks. (incorrect) -h "Human-readable" output. Use unit suffixes: Byte, Kilobyte, Megabyte, Gigabyte, Terabyte and Petabyte based on powers of 1024. (? 4K) but even --si gives 4.1k /projectx/adm/README # <<< 4.1K??! 4.1k /projectx/adm/gen_pw.sh What am I missing? Should the doc reflect the minimum reporting size is 4K?