Swap Space Not Activated On Boot
Nils Kassube
kassube at gmx.net
Sat Jun 28 09:25:05 UTC 2014
Graham Watkins wrote:
> I've recently become aware that the 4Gb swap partition I created
> during the installation process is not being started on boot.
> Initially at least, this was due to my own stupidity because I
> somehow forgot to format it. I have since formatted it using
> gnome-disks but it is still not available on boot although I can
> start it manually in gnome-disks.
> I think I probably need to change something in fstab but so far all my
> tinkering has been in vain.
> sudo fdisk -l
>
> Disk /dev/sda: 320.1 GB, 320072933376 bytes
[...]
> Device Boot Start End Blocks Id System
> /dev/sda1 * 63 625141759 312570848+ 83 Linux
>
> Disk /dev/sdb: 160.0 GB, 160041885696 bytes
[...]
> Device Boot Start End Blocks Id System
> /dev/sdb1 * 2048 117270527 58634240 83 Linux
> /dev/sdb2 117272574 312580095 97653761 5 Extended
> /dev/sdb5 117272576 125270015 3998720 82 Linux swap /
> Solaris
> /dev/sdb6 125272064 312580095 93654016 83 Linux
>
> sudo cat /etc/fstab
[...]
> # / was on /dev/sdb1 during installation
> UUID=ac228376-2087-45ee-a47e-6018398186e2 / ext4
> errors=remount-ro 0 1
> # /home was on /dev/sdb6 during installation
> UUID=fba7b900-46aa-402d-88a2-359f05945a2f /home ext4
> defaults 0 2
> # swap was on /dev/sdb5 during installation
> UUID=83ffea71-702b-4570-9c9a-3680f3290c56 none swap sw
You wrote that you formatted the swap partition but probably you didn't
change the UUID of the fstab entry. You can find out the UUID with the
command
ls -l /dev/disk/by-uuid/ | grep sdb5
and then change the string after the "UUID=" of the fstab entry
according to the output of the command above.
After modifying the fstab you can use the commands
sudo swapon -a
free -h
to check if the change was successful.
Nils
More information about the ubuntu-users
mailing list