3 ms·
Couple of things this didn't consider. * If you have a small root partition, the default config puts the swap file on there, wasting precious space. * With a
by lproven 23d ago
Couple of things this didn't consider.
* If you have a small root partition, the default config puts the swap file on there, wasting precious space.
* With a partition, it's easier to put swap on a separate physical device, which is good for performance.
* If you dual boot 2+ Linux distributions or installations on a single machine, as I do routinely, you can share a single swap partition between distros no problem. This means it's more space efficient and keeps down partitioning complexity.
* And of course there's hibernation, as others have mentioned.
Conclusion: no, bad advice, except for very simplistic scenarios.
- zahlman 23d ago> If you have a small root partition, the default config Of what distro? If you mean that the example code shows the swapfile directly under / , well of course you don't have to do it that way. > With a partition, it's easier to put swap on a separate physical device, which is good for performance. I think this is untrue on both counts. First, nobody is going to dedicate an entire physical device to swap, because the smallest storage devices you can get are enormous compared to the RAM they're trying to support. If the device is "separate" (from what, / ?) but still has other things on it, it's even less clear why this would matter for performance. But also it's trivial to put a swapfile on whatever device you want. It can be anywhere reasonably sane in the filesystem, you just give it a path. > you can share a single swap partition between distros no problem The file could go on whatever partition the distros can share. Maybe put it under /home or something. It's your system, the FHS is up to your own interpretation. > And of course there's hibernation, as others have mentioned. Why would that matter? You're expecting a file not to survive the low-power state?
- dwattttt 23d agoGP is not presenting these as evidence for an approach, just notable facts that weren't initially obvious.
- zahlman 22d agoThe comment concludes with "Conclusion: no, bad advice, except for very simplistic scenarios.", so I don't think I can agree with you on this. My point was that these facts don't (in my analysis) support the conclusion, and suggest a contradictory stance (in particular: planning in advance to dual-boot multiple separate distros, but not being willing to adjust the configuration after installation).
- lproven 22d agoI think you're wrong on every single point you make. > Of what distro? Of any distro. I have done such configs with Ubuntu, Debian, openSUSE, SLE, Fedora, CentOS, RHEL, Alpine, Arch, you name it. > If you mean that the example code shows the swapfile directly under / , well of course you don't have to do it that way. Point missed. If you have a swap file created by the installer then you do not get to specify where that swapfile is, in any distro I have seen in my 30 years of working with Linux and 38 years of Unix. (Not that swap files were common on Unix in the 20th century.) If you specify a swap partition then you choose where it is. > I think this is untrue on both counts. First, nobody is going to dedicate an entire physical device to swap, Incorrect assumption. You inserted "entire device" but I did not say that. A swap partition is part of a device. The clue is there in the name. All my Thinkpads, for example, have 2 SSDs and typically I put root on the faster SSD and /home and swap on the slower SSD (or HDD). I typically configure 4-8GB of swap even if the machine has 32GB or more of RAM -- I rarely hibernate these boxes, TBH. That is plenty. If you hibernate, swap should be at least as big as RAM, or maybe 10-20% bigger in case it's already swapping when you hibernate. > If the device is "separate" (from what, / ?) Yes. More or less all typical Unix-like OSes read and write a lot to and from root in use, and under load, from swap. So, put them on different physical drives and spread the load. This has been standard practice since the 1960s! > But also it's trivial to put a swapfile on whatever device you want. It can be anywhere reasonably sane in the filesystem, you just give it a path. It's extra manual config. A partition is one box in the installer and done. Zero manual config. > The file could go on whatever partition the distros can share. Again, you miss the point. 1. Distros do not by default mount one another's partitions. > Maybe put it under /home or something. You can but suddenly permissions and ownership become issues. > It's your system, the FHS is up to your own interpretation. It is preferable to do this in the installer and not worry about interpreting anything. > Why would that matter? You're expecting a file not to survive the low-power state? Have you read the other comments?
- zahlman 22d ago> If you have a swap file created by the installer then you do not get to specify Why should we care about what the installer does when it's trivial to change later? You said this is "bad advice, except for very simplistic scenarios" but people not in "very simplistic scenarios" are perfectly capable of running a few shell commands. Aside from which, typical home users are in very simplistic scenarios. The Mint installer defaults to a single partition aside from what's required for booting, and a swapfile at /swapfile. And tons of Mint users are doing just fine with that. They are not realistically going to distro-hop because it won't realistically solve any problems for them. Your overall argument seems to depend on accommodating some hypothetical power users who nevertheless want the installer to get it right for them. But in this case, why not petition the distro to improve the installer instead? > This has been standard practice since the 1960s! And? the point here is to identify a benefit of putting swap on a carefully chosen partition that cannot be realized by putting swap on a file at a carefully chosen path (since that choice also implicitly puts it on a specific partition). > You can but suddenly permissions and ownership become issues. I can't fathom why. I said /home, not ~. > Point missed. ... Incorrect assumption. ... Have you read the other comments? I consider this sort of commentary incivil (and the commenting guidelines support me in this). I also did not make an assumption at all; I considered one of two alternative meanings without introducing it with the word "if". That's why the second possibility does start with "if". This is just a rhetorical technique, dismissing the most absurd interpretations first exactly because they are easier to dismiss.
- lotharcable 23d agoThere are lots of very good reasons why running small root partitions on Linux desktops is a very bad idea. The smart money is on a single large partition for home and root and everything else. This way you get 100% disk availability with zero extra effort and you get maximum performance. No need to shuffle disk space around with resizing partitions or thing volumes or anything like that. Unless you have some sort of special use case were root partition can't be shared with root then on most desktop setups having a single large partition is the most straightforward way to do things. Hibernation isn't really something really useful anymore. If people really really want it then I don't see why they shouldn't get it... but I really don't see the point.
- lproven 22d ago[flagged]
- akerl_ 22d agoYou’ve tainted your otherwise interesting comment pretty intensely by mixing in this level of condescension and hostility.
- NBJack 22d agoI, uh, would be more careful of making that statement given our public comment history. I know I can't cast any stones here. More than interesting though, I will vouch for many of the points they presented in practice. Spreading partitions and taking advantage of the flexibility of Linux with how and where they are mounted has been a part of best practices for decades now. Many cloud-based solutions for Linux workstations I've used take full advantage of this for easier management of space (i.e. volume expansion) as well as security considerations, to say nothing of keeping your /var/log separate to avoid running out of space because you turned on verbose mode for something.
- akerl_ 22d agoI’m not sure what you’re trying to say. I deserve to be called out just the same if I’m wrapping good points with “Drivel. Absolute piffle.” and “Maybe you are young and inexperienced”.
- efaref 22d agoIt also clouds disk usage stats, as a big chunk of your root device is taken up by the swap file. I'd rather look at `df /` and see the size of my OS installation without anything else. Partition resizing is not exactly difficult, and I can count the number of times I've ever actually had to resize a swap partition in the last 30 years on the fingers of one foot.