# Linux disk partitioning

**URL:** <https://boards.straightdope.com/t/linux-disk-partitioning/932657>\
**Category:** Factual Questions\
**Created:** [February 11, 2021, 5:37am UTC](https://boards.straightdope.com/t/linux-disk-partitioning/932657 "2021-02-11T05:37:28Z")\
**Posts on this page:** 5\
**Page:** 2

<div class="post-metadata">

**Author:** ![HMS\_Irruncible](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/hms_irruncible/32/7394_2.png) [@HMS\_Irruncible](https://boards.straightdope.com/u/HMS_Irruncible)\
**Post date:** [March 11, 2021, 5:26pm UTC](https://boards.straightdope.com/t/linux-disk-partitioning/932657/21 "2021-03-11T17:26:49Z")

</div>

A swap file competes for space with other files on the filesystem. If the filesystem is full, then a dynamically sized swap file wouldn’t be able to grow as intended.

Also, a swap filesystem can be mounted and usable without any of the other filesystems being initialized. If your swap was on a regular filesystem that got corrupted, on top of the problem of a corrupted filesystem, you’d have the additional problem of having to fix the swap problem.

---

<div class="post-metadata">

**Author:** ![markn\_1](https://avatars.discourse-cdn.com/v4/letter/m/f9ae1b/32.png) [@markn\_1](https://boards.straightdope.com/u/markn_1)\
**Post date:** [March 11, 2021, 5:55pm UTC](https://boards.straightdope.com/t/linux-disk-partitioning/932657/22 "2021-03-11T17:55:03Z")

</div>

Many aeons ago I was developing the virtual memory system for a proprietary operating system (Penpoint, if you remember Go Corp.) The architecture was different than the monolithic kernels typical in that era, and the filesystem was partially a user process. We were running into some hard-to-debug deadlocks. I finally discovered what was happening was part of the filesystem was being swapped out to the swap file, and the VM system was trying to swap it back in by calling the filesystem to read the file … That’s what we technically call a “not good” situation.

---

<div class="post-metadata">

**Author:** ![LSLGuy](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/lslguy/32/5813_2.png) [@LSLGuy](https://boards.straightdope.com/u/LSLGuy)\
**Post date:** [March 11, 2021, 10:51pm UTC](https://boards.straightdope.com/t/linux-disk-partitioning/932657/23 "2021-03-11T22:51:32Z")

</div>

> [@markn\_1](#):
>
> I finally discovered what was happening was part of the filesystem was being swapped out to the swap file, and the VM system was trying to swap it back in by calling the filesystem to read the file …

I _hate_ it when that happens. 😉

---

<div class="post-metadata">

**Author:** ![si\_blakely](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@si\_blakely](https://boards.straightdope.com/u/si_blakely)\
**Post date:** [March 12, 2021, 9:19am UTC](https://boards.straightdope.com/t/linux-disk-partitioning/932657/24 "2021-03-12T09:19:01Z")

</div>

I think I read just this week that that **Linus Torvalds** marked the latest 5.12-rc1 linux kernel as _DONTUSE_ due to a bug in the swap file handler that lost the current file offset, and started writing new swap data into the rest of the file system 😲

---

<div class="post-metadata">

**Author:** ![scabpicker](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/scabpicker/32/8268_2.png) [@scabpicker](https://boards.straightdope.com/u/scabpicker)\
**Post date:** [March 12, 2021, 9:56pm UTC](https://boards.straightdope.com/t/linux-disk-partitioning/932657/25 "2021-03-12T21:56:25Z")

</div>

Heheh, yeah he marked it DONTUSE last week. Fortunately, if you used a swap partition, you were unaffected by the bug. 🤡

[Previous page](https://boards.straightdope.com/t/linux-disk-partitioning/932657.md?page=1)
