Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
4
votes
1
answers
1962
views
Relation between "Block Size"and "Upper Limits" in ext2
[A similar looking question][1] asks for the reason why the upper file limit could be 2 TB in `ext2`. I am trying to understand but [the Documentation on `ext2`][2] but find this hard. Please correct me if I'm wrong: - Blocks can be 1 - 4 KB in size - available amount of blocks is based upon a 32-Bi...
A similar looking question asks for the reason why the upper file limit could be 2 TB in
ext2
. I am trying to understand but the Documentation on ext2
but find this hard. Please correct me if I'm wrong:
- Blocks can be 1 - 4 KB in size
- available amount of blocks is based upon a 32-Bit value: 232 = 4.294.967.296 blocks
In the documentation I found: 231-1 = 2.147.483.647 addressable Blocks. I miss 2.147.483.649 Blocks.
My **guess** is that this is »reserved« for the *Superblock*, the *Block Group Descriptors* , their backups etc. (correct?)
Question
----------
**How exactly are the file size limits calculated in ext2
**
And, just in advance: Is – and if so – how far can this be translated to ext3
and ext4
(or other file systems... please?) – I'm still far from them and not lazy to look this up myself; just confused about where the basics come from .
erch
(5200 rep)
Dec 14, 2013, 12:34 AM
• Last activity: Jan 4, 2025, 05:02 PM
1
votes
1
answers
1851
views
how to resume GRUB2 upgrade apparently blocked by /boot filesystem type=ext2?
details ------- As detailed [here](https://unix.stackexchange.com/a/259712/38638), the `/boot` on this Debian Jessie had filesystem type=ext2 $ mount | grep -e '^/dev/' /dev/sda3 on /boot type ext2 ... ... and was unable to upgrade its GRUB2 $ sudo apt-get dist-upgrade ... Setting up grub-common (2....
details
-------
As detailed [here](https://unix.stackexchange.com/a/259712/38638) , the
/boot
on this Debian Jessie had filesystem type=ext2
$ mount | grep -e '^/dev/'
/dev/sda3 on /boot type ext2 ...
...
and was unable to upgrade its GRUB2
$ sudo apt-get dist-upgrade
...
Setting up grub-common (2.02~beta2-22+deb8u1) ...
Setting up grub2-common (2.02~beta2-22+deb8u1) ...
Setting up grub-pc-bin (2.02~beta2-22+deb8u1) ...
Setting up grub-pc (2.02~beta2-22+deb8u1) ...
Installing for i386-pc platform.
Installation finished. No error reported.
Installing for i386-pc platform.
grub-install: warning: File system `ext2' doesn't support embedding.
grub-install: warning: Embedding is not possible. GRUB can only be installed in this setup by using blocklists. However, blocklists are UNRELIABLE and their use is discouraged..
At about this point, my console went to a [curses TUI](https://en.wikipedia.org/wiki/Curses_%28programming_library%29) to present a dialog with title=Configuring grub-pc
and body telling me that GRUB failed to install
:
Do you want to continue anyway? If you do, your computer may not start up properly.
Writing GRUB to boot device failed - continue?
I hit button=No
. At that point,
* the GRUB2 packages={grub-common
, grub-pc
, grub-pc-bin
, grub2-common
} were installed (per apt-get
and aptitude
) but not fully configured (per message above).
* I had the following
questions
---------
**1.** Should I now should update my {/dev/sda3
, /boot
} from filesystem type=ext2 to something else (presumably ext4)?
If I am misunderstanding the situation: what do I need to know? Is there something I should do to debug?
If I am *not* misunderstanding: what's the {easiest, most reliable, least disruptive} way to convert /boot
's filesystem, on Debian (which this box is running)? [fstransform](https://packages.debian.org/search?keywords=fstransform) ?
**2.** Should I should now reconfigure GRUB2? E.g., how do I (or another Debian user in same situation) recreate the Setting up
actions (see second text block) induced by the package install?
answers
-------
**1.** It seemed clear to me that I should update my {/dev/sda3
, /boot
} from filesystem type=ext2 to ext4, which I did with [fstransform](https://github.com/cosmos72/fstransform) (installing its [Jessie package](https://packages.debian.org/search?keywords=fstransform) as detailed [here](https://bitbucket.org/snippets/tlroche/eyXRq) . This seemed to go well (except for [one problem](https://github.com/cosmos72/fstransform/issues/5)) .
However this filesystem upgrade may not have been necessary, per Jordan Uggla [here](http://lists.gnu.org/archive/html/help-grub/2016-02/msg00019.html) .
**2.** Per [Uggla's post](http://lists.gnu.org/archive/html/help-grub/2016-02/msg00019.html) , I reconfigured GRUB2 with sudo dpkg-reconfigure grub-pc --frontend=text
as detailed [here](https://bitbucket.org/snippets/tlroche/E8rAx) .
I now see and boot to the updated kernel and have no boot-time error messages.
TomRoche
(1345 rep)
Feb 3, 2016, 11:16 PM
• Last activity: Dec 29, 2024, 05:01 AM
-2
votes
1
answers
462
views
How to extract files from EXT2 filesystem
debian11. I copied EXT2 filesystem from some dump file. I'm not sure if this file is intact or has no errors. $ file ext2file ext2file: Linux rev -1358692254.9334 ext2 filesystem data (mounted or unclean), UUID=a200288c-6200-14af-a200-2c8c620018af, volume name "\242" (64bit) (large files) I tried `e...
debian11. I copied EXT2 filesystem from some dump file. I'm not sure if this file is intact or has no errors.
$ file ext2file
ext2file: Linux rev -1358692254.9334 ext2 filesystem data (mounted or unclean), UUID=a200288c-6200-14af-a200-2c8c620018af, volume name "\242" (64bit) (large files)
I tried
extfstools
, but it can't (possibly I used it incorrectly)
$ ./ext2rd ext2file ./:savedir
Segmentation fault
Is it possible to extract files from it?
minto
(575 rep)
Jul 4, 2024, 05:38 PM
• Last activity: Jul 5, 2024, 11:57 PM
0
votes
0
answers
168
views
copy Linux EXT filesystem use dd
I used binwalk to scan firmware image, uncompressed & raw RAM dump. When scan for signatures with -I flag there is reference to Linux EXT filesystem: DECIMAL HEXADECIMAL DESCRIPTION -------------------------------------------------------------------------------- ... ... 2148245 0x20C795 Linux EXT fi...
I used binwalk to scan firmware image, uncompressed & raw RAM dump. When scan for signatures with -I flag there is reference to Linux EXT filesystem:
DECIMAL HEXADECIMAL DESCRIPTION
--------------------------------------------------------------------------------
... ...
2148245 0x20C795 Linux EXT filesystem, blocks count: 1048741, image size: 1073910784, invalid state invalid error behavior invalid major revision rev 611745794.9334, ext2 filesystem data (mounted or unclean), UUID=a200288c-6200-14af-a200-2c8c62006200, volume name "¢"
I want extract that filesystem use
dd
command:
dd if=image.out of=ext2-filesystem bs=1 skip=2148245 count=1048741
On output I got file 1,0 MiB (1 048 741 bytes).
I'm not sure that this is correct result, the file is too small. What should be the correct command for this?
EDIT:
GNU Coreutils,
$ dd --version
dd (coreutils) 8.32
minto
(575 rep)
Jul 4, 2024, 12:14 AM
• Last activity: Jul 4, 2024, 11:07 AM
1
votes
1
answers
177
views
ext2 How to choose bytes/inode ratio
How approximately calc [bytes-per-inode][1] for ext2? I have 7.3GB storage (15320519 sectors 512B each). I have made ext2 filesystem with block size 4096 mke2fs /dev/sda2 -i 524288 -m 0 -L "SSD" -F -b 4096 -U 11111111-2222-3333-4444-555555555555 -O none,filetype,sparse_super,large_file Filesystem la...
How approximately calc bytes-per-inode for ext2?
I have 7.3GB storage (15320519 sectors 512B each). I have made ext2 filesystem with block size 4096
mke2fs /dev/sda2 -i 524288 -m 0 -L "SSD" -F -b 4096 -U 11111111-2222-3333-4444-555555555555 -O none,filetype,sparse_super,large_file
Filesystem label=SSD
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
15104 inodes, 1915064 blocks
0 blocks (0%) reserved for the super user
First data block=0
Maximum filesystem blocks=4194304
59 block groups
32768 blocks per group, 32768 fragments per group
256 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632
Usually all my files has size 100kB (and about 5 files can be 400MB). I try to read this and this . But still not clear how approximately calc bytes-per-inode? Current 524288 is not enough, for now I can't make new files in sda2 but still have a lot of free space.
P.S. Extra info
# df -T
Filesystem Type 1K-blocks Used Available Use% Mounted on
/dev/root ext4 146929 84492 59365 59% /
devtmpfs devtmpfs 249936 0 249936 0% /dev
tmpfs tmpfs 250248 0 250248 0% /dev/shm
tmpfs tmpfs 250248 56 250192 0% /tmp
tmpfs tmpfs 250248 116 250132 0% /run
/dev/sda2 ext2 7655936 653068 7002868 9% /mnt/sda2
# df -h
Filesystem Size Used Available Use% Mounted on
/dev/root 143.5M 82.5M 58.0M 59% /
devtmpfs 244.1M 0 244.1M 0% /dev
tmpfs 244.4M 0 244.4M 0% /dev/shm
tmpfs 244.4M 56.0K 244.3M 0% /tmp
tmpfs 244.4M 116.0K 244.3M 0% /run
/dev/sda2 7.3G 637.8M 6.7G 9% /mnt/sda2
# fdisk -l
Disk /dev/sda: 7.45 GiB, 8001552384 bytes, 15628032 sectors
Disk model: 8GB ATA Flash Di
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x0a19a8af
Device Boot Start End Sectors Size Id Type
/dev/sda1 309 307508 307200 150M 83 Linux
/dev/sda2 307512 15628030 15320519 7.3G 83 Linux
Андрей Тернити
(303 rep)
May 22, 2024, 04:31 AM
• Last activity: May 22, 2024, 01:24 PM
3
votes
1
answers
268
views
mkfs ext2 ignore number-of-inodes
I want to make ext2 file system. I want to set "[number-of-inodes][1]" option to some number. I tried several values: - if *-N 99000* then Inode count: 99552 - if *-N 3500* then Inode count: 3904 - if *-N 500* then Inode count: 976 But always my value is **not the same**. Why? I call mkfs this way s...
I want to make ext2 file system. I want to set "number-of-inodes " option to some number. I tried several values:
- if *-N 99000* then Inode count: 99552
- if *-N 3500* then Inode count:
3904
- if *-N 500* then Inode count: 976
But always my value is **not the same**. Why?
I call mkfs this way
sudo mkfs -q -t ext2 -F /dev/sda2 -b 4096 -N 99000 -O none,sparse_super,large_file,filetype
I check results this way
$ sudo tune2fs -l /dev/sda2
tune2fs 1.46.5 (30-Dec-2021)
Filesystem volume name:
Last mounted on:
Filesystem UUID: 11111111-2222-3333-4444-555555555555
Filesystem magic number: 0xEF53
Filesystem revision #: 1 (dynamic)
Filesystem features: filetype sparse_super large_file
Filesystem flags: signed_directory_hash
Default mount options: user_xattr acl
Filesystem state: clean
Errors behavior: Continue
Filesystem OS type: Linux
Inode count: 99552
Block count: 1973720
Reserved block count: 98686
Overhead clusters: 6362
Free blocks: 1967353
Free inodes: 99541
First block: 0
Block size: 4096
Fragment size: 4096
Blocks per group: 32768
Fragments per group: 32768
Inodes per group: 1632
Inode blocks per group: 102
Filesystem created: Thu Apr 6 20:00:45 2023
Last mount time: n/a
Last write time: Thu Apr 6 20:01:49 2023
Mount count: 0
Maximum mount count: -1
Last checked: Thu Apr 6 20:00:45 2023
Check interval: 0 ()
Reserved blocks uid: 0 (user root)
Reserved blocks gid: 0 (group root)
First inode: 11
Inode size: 256
Required extra isize: 32
Desired extra isize: 32
Default directory hash: half_md4
Directory Hash Seed: 61ff1bad-c6c8-409f-b334-f277fb29df54
Андрей Тернити
(303 rep)
Apr 6, 2023, 11:24 AM
• Last activity: May 22, 2024, 04:21 AM
1
votes
0
answers
113
views
How can I write a file to a specific inode on an ext2 image?
I have an ext2 image file, and I need to write a file to a specific inode within the image using command line utilities in Linux. I tried using debugfs but I couldn't find a way to write to a specific inode. Can someone provide guidance on how to write a file to a specific inode on an ext2 image usi...
I have an ext2 image file, and I need to write a file to a specific inode within the image using command line utilities in Linux. I tried using debugfs but I couldn't find a way to write to a specific inode. Can someone provide guidance on how to write a file to a specific inode on an ext2 image using command line tools? Any insights, commands, or sample scripts would be greatly appreciated.
HoosierTransfer
(11 rep)
Feb 23, 2024, 04:27 AM
0
votes
1
answers
108
views
How are block devices physically addressed in a file system
In this [book](https://tldp.org/LDP/tlk/tlk.html), the following is mentioned about filesystem addressing: > A file system does not need to concern itself with where on the physical media a block should be put, that is the job of the device's driver I have some questions related to this: 1. Do the p...
In this [book](https://tldp.org/LDP/tlk/tlk.html) , the following is mentioned about filesystem addressing:
> A file system does not need to concern itself with where on the physical media a block should be put, that is the job of the device's driver
I have some questions related to this:
1. Do the pointers that are part of the inodes comprise of logical block indices or actual physical addresses?
1. If it is the former, then where is the mapping of block index to actual physical location stored?
1. Is there an example of how the physical addressing might look like, e.g. for an SSD device?
user1234234
(3 rep)
Feb 10, 2024, 08:41 PM
• Last activity: Feb 11, 2024, 10:08 AM
0
votes
1
answers
106
views
Get Test EXT2 IMG file
I have a task for university to deal with EXT2 file recovery. The problem is that the example drives (as IMG files) we got only contain one block group. I want to test if I read the drive correctly so I need more than one block group. I tried to create an IMG file from my Kubuntu USB drive but did n...
I have a task for university to deal with EXT2 file recovery. The problem is that the example drives (as IMG files) we got only contain one block group. I want to test if I read the drive correctly so I need more than one block group.
I tried to create an IMG file from my Kubuntu USB drive but did not manage to do it. I searched online but found not a single IMG file to download. Google only wanted to sell some ext2 drivers to me.
Where can I get an ext2 IMG file from?
Marcel Lorenz
(123 rep)
Dec 17, 2023, 12:04 AM
• Last activity: Dec 17, 2023, 01:04 AM
2
votes
3
answers
2514
views
Besides the journal, what are the differences between ext2 and ext3?
I just saw [an answer question about filesystems for embedded hardware](https://raspberrypi.stackexchange.com/a/1169) on another Stack Exchange site. The question was "What file system format should I use on flash memory?" and the answer suggested the ext2 filesystem, or the ext3 filesystem with jou...
I just saw [an answer question about filesystems for embedded hardware](https://raspberrypi.stackexchange.com/a/1169) on another Stack Exchange site. The question was "What file system format should I use on flash memory?" and the answer suggested the ext2 filesystem, or the ext3 filesystem with journaling disabled a'la
tune2fs -O ^has_journal /dev/sdbX
This made me wonder... What would the advantage be to using ext3 (with journaling disabled) over ext2? As far as I understood, the only real difference between the two was the journal. What other differences between ext2 and ext3 are there?
Josh
(8728 rep)
Jul 20, 2012, 12:37 PM
• Last activity: Nov 16, 2023, 10:02 AM
143
votes
12
answers
226336
views
How do I know if a partition is ext2, ext3, or ext4?
I just formatted stuff. One disk I format as ext2. The other I want to format as ext4. I want to test how they perform. Now, how do I know the kind of file system in a partition?
I just formatted stuff. One disk I format as ext2. The other I want to format as ext4. I want to test how they perform.
Now, how do I know the kind of file system in a partition?
user4951
(10749 rep)
Jan 9, 2013, 10:24 AM
• Last activity: Nov 8, 2023, 02:19 AM
0
votes
0
answers
139
views
Install grub on ext2
Is it possible to install (and use) grub on the same ext2 partition as the linux root directory? (Should you want to discuss 'why': to try, to understand and master.)
Is it possible to install (and use) grub on the same ext2 partition as the linux root directory?
(Should you want to discuss 'why': to try, to understand and master.)
Boole Gates
(1 rep)
Sep 7, 2023, 09:54 AM
1
votes
1
answers
447
views
Unix ext2 superblock - file system creation date
I am trying to find the creation date on an _ext2_ file system. I seem to get a current date using `dumpe2fs`. The problem is that the original _ext2_ superblock specification does not contain such information, though it seems like there might be an extension to the original fields (something about...
I am trying to find the creation date on an _ext2_ file system. I seem to get a current date using
The problem is that the original _ext2_ superblock specification does not contain such information, though it seems like there might be an extension to the original fields (something about after byte 264).
In fact using
Thanks in advance
dumpe2fs
.The problem is that the original _ext2_ superblock specification does not contain such information, though it seems like there might be an extension to the original fields (something about after byte 264).
In fact using
hexdump
on the superblock (hexdump -s 1024 -n 1024 -C /dev/vdb
) I can find 4 bytes starting from byte _265_ that containg a hex number which contain in little endian the unix time of the file system creation. Any information on how, why and under what circumstances that it there?Thanks in advance
Panagiotis Stefanis
(13 rep)
Jan 12, 2023, 06:01 PM
• Last activity: Jan 12, 2023, 11:03 PM
3
votes
0
answers
339
views
Why do ext2 inodes only have 12 direct blocks?
I'm currently writing a hobby file-system for fun. I was wondering if anyone knows why or where I could get information on the design philosophy of ext2. Specifically, I was wondering why each inode has only 12 direct blocks? Why not 13, or 100?
I'm currently writing a hobby file-system for fun. I was wondering if anyone knows why or where I could get information on the design philosophy of ext2.
Specifically, I was wondering why each inode has only 12 direct blocks? Why not 13, or 100?
Joe Thomas
(81 rep)
Apr 17, 2019, 10:43 PM
• Last activity: Apr 9, 2022, 07:15 AM
0
votes
1
answers
1074
views
Unable to edit the content of a mounted ext2 image
I have an image (from an Android phone) for which `file` gave the following info: file vendor-rw.img vendor-rw.img: Linux rev 1.0 ext2 filesystem data, UUID=64d47c8e-6f74-54ea-bbe7-ce29a05c4b04, volume name "vendor" (extents) (large files) (huge files) I can successfully mount image with the followi...
I have an image (from an Android phone) for which
file
gave the following info:
file vendor-rw.img
vendor-rw.img: Linux rev 1.0 ext2 filesystem data, UUID=64d47c8e-6f74-54ea-bbe7-ce29a05c4b04, volume name "vendor" (extents) (large files) (huge files)
I can successfully mount image with the following command in Ubuntu 20 x64
:
sudo mount -o loop,rw -t ext4 vendor-rw.img tmp/
Obviously the image is not sparse but I cannot edit the content of the mounted drive;
What is the problem?
**Solved**!:
The owner of the mounted point was root
and I was running operations on the drive (mkdir for example) as non-root user.
wiki
(101 rep)
Jul 17, 2021, 06:58 PM
• Last activity: Jul 19, 2021, 10:57 AM
2
votes
2
answers
707
views
what is this “first inode” reported by dumpe2fs?
using dumpe2fs on some ext4 partition, I get in the initial data, that the first inode is #11. However, if I `ls -i` on this disk root partition, I get that it's inode number is #2 (as expected). So... What is this “first partition” reported by dumpe2fs ?
using dumpe2fs on some ext4 partition, I get in the initial data, that the first inode is #11. However, if I
ls -i
on this disk root partition, I get that it's inode number is #2 (as expected). So... What is this “first partition” reported by dumpe2fs ?
Camion
(314 rep)
Jun 30, 2021, 11:52 PM
• Last activity: Jul 1, 2021, 12:55 AM
1
votes
0
answers
466
views
Calculate correctly the ext2 used blocks by the file system
What I'm trying achieve is, a safe shrinking of an ext2 file system and make sure I can cut/shrink the physical partition underneath to a safe minimum (without cutting file system blocks). I have checked many HowTo-s, but still want to ask if I'm missing something, when determining the actual ext2 u...
What I'm trying achieve is, a safe shrinking of an ext2 file system and make sure I can cut/shrink the physical partition underneath to a safe minimum (without cutting file system blocks). I have checked many HowTo-s, but still want to ask if I'm missing something, when determining the actual ext2 usage as reported by dumpe2fs. Here is my test case:
root@buster:/tmp# dd if=/dev/zero of=/tmp/del.img bs=1M count=1000
1000+0 records in
1000+0 records out
1048576000 bytes (1.0 GB, 1000 MiB) copied, 0.429782 s, 2.4 GB/s
root@buster:/tmp# losetup -f --show /tmp/del.img
/dev/loop0
root@buster:/tmp# mkfs.ext2 /dev/loop0
mke2fs 1.44.5 (15-Dec-2018)
Discarding device blocks: done
Creating filesystem with 256000 4k blocks and 64000 inodes
Filesystem UUID: 217a401a-a001-46e8-8ca2-9602e927e2aa
Superblock backups stored on blocks:
32768, 98304, 163840, 229376
Allocating group tables: done
Writing inode tables: done
Writing superblocks and filesystem accounting information: done
root@buster:/tmp# mount /dev/loop0 /mnt/EXT2/
root@buster:/tmp# dumpe2fs /dev/loop0 | grep -E '(Block count|Block size)'
dumpe2fs 1.44.5 (15-Dec-2018)
Block count: 256000
Block size: 4096
As I see it, the filesystem uses 1048576000 bytes (256000*4096)
root@buster:/tmp# cp -pr /opt/Scripts/ /mnt/EXT2/
root@buster:/tmp# umount /mnt/EXT2
root@buster:/tmp# e2fsck -f /dev/loop0
e2fsck 1.44.5 (15-Dec-2018)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/loop0: 457/64000 files (6.6% non-contiguous), 67098/256000 blocks
root@buster:/tmp# resize2fs -M /dev/loop0
resize2fs 1.44.5 (15-Dec-2018)
Resizing the filesystem on /dev/loop0 to 63894 (4k) blocks.
The filesystem on /dev/loop0 is now 63894 (4k) blocks long.
root@buster:/tmp# dumpe2fs /dev/loop0 | grep -E '(Block count|Block size)'
dumpe2fs 1.44.5 (15-Dec-2018)
Block count: 63894
Block size: 4096
After shrinking, the filesystem seems to be using 261709824 bytes (63894*4096)
May I assume than in 100% of the cases, I can safely cut/shrink the underlying physical partition to these 261709824 bytes as well? Could it be that some filesystem blocks are still physically located after these 261709824 bytes?
tio78
(91 rep)
Jun 12, 2021, 10:31 AM
5
votes
2
answers
4730
views
How to extract raw ext3 inode data from disk?
On an ext3 (or ext2/4, pick your flavor) filesystem, how would one extract raw byte data that corresponds to a particular inode directly from the hard drive? Is it possible given, say, an inode number to determine its location on disk (perhaps as an offset from the start of the partition, or some ot...
On an ext3 (or ext2/4, pick your flavor) filesystem, how would one extract raw byte data that corresponds to a particular inode directly from the hard drive?
Is it possible given, say, an inode number to determine its location on disk (perhaps as an offset from the start of the partition, or some other LBA offset) and then use some utility such as
dd
or a system call (something like lseek except operating on the filesystem?) to read that data without having to reference it as a file?
I'm assuming this can be done, perhaps with some sort of driver-level utility.
Michael Martinez
(1002 rep)
Nov 10, 2014, 11:38 PM
• Last activity: Jun 1, 2021, 01:31 PM
4
votes
1
answers
3648
views
Ext2 block structure: size of reserved GDT Blocks
In every publication I found about ext2, the structure of a block group is defined as following: - Super Block: 1 block - Group Descriptor: N blocks - Data Bitmap: 1 block - Inode Bitmap: 1 block - Inode Table: N blocks - Data Blocks: remaining blocks However in the [ext2 kernel doc][1] it is stated...
In every publication I found about ext2, the structure of a block group is defined as following:
- Super Block: 1 block
- Group Descriptor: N blocks
- Data Bitmap: 1 block
- Inode Bitmap: 1 block
- Inode Table: N blocks
- Data Blocks: remaining blocks
However in the ext2 kernel doc it is stated that versions >0 may not store copies of the super block and group descriptors in every block group.
When I
fsstat
my ext2 partition, I get following output:
Group: 1:
Inode Range: 1977 - 3952
Block Range: 8193 - 16384
Layout:
Super Block: 8193 - 8193
Group Descriptor Table: 8194 - 8194
Data bitmap: 8451 - 8451
Inode bitmap: 8452 - 8452
Inode Table: 8453 - 8699
Data Blocks: 8700 - 16384
Free Inodes: 1976 (100%)
Free Blocks: 0 (0%)
Total Directories: 0
Group: 2:
Inode Range: 3953 - 5928
Block Range: 16385 - 24576
Layout:
Data bitmap: 16385 - 16385
Inode bitmap: 16386 - 16386
Inode Table: 16387 - 16633
Data Blocks: 16387 - 16386, 16634 - 24576
Free Inodes: 1976 (100%)
Free Blocks: 0 (0%)
There are two things about this output that confuse me:
1. In groups where the SB and group desc. are stored, there is a gap of 256 blocks between the group desc. and data bitmap.
**EDIT: Using dumpe2fs
I just found out that these are reserved GDT blocks, used for online resizing .**
So the new question is, how is the size of these reserved GDT blocks determined?
2. What does Data Blocks: 16387 - 16386
in Group 2 mean?
goose999
(61 rep)
Apr 2, 2014, 02:32 PM
• Last activity: Feb 8, 2021, 11:19 AM
0
votes
1
answers
17
views
A question about ext2_sb_info
I study the ext2_sb_info structure (the memory data structure for ext2 superblock) and i noticed the existence of a field declared as u32 s_next_generation; I searched the web but it was not possible to find its role. Does anyone knows what is the purpose of this field? Thanks a lot!
I study the ext2_sb_info structure (the memory data structure for ext2 superblock) and i noticed the existence of a field declared as
u32 s_next_generation;
I searched the web but it was not possible to find its role. Does anyone knows what is the purpose of this field? Thanks a lot!
Athanasios Margaris
(129 rep)
Jan 16, 2021, 07:48 PM
• Last activity: Jan 16, 2021, 10:28 PM
Showing page 1 of 20 total questions