cursedfs
cursedfs copied to clipboard
Can it be more cursed?
Is it possible to integrate other filesystems? ZFS? ext3? Reiser?
looks like it! here is 8M fat and 28M ext3
#!/bin/bash
SIZE_EXT2=64000 # sectors, max is 65535
PATH=$PATH:/usr/sbin:/sbin
set -euo pipefail
EXT2_TMP="$(mktemp)"
trap "rm $EXT2_TMP" EXIT
test "$1"
truncate -s 40M "$1"
truncate -s "$((512*$SIZE_EXT2))" $EXT2_TMP
mkfs.ext3 $EXT2_TMP
mkfs.fat -R $SIZE_EXT2 "$1"
dd if=$EXT2_TMP of="$1" bs=512 skip=1 seek=1 conv=notrunc
All things considered, the parameter that matters the most is probably the superblock position. This is how it looks so far:
- +0K: FAT12, FAT16, FAT32, HPFS, NTFS, XFS, BFS
- +1K: ext2, ext3, ext4, HFS, HFS+, minix, EROFS
- +4K: bcachefs
- +32K: ISO9660, UDF, JFS
- +64K: ReiserFS, btrfs
It should be possible to construct a volume with one filesystem from each group.
ZFS is interesting - it has some important looking structures starting at 16K, up to 256K, but maybe it's possible to fudge in a "comment" in "Name/Value Pairs" (16-128K) so that the 32K and 64K filesystems can fit...
Also interesting is FreeDOS's LEAN filesystem: "The superblock must be stored in one of any sector in range from 1 to 32, inclusive."
(That's FreeDOS-32, not FreeDOS per se; it's a separate project. Neither LEAN nor FD32 seems to have gotten any traction anyway; I don't think LEAN was even implemented in FD32 itself, where the idea originated. The only implementation I'm aware of is the spec author's demo program.)