ext2 superblock offset
Posted: Mon Dec 19, 2016 5:29 am
Hey everyone!
This might be a stupid question, but: Every source of documentation for ext2 that I've found has specified that the ext2 superblock is always at offset 1024 (or 0x400, or LBA 2 with 512 byte sectors), though when I create a qemu image and create an empty ext2 file system on it the superblock is located at offset 2560 (or 0xA00, or LBA 5). fsck still correctly identifies the file system, so it's obvious that I'm misunderstanding something here.
Here is my process for creating the ext2 volume:
Any help on this would be greatly appreciated!
This might be a stupid question, but: Every source of documentation for ext2 that I've found has specified that the ext2 superblock is always at offset 1024 (or 0x400, or LBA 2 with 512 byte sectors), though when I create a qemu image and create an empty ext2 file system on it the superblock is located at offset 2560 (or 0xA00, or LBA 5). fsck still correctly identifies the file system, so it's obvious that I'm misunderstanding something here.
Here is my process for creating the ext2 volume:
Code: Select all
# qemu-img create -f raw harddrive.img 512M
# kpartx -a harddrive.img
# mkfs.ext2 /dev/mapper/loop0p1
Discarding device blocks: done
Creating filesystem with 524284 1k blocks and 131072 inodes
Filesystem UUID: 73f5f38b-d312-4af2-afda-ac34f356a6da
Superblock backups stored on blocks:
8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409
Allocating group tables: done
Writing inode tables: done
Writing superblocks and filesystem accounting information: done