swap inactive after boot <SOLVED>

Archived topics about LMDE 1 and LMDE 2
Locked
cj123

swap inactive after boot <SOLVED>

Post by cj123 »

I was looking in my system's monitor and I noticed that my swap partition was listed as inactive. I searched discussions and figured out how to turn it on manually with(swapon /dev/sda4). This works (at least it shows up in system's manager) but I lose it on reboot. From reading forums I thought the problem was that I needed to edit my fstab.

I have a dual boot macbook with partitions as follows: sda1 efi, sda2 mac os, sda3 lmde, sda4 swap. I've attached a screenshot of gparted to show how this is set up. (By the way, is that normal to have the unallocated space between the partitions?)

cat /etc/fstab

Code: Select all

# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc	/proc	proc	defaults	0	0
# /dev/sda3
UUID=142ecb22-a57e-4cbe-9316-7f31ae317d27	/	ext4	rw,errors=remount-ro	0	1
as you can see the swap isn't there.

sudo blkid

Code: Select all

/dev/sda1: LABEL="EFI" UUID="70D6-1701" TYPE="vfat" 
/dev/sda2: UUID="e15d7451-8196-31ed-bb5b-beb35cad13e4" LABEL="hd" TYPE="hfsplus" 
/dev/sda4: UUID="1c41d7bb-a90a-499c-bd11-4de68968709e" TYPE="swap" 
/dev/sda3: UUID="142ecb22-a57e-4cbe-9316-7f31ae317d27" TYPE="ext4"
I edited fstab to include the following line:

Code: Select all

# /dev/sda4
UUID=‍1c41d7bb-a90a-499c-bd11-4de68968709e	none	swap	sw	0	0
I saved the file and rebooted. I still had to activate swap with command even though my fstab contains the the line I wrote.

Any idea what is wrong?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
mack_mcash

Re: swap inactive after boot

Post by mack_mcash »

I edited fstab to include the following line:

Code: Select all
# /dev/sda4
UUID=‍1c41d7bb-a90a-499c-bd11-4de68968709e none swap sw 0 0
Edit fstab and replace "none" with "swap" and see how it works after restarting.

UUID=1c41d7bb-a90a-499c-bd11-4de68968709e swap swap sw 0 0

cheers, mack
cj123

Re: swap inactive after boot

Post by cj123 »

Thanks for the help, Mark. I replaced "none" with "swap" but swap was still inactive at boot. Best-CJ

Code: Select all

cat /etc/fstab
# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc	/proc	proc	defaults	0	0
# /dev/sda3	UUID=142ecb22-a57e-4cbe-9316-7f31ae317d27	/	ext4	rw,errors=remount-ro	0	1
# /dev/sda4	UUID=‍1c41d7bb-a90a-499c-bd11-4de68968709e	swap	swap	sw	0	0
cj123

Re: swap inactive after boot

Post by cj123 »

Now I somehow really screwed things up so that I can't boot into mint. I feel pretty stupid because the work around (typing swapon each boot) was working fine. I thought I'd try reformatting the swap partition and see if that had did anything. I opened gparted and reformated. This gave me a new UUID for sda4. I edited fstab to chang the uuid and rebooted. oops. Not booting anymore. I got a black screen saying, no bootable device detected insert one. I put in my live cd and nothing happened. I had to power down and try again. When I restarted I thought I'd check if rEFIT needed to resync my tables like it did when I first installed. It suggests changing my mbr from "efi protective" on my whole disk to something that looks more like my partition table: ee efi protective, af mac os x, hfs+, 83 linux, 82 linux swap.

Not sure what this means or if it gives a clue about what went wrong. I went ahead and accepted the resync but couldn't boot. This time I got tux penguin on the screen and nothing happened. I tried again from rEFIT with the live cd but the same thing happened (penguin!)

Should I repost this as a new problem? Is this a problem with rEFIT you think? Should I try and reinstall it? I'm not sure I will be able to reinstall mint because rEFIT isn't letting me boot from cd. I'll try that again holding down C. Edit: this (holding c) worked. I am going to try re-installing Grub from the live dvd when I next have the time. It looks like this is what the problem is judging from these forums:
http://ubuntuforums.org/showthread.php?t=224351
http://www.av8n.com/computer/htm/grub-reinstall.htm
maybe I am totally wrong. If that is case and some one wants to warn me before I try, I will be grateful. If it doesn't work I'll try a clean install.

I got this from partition inspector in osx

Code: Select all

*** Report for internal hard disk ***

Current GPT partition table:
 #      Start LBA      End LBA  Type
 1             40       409639  EFI System (FAT)
 2         409640    801234823  Mac OS X HFS+
 3      801496968    972054535  EFI System (FAT)
 4      972316680    976510983  Linux Swap

Current MBR partition table:
 # A    Start LBA      End LBA  Type
 1              1       409639  ee  EFI Protective
 2         409640    801234823  af  Mac OS X HFS+
 3 *    801496968    972054535  83  Linux
 4      972316680    976510983  82  Linux swap / Solaris

MBR contents:
 Boot Code: Unknown, but bootable

Partition at LBA 40:
 Boot Code: None (Non-system disk message)
 File System: FAT32
 Listed in GPT as partition 1, type EFI System (FAT)

Partition at LBA 409640:
 Boot Code: None
 File System: HFS Extended (HFS+)
 Listed in GPT as partition 2, type Mac OS X HFS+
 Listed in MBR as partition 2, type af  Mac OS X HFS+

Partition at LBA 801496968:
 Boot Code: GRUB
 File System: ext4
 Listed in GPT as partition 3, type EFI System (FAT)
 Listed in MBR as partition 3, type 83  Linux, active

Partition at LBA 972316680:
 Boot Code: None
 File System: Unknown
 Listed in GPT as partition 4, type Linux Swap
 Listed in MBR as partition 4, type 82  Linux swap / Solaris

Locked

Return to “LMDE Archive”