Skip to content

Make a disk image formatted with both ext2 and FAT at once

License

Notifications You must be signed in to change notification settings

meithecatte/cursedfs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

cursedfs

Make a disk image formatted with both ext2 and FAT, at once.

~/cursedfs% wget 'https://github.com/meithecatte/cursedfs/releases/download/v1.0/cursed.img'
~/cursedfs% sudo mount -o loop -t ext2 cursed.img mountpoint/
~/cursedfs% ls mountpoint/
mkfs.cursed
~/cursedfs% sudo umount mountpoint/
~/cursedfs% sudo mount -o loop -t msdos cursed.img mountpoint/
~/cursedfs% ls mountpoint/
gudnuse.ogg

Why?

I got nerd-sniped

How?

It turns out this is surprisingly simple to do: just create a FAT volume with a lot of reserved sectors and put the ext2 into the reserved sectors. This works because the filesystems choose different places to put their superblock: FAT uses the very first sector, while ext2 leaves the first kilobyte unused.

Can I write to the filesystems?

Yes! When I first decided to do this, I thought writing to the image would surely break everything, but as it turns out, the method I've found means the filesystems don't conflict.

About

Make a disk image formatted with both ext2 and FAT at once

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages