CursedFS – Disk image that is simultaneously ext2 and FAT
github.com
github.com
* https://docs.microsoft.com/en-gb/windows-server/administrati...
Equally interesting are the tools that convert from the "MBR" style partition table to EFI partitioning. Again, this requires that the MBR-style partition table have free spaces into which the EFI partition table can be put. They have to be in fixed positions, though, unlike the NTFS MFT.
https://btrfs.wiki.kernel.org/index.php/Manpage/btrfs-conver...
The comments explain the strategy in some detail. ReiserFS conversion is supported in addition to ext[234]. Because Btrfs requires only a little fixed space, just its superblocks, in theory any file system could be converted.
https://github.com/kdave/btrfs-progs/blob/master/convert/mai...
Whereas the only fixed-position data structure in NTFS is the BPB in the Volume Boot Record, which it can even mostly share with FAT. In the FAT to NTFS conversion there is a point where (BPB aside) the two sets of filesystem structures are simultaneously valid.
Is this usually pronounced as individual letters (bee tee arr eff ess), or like "butter FS"?
EDIT: Wikipedia [0] says it's pronounced many ways, such as "butter fuss", "better F S", "butter F S", "b-tree F S", or simply by spelling it out.
Occasionally, that happened on the same floppy disk, via a horrific sector format interleaving trick invented by Rob Northen (who did a lot of copy protection stuff at the time). Notably, the Future Publishing magazines ST Format and Amiga Format started out as the combined ST/Amiga Format and the "coverdisk" was exactly that - readable by both, with different files on each machine.
That means, Macs with older versions of the OS would deal gracefully with a format they were never intended to run.
I remember thinking it was the coolest thing ever.
https://medium.com/swlh/polyglot-files-a-hackers-best-friend...
(Forgive my ignorance if the answer is obvious -- I've only ever used Linux as servers, never as a desktop.)
And are there any other OS's that can read ext2? Neither Windows nor macOS seem to be able to, out of the box.
~/cursedfs% sudo mount cursed.img mountpoint/
mount: /home/kuba/cursedfs/mountpoint: more filesystems detected on /dev/loop0; use -t <type> or wipefs(8).
It's too smart :/> 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.
So, is it really two independent file systems? At least when it is read only?
It seems writing to one file system is likely to destroy the other, since they would be unaware of each other's allocated blocks.
Yes, they just don't interact with each other.
> It seems writing to one file system is likely to destroy the other, since they would be unaware of each other's allocated blocks.
The entirety of ext2 stays within FAT32's reserved blocks (that is, between the bootsector and the File Allocation Table), so FAT32 won't write over ext2. The inverse is also true, as ext2 knows its formatted size, so it won't write outside of the reserved sectors.
The best usecase I can see: /boot, used for both windows and Linux with a special entry to start a live linux for recovery.
Having this partition on a thumbdrive and being able to cat it to /dev/sda1 would be ideal
That's why I've always felt conflicted over ZIP. On the one hand, having a contiguous index is nice from a performance optimization standpoint, and that's why ZIP is more commonly adopted to build upon, such as JAR files. On the other hand, the potential for (and actuality of) conflicting metadata is a nightmare from a security perspective, and it violates several rules of thumb in software engineering, such as that there should only ever be a single source of truth (major), a single parse (major), and to avoid duplicating data or context (minor, but can be sufficient to ensure there's only ever a single source of truth and a single parse), which generally ease implementation and help ensure consistent behavior. Likewise, while combining the container format and compression can improve convenience and user experience (especially if there's a single dominate implementation), it's also nice to keep these layers separate, which not only provides simplicity and consistency benefits, but also permits them to evolve independently.
I'm hoping to try marking the datastructures of each filesystem as a bad block or something similar in the others, so that as long as the shared data isn't removed or modified, writing is OK.
--- cursed.img
Regular file, size 4 MiB (4194304 bytes)
FAT12 file system (hints score 4 of 5)
Volume size 3.916 MiB (4106240 bytes, 2005 clusters of 2 KiB)
Ext2 file system
UUID 2D74B033-E8A6-4738-98B2-02BCC3F0D98E (DCE, v4)
Last mounted at "/home/kuba/cursedfs/mountpoint"
Volume size 64 KiB (65536 bytes, 64 blocks of 1 KiB)
1. http://disktype.sf.netI did try to do that with my android phone, but apparently it requires some specific kernel modules. I've to figure out which, and how to cross compile them for the phone kernel.
Snowden fooled everyone with an sd card inside a Rubick's cube.
https://www.vulture.com/2016/09/edward-snowden-snowden-rubik...
> “First of all, I just wanted to say that none of us know [how it happened],” Stone said at the Q&A, when asked about how they came up with it. “[Snowden]’s the only one who knows, and one day he may reveal it. And number two, it was his idea — it was a suggestion that we responded to and ran with.”
I'd imagine they would have done forensics if he was caught with an sd card at a checkpoint, but I'm not sure one would set off a metal detector in the first place. It's more likely a security org would epoxy the sd and usb slots on computers with confidential data, or have audits for any usb devices the hosts encounter.
"He [Snowden] said that the Rubik’s cube was put in for the film and he wouldn’t be divulging how he smuggled out information. However, he added, everyone in the office did have a Rubik’s cube. “So they were floating around and coming in and out all the time,” he said."
https://heavy.com/entertainment/2016/09/snowden-rubiks-cube-...
To me he's at least suggesting a similar glaring shortfall in CIA processes that let him smuggle it out.
http://reboot.pro/topic/2887-boot-bartpe-as-img-from-hdd-wit...
Basically a same file (same extents) was accessible both from the "outer" and from the "inner" filesystems.
Then the idea was abandoned as another valid (and also simple/existing) solution to the actual problem was found through the use of "included in the standard" CDFS graft points:
http://reboot.pro/topic/2887-boot-bartpe-as-img-from-hdd-wit...