Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2776393ybi; Sun, 9 Jun 2019 20:55:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqxFcLBrY22F0GyrrR7bVQ/i6BSyS63WDl8PPKiF/mleVJRT6Umcy9oxSdjDVDEc6mJDd5jf X-Received: by 2002:a63:1d53:: with SMTP id d19mr14049621pgm.152.1560138908954; Sun, 09 Jun 2019 20:55:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560138908; cv=none; d=google.com; s=arc-20160816; b=PMb7P2200SDrKcWXacuTvJzX9zOYc4Qaf8Q99QEZNq/SoM4XmOsKosStIEiWvsX+YS FtQeEqgQzhbPuollpFL0mrf0WWHmnN08xeAY5192u5jZJ3tzntKBUf6lGRqyJSC/Fjdz AULpIs+ur3yO9XZJTxe3g/e1/9caVc4toGC6Kw49BWmJvfoZl9HrnHJsIkmhTEifovdY swnf/QX3VxijVOMmqlfosDny9tYBvmCtEzg+LKFvF85XVXvq/V6KN3C9pvlxcofpx9cq /cJiJn7ZgXvHxpMUDY/KmIziGEyL36L/AdK1sRr56MOr/LfhWILpiLB7cbb6Q9Ca8Lrd VOFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=eycaHKwjNhVgla3zln2jkG+dBMvDp9ZL+9upAhqi6V8=; b=bBP7Zf+YUinH25IH7AMz0FUQQRN51xhIm2fuaSxIOXW95DxOamTdYmuKEjYXpp5ZpQ A9yG5+5BXK2l2NgMxtZo+tr1vzmqzdIisUqTVb62ENeFLKnnVSTaOIVhqyshSFjHZH12 fBEv8wQR6YduJrFl4NkXcl0xWe/YDBhx9B2bKNk6Gpev+wKmSgdYtYX1CQjUPA8221RD gGvhe8iNyrrnJCcLnW+XH3o4tYS++lkH723s8LLkJSSF1/SHurgH9ADZAQpXUoqG//ph cM/VSCK9RsYhHInE4kkhRIlHKx6d5LJBQUNriRPmxH3D0qQTJCjvlEczgZzSHxWv7iAo PNVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=n+in00v1; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ay3si8261718plb.298.2019.06.09.20.54.49; Sun, 09 Jun 2019 20:55:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=n+in00v1; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387545AbfFJDyi (ORCPT + 99 others); Sun, 9 Jun 2019 23:54:38 -0400 Received: from mail-pf1-f169.google.com ([209.85.210.169]:33319 "EHLO mail-pf1-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387499AbfFJDyi (ORCPT ); Sun, 9 Jun 2019 23:54:38 -0400 Received: by mail-pf1-f169.google.com with SMTP id x15so4475076pfq.0 for ; Sun, 09 Jun 2019 20:54:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=eycaHKwjNhVgla3zln2jkG+dBMvDp9ZL+9upAhqi6V8=; b=n+in00v1j7Mjzq01z58S2zGghAi7PRdS96NC8ZBg4kYfQ8fbvlFBC5XQOXAQXxiI7T lfI/n03HaNeiIDr2r6bpaK+hMJoqRSNYtbD+Qi0PoJlMpuJ3GtZw1lC0UBaR1A+6easT 0giKiogNlVyi11UHTQCAG0q+PB8H4lZF3ckEtyWP98XG3i6bMpl6a3IofXfpz1tZiJCm CsA2+EEKqOBw+NZTRyKgJW4ZFYs15mBYO4Kl/wKxp63JwfwFd4K/LRDITCLZiZ5C9tnl +IqZt/txCAjYO41ur044YJC+dC6KxmFpf8BodNoXxOmCNJzORiM6ecUm3RrVEXKexnaM fcpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=eycaHKwjNhVgla3zln2jkG+dBMvDp9ZL+9upAhqi6V8=; b=LRnIzPYmLKb8F4TrU2WrRSH8dNLtQK1ZpxEhdFQG18VEsR2SsEhQcINo7EtGTw7zSD GAsFCEQFYacaoF+UsrZ/bn9Lfoy5YJNc9JpDkiy5xkp4XW3PEeOKtrtJneeS8Z9tstQd +5wkRh7lc8OXzyh68BiFglWj9EX3OfWYKw6DdXHUh78Glo+ZSam6j76STFqtIMy6hs1i xPYb6yqxUG89Z8w3xz60hVFaL/AyRR3rk+bq9ZqzVhndod5/ah4oxXTdNXf0ilTOnE1g H6iWKyVNnd3Uehnc38UGMwDfEWAoYYub/HA0jWLAqBfU5O7tptobV8r8AEKD8L7tRobC mUFg== X-Gm-Message-State: APjAAAU/mqHn+rYRL669Fhopwi+lk36r38QlqKmLe3NJzdgvFsjWJ1Nw E/9Tz6A28Bl2hSLtfmX0FPQ= X-Received: by 2002:a62:5387:: with SMTP id h129mr74213486pfb.6.1560138878028; Sun, 09 Jun 2019 20:54:38 -0700 (PDT) Received: from [0.0.0.0] ([47.244.216.228]) by smtp.gmail.com with ESMTPSA id l38sm8446873pje.12.2019.06.09.20.54.36 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Sun, 09 Jun 2019 20:54:37 -0700 (PDT) Subject: Re: [HELP] What are the allocated blocks on a newly created ext4 fs ? To: Theodore Ts'o Cc: Artem Blagodarenko , linux-ext4@vger.kernel.org, adilger.kernel@dilger.ca References: <7FD3148B-1E27-4BFA-965C-9FDC7FC8FD96@gmail.com> <22ccd72a-8926-0d12-0fbe-8ad5604d1584@gmail.com> <20190610033927.GA15963@mit.edu> From: Jianchao Wang Message-ID: <683bc83a-a56d-1ecf-aa3d-5aa0aa3ac289@gmail.com> Date: Mon, 10 Jun 2019 11:54:35 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:67.0) Gecko/20100101 Thunderbird/67.0 MIME-Version: 1.0 In-Reply-To: <20190610033927.GA15963@mit.edu> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On 2019/6/10 11:39, Theodore Ts'o wrote: > On Mon, Jun 10, 2019 at 11:25:47AM +0800, Jianchao Wang wrote: >> Hi Artem >> >> Thanks so much for your help. >> >> On 2019/6/6 20:32, Artem Blagodarenko wrote: >>> Hello Jianchao, >>> >>> Not enought input data to give an answer. It depends on mkfs options. For example, if flex_bg option is enabled, then several block groups are tied together as one logical block group; the bitmap spaces and the inode table space in the first block group, so some groups are not totally free just after FS creating. >> >> In my environment, there are 16 bgs per flex_bg. >> The bitmaps and inode table .etc should lay on the first bg of every flex_bg. >> So I can see there are about 8223 blocks allocated in the 1st bg of every flex_bg. >> >> But as you can see in the output of mb_groups, there are some bgs >> which get allocated about 1024 blocks. >> >> I have out figured out what are they for. > > The best way to understand what the blocks are used for is to use the > dumpe2fs program, e.g: > > % mke2fs -t ext4 -Fq /tmp/foo.img 1T > % dumpe2fs /tmp/foo.img | more > ... > Group 0: (Blocks 0-32767) csum 0xe6f6 [ITABLE_ZEROED] > Primary superblock at 0, Group descriptors at 1-128 > Reserved GDT blocks at 129-1152 > Block bitmap at 1153 (+1153), csum 0xb033995a > Inode bitmap at 1169 (+1169), csum 0x108d3d73 > Inode table at 1185-1696 (+1185) > 23385 free blocks, 8181 free inodes, 2 directories, 8181 unused inodes > Free blocks: 9383-32767 > Free inodes: 12-8192 > Group 1: (Blocks 32768-65535) csum 0xe50b [INODE_UNINIT, BLOCK_UNINIT, ITABLE_ZEROED] > Backup superblock at 32768, Group descriptors at 32769-32896 > Reserved GDT blocks at 32897-33920 > Block bitmap at 1154 (bg #0 + 1154), csum 0x00000000 > Inode bitmap at 1170 (bg #0 + 1170), csum 0x00000000 > Inode table at 1697-2208 (bg #0 + 1697) > 31615 free blocks, 8192 free inodes, 0 directories, 8192 unused inodes > Free blocks: 33921-65535 > Free inodes: 8193-16384 > ... > Hi Ted Many thanks for your help These allocated blocks should be the reserved GDT blocks. Many thanks again. Jianchao