From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id EE83F15ACFB for ; Thu, 20 Apr 2023 10:08:47 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 261FCE0955; Thu, 20 Apr 2023 10:08:43 +0000 (UTC) Received: from smarthost01c.sbp.mail.zen.net.uk (smarthost01c.sbp.mail.zen.net.uk [212.23.1.5]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id D3228E0948 for ; Thu, 20 Apr 2023 10:08:42 +0000 (UTC) Received: from [82.69.80.10] (helo=wstn.localnet) by smarthost01c.sbp.mail.zen.net.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ppRDU-0006v7-V3 for gentoo-user@lists.gentoo.org; Thu, 20 Apr 2023 10:08:41 +0000 From: Peter Humphrey To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] Re: Finally got a SSD drive to put my OS on Date: Thu, 20 Apr 2023 11:08:40 +0100 Message-ID: <5663831.DvuYhMxLoT@wstn> In-Reply-To: <0b6cf97a-d7d4-fad4-d365-8e4a96adb34c@gmail.com> References: <81fde7b8-cc55-fcae-79ea-4dd2a78eb8a0@gmail.com> <0b6cf97a-d7d4-fad4-d365-8e4a96adb34c@gmail.com> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" X-Originating-smarthost01c-IP: [82.69.80.10] Feedback-ID: 82.69.80.10 X-Archives-Salt: bf4a2719-db21-40ac-a707-b6df69e10618 X-Archives-Hash: 4a70ca4a798e8639002926356c6904c5 On Thursday, 20 April 2023 10:29:59 BST Dale wrote: > Frank Steinmetzger wrote: > > Am Wed, Apr 19, 2023 at 06:32:45PM -0500 schrieb Dale: > >> Frank Steinmetzger wrote: > >>> <<>> > >>>=20 > >>> When formatting file systems, I usually lower the number of inodes fr= om > >>> the > >>> default value to gain storage space. The default is one inode per 16 = kB > >>> of > >>> FS size, which gives you 60 million inodes per TB. In practice, even = one > >>> million per TB would be overkill in a use case like Dale=E2=80=99s me= dia > >>> storage.=C2=B9 > >>> Removing 59 million inodes =C3=97 256 bytes =E2=89=88 15 GB of net sp= ace for each TB, > >>> not counting extra control metadata and ext4 redundancies. > >>=20 > >> If I ever rearrange my > >> drives again and can change the file system, I may reduce the inodes at > >> least on the ones I only have large files on. Still tho, given I use > >> LVM and all, maybe that isn't a great idea. As I add drives with LVM,= I > >> assume it increases the inodes as well. > >=20 > > I remember from yesterday that the manpage says that inodes are added > > according to the bytes-per-inode value. > >=20 > >> I wonder. Is there a way to find out the smallest size file in a > >> directory or sub directory, largest files, then maybe a average file > >> size??? > >=20 > > The 20 smallest: > > `find -type f -print0 | xargs -0 stat -c '%s %n' | sort -n | head -n 20` > >=20 > > The 20 largest: either use tail instead of head or reverse sorting with > > -r. > > You can also first pipe the output of stat into a file so you can sort = and > > analyse the list more efficiently, including calculating averages. >=20 > When I first run this while in / itself, it occurred to me that it > doesn't specify what directory. I thought maybe changing to the > directory I want it to look at would work but get this:=20 >=20 >=20 > root@fireball /home/dale/Desktop/Crypt # `find -type f -print0 | xargs > -0 stat -c '%s %n' | sort -n | head -n 20` > -bash: 2: command not found > root@fireball /home/dale/Desktop/Crypt # >=20 >=20 > It works if I'm in the / directory but not when I'm cd'd to the > directory I want to know about. I don't see a spot to change it. Ideas. In place of "find -type..." say "find / -type..." =2D-=20 Regards, Peter.