From owner-freebsd-questions@freebsd.org Mon Aug 24 08:40:24 2020 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 439FD3B5A09 for ; Mon, 24 Aug 2020 08:40:24 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.17.13]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mout.kundenserver.de", Issuer "TeleSec ServerPass Class 2 CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BZlts3q92z4N34 for ; Mon, 24 Aug 2020 08:40:20 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from r56.edvax.de ([94.223.163.154]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.183]) with ESMTPA (Nemesis) id 1MTRhS-1k4Vpe11h6-00ThP2 for ; Mon, 24 Aug 2020 10:40:18 +0200 Date: Mon, 24 Aug 2020 10:40:17 +0200 From: Polytropon To: FreeBSD Questions Subject: Suggestion regarding fsck output enhancement Message-Id: <20200824104017.4c241ec0.freebsd@edvax.de> Reply-To: Polytropon Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:c5O3UR/dU8eeSPyhpmHL16xg2G/8DbbHiPu4GF+3IayCjcg4snG +iQ0RD6VITH13ldXmtET7XLY+GCKykKmUAu9TU0YMaXUoNm/cV8GKie9iH3VEfMpafQc3w6 PjCehxgMPIxQRiRPLyqvvyJVdCtq2i77PxRRAC27sZHeYBJiKEa+/klNJhLsVYto0tKJ0tW J6hERosbJY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mx1.freebsd.org: domain of freebsd@edvax.de has no SPF policy when checking 212.227.17.13) smtp.mailfrom=freebsd@edvax.de X-Spamd-Result: default: False [2.71 / 15.00]; HAS_REPLYTO(0.00)[freebsd@edvax.de]; RCVD_VIA_SMTP_AUTH(0.00)[]; MV_CASE(0.50)[]; HAS_ORG_HEADER(0.00)[]; TO_DN_ALL(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[94.223.163.154:received]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:8560, ipnet:212.227.0.0/16, country:DE]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; REPLYTO_EQ_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_SPAM_SHORT(0.31)[0.310]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; DMARC_NA(0.00)[edvax.de]; AUTH_NA(1.00)[]; RCPT_COUNT_ONE(0.00)[1]; RCVD_TLS_LAST(0.00)[]; MID_CONTAINS_FROM(1.00)[]; RCVD_IN_DNSWL_NONE(0.00)[212.227.17.13:from]; R_SPF_NA(0.00)[no SPF record]; RWL_MAILSPIKE_POSSIBLE(0.00)[212.227.17.13:from]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[freebsd-questions] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Aug 2020 08:40:25 -0000 Today I came across a situation where I would think fsck should output a little more information, which would be helpful especially in diagnostics and dry-run sessions prior to recovery. Example: INCORRECT BLOCK COUNT I=24236 (288 should be 268) CORRECT? yes Or: UNREF FILE I=63518082 OWNER=test1 MODE=100644 SIZE=0 MTIME=Aug 24 09:45 2020 RECONNECT? yes In both entries, the inode number is mentioned. Wouldn't it be nice to display a file or directory name, if possible, to show what file could be affected? Basically, it's what you can already manually do: 1. run fsck in dry mode (only list actions, do not take them) 2. note inode numbers 3. use fsdb to find out what the inodes point to 4. take specific action prior to fsck if needed My suggestion would be: If this kind of information is available, fsck should display it, for example: INCORRECT BLOCK COUNT I=24236 (288 should be 268) FILENAME ada0p4:/tmp/test.dat CORRECT? yes Or: UNREF FILE I=63518082 OWNER=test1 MODE=100644 FILENAME ada0p5:/home/test1/project/data/listing.ps SIZE=0 MTIME=Aug 24 09:45 2020 RECONNECT? yes Let's assume those messages would have been ansered "NO" during a fsck dry run. The advantage: While fsck could zero out or truncate a file during repair, it might be important for the operator to first try to mount the partition r/o, copy the file out, unmount the partition, have fsck repair the filesystem, and then replace the damaged file from the previously obtained copy. This of course assumes that the file in question can still be read, but would be subject to "deleting" upon filesystem consistency restoration, so it will not always be possible. Whom should I direct such a suggestion to? Or am I missing something that already exists? :-) -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...