You are not logged in.
Hi all!
So I've come a long way but recently I tried (and gave up) trying to shrink my root partition to add that into my swap partition. I ended up simply making a swap file & everything is working great.
That got me thinking, with a lot of people saying swap partitions are basically obsolete (because we have swap files now) is that the whole story? Does anyone have differing opinions for why they might prefer using a swap partition as opposed to a swap file? For me personally I have about 4G of RAM then + 2G swap partition. I'm also thinking about just getting rid of the swap partition & throwing that new memory into the swap file so I'd have 4G RAM & a 10G swap file.
Overall I think I've gasped the basic concepts but am hoping for either a good discussion or perhaps some good resources so I can be better educated on the detailed differences (in function) of a swap partition vs swap file.
Warning recovering help-vampire: Do not feed me help (July, 8th 2020)
Fully Recovered help-vampire
(at some point late 2021)
Linux journey (approximately) Ubuntu -> Arch -> Debian -> Manjaro -> NixOs -> (attempted: unresolved hardware issues) gnu guix -> Gentoo -> Fedora -> Arch (current) (very outdated but back to arch as I put together my own distro).
Offline
Depends on your needs and what do you want, idk if it’s actually obsolete tho...
I have an encrypted swap partition, planning to make it usable by all the distros I decide to install (none other than Arch now tho, and the Gentoo guide is long AF)...
Hibernation and etc may be also of consideration, and I believe a big swap partition saved some known Archer root filesystem from a dd whoopsie...
Offline
Mod note: Moving to NC.
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
In the old days when Linux just got hibernation support, swap partition was required for hibernation (but most people who ran Linux in the old days didn't really care, Linux was meant to be 24/7 uptime, anyway.) I would guess swap partition was easier to manage from the kernel as it was guaranteed to be contiguous and simple linear block addressing. Nowadays, things could have improved tremendously and filesystem could have taken care of swap file fragmentation. The kernel could have been smarter today and managing swap space at filesystem layer instead of block layer could have been trivial.
Offline
Gaku,
That's a pretty cool thought. I didn't know you could have different operating systems (distros) sharing a partition. I suppose you couldn't do this with a swap file because each distro only has access to files within their environment unless I'm mistaken. But at the same time, if files are stored on the hard drives of a computer then shouldn't they be able to share partitions as well as files? thus you should be able to allow different distros to access the same swap file?
Wormzy, thanks for keeping the forum well organized.
Warning recovering help-vampire: Do not feed me help (July, 8th 2020)
Fully Recovered help-vampire
(at some point late 2021)
Linux journey (approximately) Ubuntu -> Arch -> Debian -> Manjaro -> NixOs -> (attempted: unresolved hardware issues) gnu guix -> Gentoo -> Fedora -> Arch (current) (very outdated but back to arch as I put together my own distro).
Offline
But at the same time, if files are stored on the hard drives of a computer then shouldn't they be able to share partitions as well as files? thus you should be able to allow different distros to access the same swap file?
Well, that would require different distros to access the same filesystem where the swapfiles are stored, and when you think of it, it’s the same as swap partition, just with extra steps. ![]()
Depends on use case, when you want different distros to live isolated and avoid dual hibernation into the same swap, the isolating the swap spaces would be the sane idea.
For a desktop I only care for occasional swapping and to give time to ctrl-c on dd mess-up by accident ![]()
So lack of isolation is not an issue, I haven’t tested with multiple distros, haven’t seen one smooth enough, it’s funny how nice installing Arch is...
Offline