No swap in fstab

When you run into problems installing MX Linux XFCE
Post Reply
Message
Author
garg
Posts: 2
Joined: Mon Jan 21, 2019 8:34 pm

No swap in fstab

#1 Post by garg »

A while back I installed MX 17.? from a live USB. As my previous install was debian, I had the installer format the root and swap partition and retained my existsing home. This all went well and I'm very happy with MX. Recently I've begun to have random freezes and after some digging found many many people were also having freezes due to no swap configured. This appears to also be my problem so hopefully it's now resolved.

So the issue I'm raising is why didn't the installer put the proper info in fstab so the swap partition I had created would survive a restart? Obviously many others have the same problem. If this has been fixed already then wonderful. I did a search of the forums and couldn't find any relevant related content.

Thanks.

User avatar
dolphin_oracle
Developer
Posts: 19926
Joined: Sun Dec 16, 2007 1:17 pm

Re: No swap in fstab

#2 Post by dolphin_oracle »

Good question ...it's supposed to. We will take a look that ks.for the report.
http://www.youtube.com/runwiththedolphin
lenovo ThinkPad X1 Extreme Gen 4 - MX-23
FYI: mx "test" repo is not the same thing as debian testing repo.

User avatar
figueroa
Posts: 1049
Joined: Fri Dec 21, 2018 12:20 am

Re: No swap in fstab

#3 Post by figueroa »

My two full installations from a live-usb onto real hardware with existing swap partitions found a swap partition and put it into the fstab. My two installations into a VirtualBox virtual machine automatically created a swap partition and put it into the fstab. These were routine installations where I did nothing special. My live-usb drives were MX-17 to start with and eventually updated to MX-18 and remastered prior to the last two installations.
Andy Figueroa
Using Unix from 1984; GNU/Linux from 1993

garg
Posts: 2
Joined: Mon Jan 21, 2019 8:34 pm

Re: No swap in fstab

#4 Post by garg »

I stumbled over the cause of this.

I have a multi-boot environment with 4 or 5 distributions installed at any particular time. Whenever a new distribution is installed, it reformats the swap partition, which, by definition, changes the UUID of that partition. This breaks the fstab swap definitions in all the distributions that are currently installed, and makes them no longer use swap when they are in use. You currently have to go back and manually update all the other fstab's to now use the updated UUID.

So is there really a reason to reformat the swap every time a new distribution is installed? Maybe it should be optional.

User avatar
asqwerth
Developer
Posts: 7212
Joined: Sun May 27, 2007 5:37 am

Re: No swap in fstab

#5 Post by asqwerth »

garg wrote: Thu May 16, 2019 7:11 pm I stumbled over the cause of this.

I have a multi-boot environment with 4 or 5 distributions installed at any particular time. Whenever a new distribution is installed, it reformats the swap partition, which, by definition, changes the UUID of that partition. This breaks the fstab swap definitions in all the distributions that are currently installed, and makes them no longer use swap when they are in use. You currently have to go back and manually update all the other fstab's to now use the updated UUID.

So is there really a reason to reformat the swap every time a new distribution is installed? Maybe it should be optional.
You don't have to reformat swap for it to work, but not every distro installer gives you that option.

For most installers in Debian/Ubuntu-based distros including MX, it will detect existing swap partitions but you can choose not to format it during the installation. I believe most of these installers will give you the choice to use existing swap partitions without reformatting and write their current UUID (as is) into the fstab file. Some installers (I think) might even just use the existing swap, whether or not you select swap during installation, so long as you don't choose to (re)format it. MX installer does that.

For other distros, some might give you the same option. If not, just don't select any swap partition as part of the install process. This might mean no swap entry in the fstab file, requiring you to subsequently manually edit the fstab file. I have no issue with that.

But for quite a few Slackware-based distros (I tried Vector Linux, Zenwalk, Salix), the "choose swap" step appears to be compulsory, and then the installer automatically reformats it. Argh. Only Slackel allowed me to choose not to have (ie, not to format) a swap partition, from what I can recall.
Desktop: Intel i5-4460, 16GB RAM, Intel integrated graphics
Clevo N130WU-based Ultrabook: Intel i7-8550U (Kaby Lake R), 16GB RAM, Intel integrated graphics (UEFI)
ASUS X42D laptop: AMD Phenom II, 6GB RAM, Mobility Radeon HD 5400

User avatar
jackdanielsesq
Posts: 244
Joined: Sun Apr 21, 2019 9:02 am

Re: No swap in fstab

#6 Post by jackdanielsesq »

Its a Debian thing - I would get the eternal 90sec wait on each distro - had 15x partitions/distros
Discovered the 'format, not to format cause' - but not all installers are created equally
Eliminated the swap-file - had plenty RAM - skipped over the swap-file warnings - all copacetic
Regards
Jack

User avatar
asqwerth
Developer
Posts: 7212
Joined: Sun May 27, 2007 5:37 am

Re: No swap in fstab

#7 Post by asqwerth »

jackdanielsesq wrote: Fri May 17, 2019 2:29 am Its a Debian thing - I would get the eternal 90sec wait on each distro - had 15x partitions/distros
Discovered the 'format, not to format cause' - but not all installers are created equally
Eliminated the swap-file - had plenty RAM - skipped over the swap-file warnings - all copacetic
Regards
Jack
It's not a Debian thing but a systemd thing.

When you boot any distro using systemd, and it finds that the swap UUID in the distro's fstab file is no longer detected in any of the partitions on any device, it will activate the 90 sec check.
Desktop: Intel i5-4460, 16GB RAM, Intel integrated graphics
Clevo N130WU-based Ultrabook: Intel i7-8550U (Kaby Lake R), 16GB RAM, Intel integrated graphics (UEFI)
ASUS X42D laptop: AMD Phenom II, 6GB RAM, Mobility Radeon HD 5400

Post Reply

Return to “Installation”