Michael Stone writes:
This all dates from the days when 1) you might actually need swap to complete an install and 2) swap was utilized by partition name and not a UUID. It's reasonable to wonder if the installer still needs to be so aggressive about swap space. There's a bug (842409) dating from 2016 regarding this topic, which was opened with severity minor and hasn't gotten any commentary since then. Another (905793) got a few comments but nothing in more than a year. Perhaps some discussion sent to the BTS about alternate behaviors would be useful, rather than just rants that "something" is "broken"?
Hello, I am not the OP, yet I have often wondered about this behaviour of formatting swap. I think existing swap partitions can be present under various circumstances: * A single swap partition from a previous installation. In this case (which I would consider the most common one?), there is no real difference whether the swap is formatted again or not. * A single swap partition from other (actively used or not) installations. In this case, changing the UUID _breaks_ all other installations at the expense of the new installation. I agree that sharing a swap space is bad with suspend-to-disk scenarios in general. Yet I think that not reformatting and actually sharing the swap between multiple installations works in two (very common?) scenarios: (1) No suspend to disk used (2) Resumption after suspend to disk always happens for the "correct" Linux installation even if multiple ones are present. I am not exactly sure how suspend to disk behaves (as I did not use it since I switched to Linux...), but I remember that on Windows it would bypass the regular BIOS screens and directly resume the OS. Hence, is the chance that the "wrong" sytstem is resumed (causing all kinds of havoc) so high actually? * Multiple swap partitions. My proposal would be as follows: * If a swap partition is already present, do not use it by default. As some people always point out: Today, there are a lot of users not needing/wanting any swap. * If the user selects the existing partition (i.e. not created in this installer session) for "use as: swap", then the installer gives a dialog with this text (or similar in better English...): | You have selected a previously existent swap partition to be used for | swap. | | While this is tecnically possible without reformatting, sharing swap | between multiple Linux installations (Debian or not) is explicitly | advised against (see <<<URL>>> for details). | | Format this swap? | | [YES, Format Swap] [NO, Use existing UUID] <<<URL>>> would be replaced by a link to the documentation elaborating on the dangers of sharing swap and the constraints under which it might be reasonable. Btw. thanks for sharing the bug report (here is a link): https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=905793 My typical use of systems * All systems have swap because I run out of RAM multiple times per year. Yes I know I should upgrade RAM, but my most "powerful" system is maxed out at 32GB RAM, thus I am left with buying a new system [planned] or swap and the swap made things work which were otherwise "impossible" -- one of the reasons for using Linux in the end... And then, when it comes to buying a new system it might seem overkill to have enough RAM for "all of the times", instead of "most of the times" which is my reason for believing that swap is not going away anytime soon? * No suspend to disk * No multi-boot configuration. I fail to see how multiple Linux boots are still such a common use case now that all kinds of technology simplify the process of running multiple distributions "under another" (VMs and Containers come to mind). But then again, I am among the "Linux for doing the otherwise impossible" group of people thus I like to see advances in Linux technology also outside the areas that I am using it for :) * Final point: I know that I got problems with this reformatting in the past although reading my "typical use", I should not ever come to see any negative consequences from it... For me it boils down to: Formatting is a surprising default? [...] YMMV Linux-Fan