2

I was given an answer earlier on how to correct a swap file issue. Now however, I discover that I have no /etc/fstab folder in my file system to alter. I have a /etc/fstab.d folder but it is empty. I am able to boot up (GRUB2) with the only issue being my swap file doesn't load at boot up and has to be loaded with GParted manually. The prior answer indicated "(It's got a swap device with the same name :-) " and suggested I amend my /etc/fstab folder. When I try in the terminal as SUDO I get a denied permission response and then discovered the /etc/fstab issue. Any suggestions or am I better off backing up my home directories and partion the drive for both Mint Xfce and Mate again?

Update: I found the fstab file as a txt file in the etc folder it isa mess

# /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/sda1 during installation
UUID=b1f19883-53c5-4f12-9220-e8ffadfcb29d /               ext4    errors=remount-ro 0       1
# swap was on /dev/sda5 during installation
UUID=21286226-9a42-46ed-b421-b44cb4342715 none            swap    sw              0       0
Deltik
  • 19,971
user519471
  • 21
  • 2

1 Answers1

2

This is a full answer expanded from this comment as suggested by cristi.

This question is a follow-up to Swap file automatic loading in Linux.


/etc/fstab is a regular file, not a folder, and it must exist or your system would not boot.

I see that you were later able to find the /etc/fstab file.

Solution

Replace the last line of /etc/fstab (reproduced below):

UUID=21286226-9a42-46ed-b421-b44cb4342715 none            swap    sw              0       0

… with this line instead:

/dev/sda5 none            swap    sw              0       0

Explanation

It sounds like you may have removed and recreated the SWAP partition /dev/sda5, which changes the UUID that the /etc/fstab was using to find the SWAP partition at the time of the operating system installation.

Instead of identifying the SWAP partition as UUID=21286226-9a42-46ed-b421-b44cb4342715, /dev/sda5 is the SWAP partition as we know it from your setup.

Caveat

/dev/sda5 is not guaranteed to identify the SWAP partition. If you insert another hard drive into your computer, /dev/sda5 might become /dev/sdb5.

You can go back to using the UUID by finding the new UUID of your SWAP partition. This command can give you the new UUID:

blkid | grep 'TYPE="swap"'

If your new UUID is f95e5378-6b56-4369-80ea-1845313041c8, you should use this as your new /etc/fstab line for SWAP:

UUID=f95e5378-6b56-4369-80ea-1845313041c8 none            swap    sw              0       0
Deltik
  • 19,971