2

Having problem with swap. Actually, in the system monitor it shows swap is not available, and then I installed GParted partition editor.

There is a partition named /dev/sda7 and file system is linux-swap. I turned on swap from there and now everything becomes correct but when I reboot it is unable to persist the change. Again it is showing no swap in the system monitor.

Braiam
  • 67,791
  • 32
  • 179
  • 269
MOS
  • 21

1 Answers1

0

Most likely the installation didn't added the swap partition to the fstab. This is easy to solve:

  1. Open a terminal and type sudo blkid:

    sudo blkid
    /dev/sda1: UUID="bf554a2f-a035-4c22-bca8-162def35a03c" TYPE="ext4" 
    /dev/sda2: UUID="3962db06-3776-4f38-8ab9-eab6feeccc1d" TYPE="ext4" 
    /dev/sdb1: UUID="AA64B45A64B42AC9" TYPE="ntfs" 
    /dev/sdb2: UUID="F66E431C6E42D551" TYPE="ntfs" 
    /dev/sdb3: UUID="75a0854b-8b6b-453f-8aec-2a081a1f19e3" TYPE="swap"

    I've marked the swap partition. Save the UUID value.

  2. Edit the /etc/fstab file with whatever editor you like, but for efficiency sake I would tell you two methods:

    • Open the file with an editor using sudo gedit or sudo vim or sudo nano, whichever you like/feel better, then type this lines at the end (be aware the I will be typing my owns since this is an example, you must change the UUID value)

      UUID=75a0854b-8b6b-453f-8aec-2a081a1f19e3 none            swap    sw              0       0
    • Using a one liner. Type the following in a terminal:

      UUID="75a0854b-8b6b-453f-8aec-2a081a1f19e3"
      sudo sh -c "echo $UUID 'none swap sw 0 0' >> /etc/fstab
  3. Now reboot your system, then type free:

                 total       used       free     shared    buffers     cached
    Mem:       1533744    1455700      78044          0      89548     690756
    -/+ buffers/cache:     675396     858348
    Swap:      1546232          0    1546232

    As you can see, the total swap is not 0. Same should happen with the system monitor

Braiam
  • 67,791
  • 32
  • 179
  • 269