Swap Space Not Activated On Boot

Graham Watkins shellycat.gw at ntlworld.com
Sat Jun 28 10:13:30 UTC 2014


On 28/06/14 10:25, Nils Kassube wrote:
> 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
>
>

Hi Nils,

Thanks for your response.

I think that's fixed it.  However, sudo swapon -a produces the following 
response:

swapon: /dev/mapper/cryptswap1: stat failed: No such file or directory

although top shows:

KiB Swap:  3998716 total,        0 used,  3998716 free.   645796 cached Mem

which it didn't before.

I noticed the cryptswap entry in fstab and I'm thinking that it has 
something to do with my encrypting my home partition during 
installation.  I don't know much about what goes on under the hood when 
a partition is encrypted so I'm not sure what's going on here.

Still, at least I now have a fully functioning swap partition. Thanks again.

Cheers,

Graham







More information about the ubuntu-users mailing list