I'm trying to create a disk image and mount the partition for further work, but I'm encountering a frustrating error message: "wrong fs type, bad option, bad superblock." Here's the steps I took and the output I received:
$ dd if=/dev/zero of=test.img status=progress bs=200M count=1
1+0 records in
1+0 records out
209715200 bytes (210 MB, 200 MiB) copied, 0.191841 s, 1.1 GB/s
$ mkfs.ext4 test.img
mke2fs 1.47.0 (5-Feb-2023)
Discarding device blocks: done
Creating filesystem with 204800 1k blocks and 51200 inodes
Filesystem UUID: b4c4d7d0-0341-4f48-880f-de2110f36825
Superblock backups stored on blocks:
8193, 24577, 40961, 57345, 73729
Allocating group tables: done
Writing inode tables: done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done
$ fdisk test.img
Welcome to fdisk (util-linux 2.39.3).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
The device contains 'ext4' signature and it will be removed by a write command. See fdisk(8) man page and --wipe option for more details.
Device does not contain a recognized partition table.
Created a new DOS (MBR) disklabel with disk identifier 0xca60123f.
Command (m for help): n
Partition type
p primary (0 primary, 0 extended, 4 free)
e extended (container for logical partitions)
Select (default p): p
Partition number (1-4, default 1):
First sector (2048-409599, default 2048):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-409599, default 409599):
Created a new partition 1 of type 'Linux' and of size 199 MiB.
Command (m for help): w
The partition table has been altered.
Syncing disks.
$ fdisk -lu test.img
Disk test.img: 200 MiB, 209715200 bytes, 409600 sectors
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: 0xca60123f
Device Boot Start End Sectors Size Id Type
test.img1 2048 409599 407552 199M 83 Linux
$ sudo mount test.img mount-point/ -o loop,offset=$((512*2048))
mount: /home/reyuki/code/linux-system/mount-point: wrong fs type, bad option, bad superblock on /dev/loop1, missing codepage or helper program, or other error.
dmesg(1) may have more information after failed mount system call.
$ sudo dmesg
[ 8616.381787] loop1: detected capacity change from 0 to 407552
[ 8616.384637] EXT4-fs (loop1): VFS: Can't find ext4 filesystem
[ 8616.384782] EXT4-fs (loop1): VFS: Can't find ext4 filesystem
[ 8616.384874] EXT4-fs (loop1): VFS: Can't find ext4 filesystem
[ 8616.385973] ISOFS: Unable to identify CD-ROM format.
Have I missed a crucial step in the process? Any insights or suggestions would be greatly appreciated!