Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp2329993pxb; Fri, 25 Mar 2022 15:39:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyM5mWhkiyJE6BF6DcKC5O5hBtU1jnd5YqtIvD5dBr5osdho6cj6mhcUnjI4+3REMNv/rOB X-Received: by 2002:a17:90b:4a0d:b0:1c6:f480:b7f2 with SMTP id kk13-20020a17090b4a0d00b001c6f480b7f2mr27449235pjb.79.1648247968744; Fri, 25 Mar 2022 15:39:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648247968; cv=none; d=google.com; s=arc-20160816; b=IG6G4CZbR+N2N++c8VsAR7/jCIwDWUTRmIE0OUrrF+jLjjH3bsJwtH7Nihui5VIues IOJ7E5RpVBkD7KzyyAMXyfGV49yMfYRWg69/AErFbegB189CgBbJgTKNoybQxwYYxp9U gajoUCtiWSvLQGtgXoc5eTVo9DpLVVewmMX8Vk0rjvm4tJj8uqeWVKyvj98f+bwKTydQ wU/NXRNfDbjTP8LseKZu1OPN31VKhbsgE4AyQpjFHQfb9i4C9fiP94bNDgJ4cMcjkk7f 3ZaNJB1BFmrQOiQDrB5i/j7Os/TTabNdVyT81veJtXWGn26eBY7R0X6qOIwgMod52R2N lkhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=J/msAMbLQ5EJDTA/Xo4ZJfbpaa5TFDH9KgbB/cEVHxY=; b=Cy8t8j3txZkmIix35qJF28/KAnB9EuCiN6EATIF7zDvaZ7O15U97ZR49kw3En+P1Qi P/0+5VISJDiU/8wXJTm+iI/JpGEQoJmxs1KKf5+CFvW2CQF0zK7zp2jyBlJWns9EZM5J 4dAZMSGXEnfGaG9HXKrllsWcoB1jDoWVNdZzGtyGCpTsubY3Yi0m3Uu/fLe9Z/hUWai5 uysHCyTyoF/9BDRfNztUO25vu5IKuEBBVhSsw6km8Ccw1tzdwafZPYy1mLdViqJpcT/Y iefDchFXZpVHLrJmAupv7Xzh0oSjEf7cpiky/SyOofIefMep7CTOSVQ0hCjQynkp/WDK mgRA== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-ext4-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mit.edu Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id u18-20020a170903125200b001549d3bcb48si3717722plh.582.2022.03.25.15.39.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Mar 2022 15:39:28 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-ext4-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-ext4-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mit.edu Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A11485FE6; Fri, 25 Mar 2022 15:11:53 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233717AbiCYWN0 (ORCPT + 99 others); Fri, 25 Mar 2022 18:13:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233710AbiCYWNZ (ORCPT ); Fri, 25 Mar 2022 18:13:25 -0400 Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 246CA5FE6; Fri, 25 Mar 2022 15:11:49 -0700 (PDT) Received: from cwcc.thunk.org (pool-108-7-220-252.bstnma.fios.verizon.net [108.7.220.252]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 22PMBkTc022969 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 25 Mar 2022 18:11:46 -0400 Received: by cwcc.thunk.org (Postfix, from userid 15806) id 0A05415C0038; Fri, 25 Mar 2022 18:11:46 -0400 (EDT) Date: Fri, 25 Mar 2022 18:11:46 -0400 From: "Theodore Ts'o" To: Fariya F Cc: linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: df returns incorrect size of partition due to huge overhead block count in ext4 partition Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Fri, Mar 25, 2022 at 12:12:30PM +0530, Fariya F wrote: > The output dumpe2fs returns the following > > Block count: 102400 > Reserved block count: 5120 > Overhead blocks: 50343939 Yeah, that value is obviously wrong; I'm not sure how it got corrupted, but that's the cause of the your problem. > a) Where does overhead blocks get set? The kernel can calculate the overhead value, but it can be slow for very large file systems. For that reason, it is cached in the superblock. So if the s_overhead_clusters is zero, the kernel will calculate the overhead value, and then update the superblock. In newer versions of e2fsprogs, mkfs.ext4 / mke2fs will write the overhead value into the superblock. > b) Why is this value huge for my partition and how to correct it > considering fsck is also not correcting this The simpleest way is to run the following command with the file system unmounted: debugfs -w -R "set_super_value overhead_clusters 0" /dev/sdXX Then the next time you mount the file system, the correct value should get caluclated and filled in. It's a bug that fsck isn't notcing the problem and correcting it. I'll work on getting that fixed in a future version of e2fsprogs. My apologies for the inconvenience. Cheers, - Ted