Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2768669ybi; Sun, 9 Jun 2019 20:41:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqwr/kzJHz4u/Q8gXCarrnI5Y/pAEfjzoc11Aq0QdPPDzboehvt6Lepk24dL3N224/iaUweW X-Received: by 2002:a17:902:24c:: with SMTP id 70mr68062922plc.2.1560138092698; Sun, 09 Jun 2019 20:41:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560138092; cv=none; d=google.com; s=arc-20160816; b=o+vk2zaLgIFBeEYCf6PBaUwIsv16DFR0cUQKgx5YrY+Y3D4renhY0sPGOCIObko5vE SyPrd0gj1T7q6WzGZITnSQjvDjbYKJQrvtA8cQB2NJnQIkRc7fhDB/BN3VF06zKK5UkD MiTZHeAoivGNYy325l89SjXkTfEglXw7Jpa8Sta1UPcu/o+eVOWZ8ijYYrzwTeiP76zR EaRmk+x3qCP1H/gS1jqdakIAyRgvDonjceSS4N8W1M8t0mkCPs3cSp1FlQLRbH4moPFG 01eAcuM0RpD0trBqD1nb/fqly1m7aqorKi+SKOkvwj5UPVVVPmnNivSQONtJgK/j0kxX dKgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=8QJeYXpacDG9S/odnQrkEDnfFunNtWdsfKixSQxHTto=; b=0MUvdK1UdfXxSYHiACFgXtf3QXYpZkN1fUdwPLutZp0NoHX5/49AC4eoR7Deco6nlW At1olsIYPQYEy6bXQhJRf96mkJMHxuQKMV6VnzOgUMbNzS4Q1hXyvtLjMjW/8cQB722k WIHPsyQw5mjxODett4Jm4n3mPyKXjtgHpblZsIYi3Ln7Er6zMGLnROMLl9KXjClbBO6u cS5zGXqzvwmS3bPcNdwuwby31riL4aKpSe+8zz3Z5MJy3eYEiQpe7rNdijtXNC/1o7EM nr4JwhjYheUyZshY/aTpefDmTq9CGFXXUikP/CfHaZ4Ib104KnfFEyUaCbNu/+aodjdG hEcQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y11si4201520plr.381.2019.06.09.20.41.12; Sun, 09 Jun 2019 20:41:32 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387475AbfFJDjc (ORCPT + 99 others); Sun, 9 Jun 2019 23:39:32 -0400 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:35227 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2387462AbfFJDjc (ORCPT ); Sun, 9 Jun 2019 23:39:32 -0400 Received: from callcc.thunk.org ([66.31.38.53]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id x5A3dRID031481 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 9 Jun 2019 23:39:28 -0400 Received: by callcc.thunk.org (Postfix, from userid 15806) id 5F1BB420481; Sun, 9 Jun 2019 23:39:27 -0400 (EDT) Date: Sun, 9 Jun 2019 23:39:27 -0400 From: "Theodore Ts'o" To: Jianchao Wang Cc: Artem Blagodarenko , linux-ext4@vger.kernel.org, adilger.kernel@dilger.ca Subject: Re: [HELP] What are the allocated blocks on a newly created ext4 fs ? Message-ID: <20190610033927.GA15963@mit.edu> References: <7FD3148B-1E27-4BFA-965C-9FDC7FC8FD96@gmail.com> <22ccd72a-8926-0d12-0fbe-8ad5604d1584@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <22ccd72a-8926-0d12-0fbe-8ad5604d1584@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org 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