linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Theodore Ts'o" <tytso@mit.edu>
To: Jianchao Wang <jianchao.wan9@gmail.com>
Cc: Artem Blagodarenko <artem.blagodarenko@gmail.com>,
	linux-ext4@vger.kernel.org, adilger.kernel@dilger.ca
Subject: Re: [HELP] What are the allocated blocks on a newly created ext4 fs ?
Date: Sun, 9 Jun 2019 23:39:27 -0400	[thread overview]
Message-ID: <20190610033927.GA15963@mit.edu> (raw)
In-Reply-To: <22ccd72a-8926-0d12-0fbe-8ad5604d1584@gmail.com>

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
    ...


Regards,

						- Ted

  reply	other threads:[~2019-06-10  3:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-06 10:41 [HELP] What are the allocated blocks on a newly created ext4 fs ? Jianchao Wang
2019-06-06 12:32 ` Artem Blagodarenko
2019-06-10  3:25   ` Jianchao Wang
2019-06-10  3:39     ` Theodore Ts'o [this message]
2019-06-10  3:54       ` Jianchao Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190610033927.GA15963@mit.edu \
    --to=tytso@mit.edu \
    --cc=adilger.kernel@dilger.ca \
    --cc=artem.blagodarenko@gmail.com \
    --cc=jianchao.wan9@gmail.com \
    --cc=linux-ext4@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).