Basically, the EXT4 filesystem has chunks of data in size of 128MiB (by default), and this chunk is called a "group" or "group of blocks", which basically looks like this on the disk:
The bigger the disk, the more groups you have one after the other.
When you use the
dumpe2fs tool, it can simply tell you how many groups you have and return also some info about them, for instance:
Group 690: (Blocks 22609920-22642687) csum 0x7443 [ITABLE_ZEROED] Block bitmap at 22544386 (bg #688 + 2), csum 0xab2a9072 Inode bitmap at 22544402 (bg #688 + 18), csum 0x1ef9c14a Inode table at 22545440-22545951 (bg #688 + 1056) 0 free blocks, 8182 free inodes, 10 directories, 8182 unused inodes Free blocks: Free inodes: 5652491-5660672
And my question is: what would happen if you zeroed out the whole group of blocks using the
If you had a file (files) small enough to fit entirely in that group, the file (files) would be permanently lost. But there are other cases, and I'm not sure how system reacts in such situations.
Files can be fragmented and described by many groups of blocks, which (in this case) means that only some part of a file was zeroed out. What would happen to that file after
fsckis run? Will the entire file be placed in lost&found dir? Or maybe would it be visible in the filesystem's structure, but you won't be able to open/access it?
What would happen to the files in the directories if the group above was zeroed out? There's only info that
0 free blocks, 8182 free inodes, 10 directories, 8182 unused inodes, which means that 10 dirs and 0 files are described by this group, and all blocks are used by data. So we have 10 dirs and probably some big file which is fragmented. At least I understand the info in this way. But the dirs can contain files, and what would happen to the files in the dirs when you zero out this group? Will they be accessible after