Ubuntu: SWAP partition on LVM encrypted installation not mounting



Question:

I installed Ubuntu 14.04 and checked on the LVM encrypted partition option, leaving the installer do its job with the default behavior for it. When I then booted up, there was a complaint during the splash screen, after putting my password in, that the SWAP partition couldn't be mounted, telling me to wait, press S to ignore or press M to manually mount.

This is all the information I managed to gather about it:

vmatir@vmatir-X200MA:~$ sudo swapon -a  swapon: /dev/mapper/ubuntu--vg-swap_1: la lectura de la cabecera de intercambio falló: Argumento inválido  swapon: /dev/mapper/cryptswap1: stat falló: No existe el archivo o el directorio  vmatir@vmatir-X200MA:~$    /////////////////////////////////////  The first line says: the reading of the swap header failed: invalid argument  The second line says: stat failed: the file or directory doesn't exist  ////////////////////////////////////    vmatir@vmatir-X200MA:~$ lsblk  NAME                           MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT  sda                              8:0    0 465,8G  0 disk    â"œâ"€sda1                           8:1    0   512M  0 part  /boot/efi  â"œâ"€sda2                           8:2    0   244M  0 part  /boot  â""â"€sda3                           8:3    0   465G  0 part      â""â"€sda3_crypt (dm-0)          252:0    0   465G  0 crypt       â"œâ"€ubuntu--vg-root (dm-1)   252:1    0 463,1G  0 lvm   /      â""â"€ubuntu--vg-swap_1 (dm-2) 252:2    0   1,9G  0 lvm     vmatir@vmatir-X200MA:~$     // swap_1 not mounting.    vmatir@vmatir-X200MA:~$ free -m               total       usado       libre     compart.    búffers     almac.  Mem:          1888       1814         73        302         56        885  -/+ buffers/cache:        872       1015  Intercambio:          0          0          0  vmatir@vmatir-X200MA:~$     vmatir@vmatir-X200MA:~$ mountall -v  / es local  /proc es virtual  /proc/sys/fs/binfmt_misc es virtual  /sys es virtual  /sys/fs/cgroup es virtual  /sys/fs/fuse/connections es virtual  /sys/kernel/debug es virtual  /sys/kernel/security es virtual  /sys/firmware/efi/efivars es virtual  /dev es virtual  /dev/pts es virtual  /tmp es local  /run es virtual  /run/lock es virtual  /run/shm es virtual  /run/user es virtual  /sys/fs/pstore es virtual  /boot es local  /boot/efi es local  /dev/mapper/ubuntu--vg-swap_1 es swap  /dev/mapper/cryptswap1 es swap  /sys/fs/cgroup/systemd es virtual  /home/vmatir es virtual  /run/user/1000/gvfs es local  mountall: No es posible escuchar conecciones privadas: Failed to bind socket "/com/ubuntu/mountall/server/": La dirección ya se está usando  mounting event sent for /tmp  mountall: Desconectado de Upstart  vmatir@vmatir-X200MA:~$     vmatir@vmatir-X200MA:~$ cat /etc/fstab  # /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>  /dev/mapper/ubuntu--vg-root /               ext4    errors=remount-ro 0       1  # /boot was on /dev/sda2 during installation  UUID=264a8a19-71da-4f00-b3f9-f90bd565b531 /boot           ext2    defaults        0       2  # /boot/efi was on /dev/sda1 during installation  UUID=D764-71B4  /boot/efi       vfat    defaults        0       1  /dev/mapper/ubuntu--vg-swap_1 none            swap    sw              0       0  /dev/mapper/cryptswap1 none swap sw 0 0  vmatir@vmatir-X200MA:~$   

I really need this SWAP partition to be mounted since this notebook only has 1.8GB of RAM, and I can barely see my mails without the PC completely freezing.


Solution:1

Thank you to @Palantir, the fix was running: sudo mkswap /dev/mapper/ubuntu--vg-swap_1

And commenting out the last line or deleting the last line of the /etc/fstab:

vmatir@vmatir-X200MA:~$ cat /etc/fstab  # /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>  /dev/mapper/ubuntu--vg-root /               ext4    errors=remount-ro 0       1  # /boot was on /dev/sda2 during installation  UUID=264a8a19-71da-4f00-b3f9-f90bd565b531 /boot           ext2    defaults        0       2  # /boot/efi was on /dev/sda1 during installation  UUID=D764-71B4  /boot/efi       vfat    defaults        0       1  /dev/mapper/ubuntu--vg-swap_1 none            swap    sw              0       0  vmatir@vmatir-X200MA:~$   

And now the swap partition mounts on boot:

vmatir@vmatir-X200MA:~$ free -m               total       usado       libre     compart.    búffers     almac.  Mem:          1888       1619        268        201         57        781  -/+ buffers/cache:        780       1107  Intercambio:       1931          0       1931  vmatir@vmatir-X200MA:~$ lsblk  NAME                           MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT  sda                              8:0    0 465,8G  0 disk    â"œâ"€sda1                           8:1    0   512M  0 part  /boot/efi  â"œâ"€sda2                           8:2    0   244M  0 part  /boot  â""â"€sda3                           8:3    0   465G  0 part      â""â"€sda3_crypt (dm-0)          252:0    0   465G  0 crypt       â"œâ"€ubuntu--vg-root (dm-1)   252:1    0 463,1G  0 lvm   /      â""â"€ubuntu--vg-swap_1 (dm-2) 252:2    0   1,9G  0 lvm   [SWAP]  vmatir@vmatir-X200MA:~$  

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »