Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Old-School Disk Partitions (bsdimp.blogspot.com)
91 points by zdw on July 21, 2020 | hide | past | favorite | 7 comments


> Swap was put in between the used parts of other of the disk. This was tricky to get right, since you had to map out the system.

... one of the classic mistakes, well after the era the author refers to here, was to overlap a swap and filesystem partition. Worked just fine until that last block of swap got used; then suddenly the filesystem's hosed... but it repaired ok and then was good for sometime, until the same would happen again.

gaps in between partitions could provide useful hidden space for all manner of things too.

Someone recently posted an overlapped filesystem stunt that was at the same time a valid FAT and ext2? volume; i think. Can't recall enough of it to find a link now.


I personally ran into this on a Sun workstation. The earlier versions of the "format" command didn't do the partitioning math for you. So you had to add cylinder numbers yourself. In calculating the start position of /usr, which came immediately after swap, someone had forgotten to carry a 1.

When displaying the partition table, if I remember right it only showed starting position and size. So to verify it was correct when looking at it, you had to do the math again, so it was difficult to spot the error.

But it had the exact symptoms you describe. The user complained that the system worked fine until they opened a lot of stuff, then it crashed.

The only reason I figured it out was that we had several identical machines (with identical disk drives), and I happened to run "df", and this machine had a suspiciously large amount of disk space. Space was always tight because disks were small (200-400MB), but none of the filesystems seemed close to filling up. I couldn't explain that, so I started scrutinizing very carefully, and then it hit me.


You're probably referring to this: https://news.ycombinator.com/item?id=22055145


that's the bunny, thanks very much


"The 3rd edition has the enigmatic /crp filesystem documented for one of the drives (I wonder what it's an abbreviation for):"

"Crap" is what first comes to mind, but Rob Pike seems to confirm /crp was short for "creep": https://inbox.vuxu.org/tuhs/CAKzdPgzPtnPQoUwGpTeaQjhfW8zUHsO...

Side note: I can only find this single reference to that backstory. Seems we are pretty close to losing a lot of history.


I have worked on embedded Linux systems recently enough where I had to change the driver and recompile the kernel to repartition the disk. It was just a chunk of Flash memory, and it was up to the driver to tell it what to be.


I’ve done this and created overlapping regions to repartition the NAND. Mtd devices are frustrating because their partition layout is set at compile-time so if you want to change layouts you have to recompile the kernel. And if you need to migrate from one partition scheme to another you have to have partitions defined for both schemes in the same kernel.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: