Mint 19.1 looking for swap at boot, but I don't have one.

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
mm1992
Level 1
Level 1
Posts: 25
Joined: Mon Jan 01, 2018 1:33 pm

Mint 19.1 looking for swap at boot, but I don't have one.

Post by mm1992 »

When I boot my PC it hangs quite a bit. When I use the down arrow it tells me that it failed to activate swap /swapfile. See 'systemctl status swapfile.swap' for details. When I pop that into terminal I get this]

Code: Select all

swapfile.swap - /swapfile
   Loaded: loaded (/etc/fstab; generated)
   Active: failed (Result: exit-code) since Mon 2019-03-18 18:29:53 EDT; 4min 51s ago
     What: /swapfile
     Docs: man:fstab(5)
           man:systemd-fstab-generator(8)
  Process: 954 ExecActivate=/sbin/swapon -o sw /swapfile (code=exited, status=255)

Mar 18 18:29:53 My-PC systemd[1]: Activating swap /swapfile...
Mar 18 18:29:53 My-PC swapon[954]: swapon: /swapfile: read swap header failed
Mar 18 18:29:53 My-PC systemd[1]: swapfile.swap: Swap process exited, code=exited status=255
Mar 18 18:29:53 My-PC systemd[1]: swapfile.swap: Failed with result 'exit-code'.
Mar 18 18:29:53 My-PC systemd[1]: Failed to activate swap /swapfile.
I don't have a swapfile (16gb of ram and a SSD which from what i read meant that a swap wasn't really needed? Should I add one?) my fstab looks like:

Code: Select all

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sdc2 during installation
UUID=c08f33ec-16e4-4a29-9fd9-189f4c61cfdb /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sdc1 during installation
UUID=78B5-6EB0  /boot/efi       vfat    umask=0077      0       1
# /home was on /dev/sdc3 during installation
UUID=ac7128b8-9496-464d-bfbf-fd947258aee2 /home           ext4    defaults        0       2
/swapfile                                 none            swap    sw              0       0
#/dev/mapper/cryptswap1 none swap sw 0 0
/dev/md0 /RAID auto nosuid,nodev,nofail,x-gvfs-show 0 0
is there something that needs to be changed with how it lists the swap?

edit

Code: Select all

~$ inxi -Fxz
System:
  Host: My-PC Kernel: 4.15.0-20-generic x86_64 bits: 64 compiler: gcc 
  v: 7.3.0 Desktop: Cinnamon 4.0.9 Distro: Linux Mint 19.1 Tessa 
  base: Ubuntu 18.04 bionic 
Machine:
  Type: Desktop Mobo: Gigabyte model: H97M-D3H v: x.x serial: <filter> 
  UEFI: American Megatrends v: F2 date: 04/24/2014 
CPU:
  Topology: Quad Core model: Intel Core i5-4690 bits: 64 type: MCP 
  arch: Haswell rev: 3 L2 cache: 6144 KiB 
  flags: lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 27999 
  Speed: 926 MHz min/max: 800/3900 MHz Core speeds (MHz): 1: 1667 2: 1483 
  3: 2737 4: 2171 
Graphics:
  Device-1: Intel Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics 
  vendor: Gigabyte driver: i915 v: kernel bus ID: 00:02.0 
  Device-2: NVIDIA GK106 [GeForce GTX 660] vendor: eVga.com. driver: nvidia 
  v: 390.116 bus ID: 01:00.0 
  Display: x11 server: X.Org 1.19.6 driver: modesetting,nvidia 
  unloaded: fbdev,nouveau,vesa resolution: 1920x1080~60Hz, 1920x1080~60Hz 
  OpenGL: renderer: GeForce GTX 660/PCIe/SSE2 v: 4.6.0 NVIDIA 390.116 
  direct render: Yes 
Audio:
  Device-1: Intel Xeon E3-1200 v3/4th Gen Core Processor HD Audio 
  driver: snd_hda_intel v: kernel bus ID: 00:03.0 
  Device-2: Intel 9 Series Family HD Audio vendor: Gigabyte 
  driver: snd_hda_intel v: kernel bus ID: 00:1b.0 
  Device-3: NVIDIA GK106 HDMI Audio vendor: eVga.com. driver: snd_hda_intel 
  v: kernel bus ID: 01:00.1 
  Sound Server: ALSA v: k4.15.0-20-generic 
Network:
  Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet 
  vendor: Gigabyte driver: r8169 v: 2.3LK-NAPI port: d000 bus ID: 03:00.0 
  IF: enp3s0 state: up speed: 1000 Mbps duplex: full mac: <filter> 
Drives:
  Local Storage: total: 3.75 TiB used: 1.14 TiB (30.4%) 
  ID-1: /dev/sda vendor: Seagate model: ST2000DM001-1CH164 size: 1.82 TiB 
  ID-2: /dev/sdb vendor: Seagate model: ST2000DM001-1CH164 size: 1.82 TiB 
  ID-3: /dev/sdc vendor: Crucial model: CT120M500SSD1 size: 111.79 GiB 
RAID:
  Hardware-1: Intel SATA Controller [RAID mode] driver: ahci v: 3.0 
  bus ID: 00:1f.2 
  Device-1: md0 type: mdraid status: active Components: 
  online: sda~c0 sdb~c1 
  Info: raid: mirror blocks: 1953383488 report: 2/2 UU chunk size: N/A 
Partition:
  ID-1: / size: 45.58 GiB used: 9.20 GiB (20.2%) fs: ext4 dev: /dev/sdc2 
  ID-2: /home size: 63.52 GiB used: 4.52 GiB (7.1%) fs: ext4 dev: /dev/sdc3 
Sensors:
  System Temperatures: cpu: 29.8 C mobo: 27.8 C gpu: nvidia temp: 52 C 
  Fan Speeds (RPM): N/A gpu: nvidia fan: 36% 
Info:
  Processes: 238 Uptime: 3m Memory: 15.54 GiB used: 1.77 GiB (11.4%) 
  Init: systemd runlevel: 5 Compilers: gcc: 7.3.0 Shell: bash v: 4.4.19 
  inxi: 3.0.27 
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
pbear
Level 16
Level 16
Posts: 6569
Joined: Wed Jun 21, 2017 12:25 pm
Location: San Francisco

Re: Mint 19.1 looking for swap at boot, but I don't have one.

Post by pbear »

I'm a little surprised no one has picked this up, but the Forum is a bit slow these days, so maybe that's why. Anyhoo, I'm just beginning to learn about swapfile, so can't give a tried-and-true solution to your problem. I'm pretty sure, though, that you have to resolve the conflict one way or the other. That is, add a swapfile or disable the line in fstab. Note the swapfile doe not have to be the size of RAM, i.e., it can be much smaller.

As you'd rather not have swap, I'd try that first. Make a backup of the current file, sudo cp /etc/fstab/ /etc/fstab-old. Then open with administrative privileges, xed admin:///etc/fstab and place a # at the beginning of the swapfile line. Save and exit, then reboot. Alternatively, if you'd rather the safer route of creating a smallish swapfile, I found this webpage recently. Haven't tested but looks credible to me.

By all means, if someone drops in who is familiar with the topic, take their advice over mine.
gm10

Re: Mint 19.1 looking for swap at boot, but I don't have one.

Post by gm10 »

pbear wrote: Tue Mar 19, 2019 11:48 am By all means, if someone drops in who is familiar with the topic, take their advice over mine.
That guide is no good, it recommends fallocate, which man mkswap specifically tells you is incompatible. You can refer to section 3 of my guide here on how to properly create one:
viewtopic.php?f=42&t=284100&p=1569661#p1569661

It also contains code to quickly disable existing swap space:

Code: Select all

sudo sed -i '/swap/{s/^/#/}' /etc/fstab
Saves you the xed step. ;)

I don't think OP needs swap space with 16 GB though if they don't usually max that out, which depends on the use case.
pbear
Level 16
Level 16
Posts: 6569
Joined: Wed Jun 21, 2017 12:25 pm
Location: San Francisco

Re: Mint 19.1 looking for swap at boot, but I don't have one.

Post by pbear »

Thanks for the head's up. Have bookmarked your tutorial.
Locked

Return to “Installation & Boot”