system is Ubuntu 12.04 x64 Linux UserPC 3.2.0-29-generic #46-Ubuntu SMP Fri Jul 27 17:03:23 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux I had to do modifications to the partitioning of Windows, in short I deleted the system reserved 100mb partition at the beginning of the drive because bios couldn't pass the post if I set the disk as ahci due to old known bug with little partitions at the beginning of the drive not being recognized. So I deleted it, tried to move it after the win7 partition, failed, removed it completely. System is in dual boot with Ubuntu on the same drive.
Now, after all this, swap went from sda4 to sda3 and it was not working/used anymore. swapon -a gave can't stat /dev/mapper/cryptswap1 due it could't find file, size was 0 in free, and cryptsetup status gave it was inactive. /etc/fstab appeared fine already:
# /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>
proc /proc proc nodev,noexec,nosuid 0 0
# / was on /dev/sda3 during installation
UUID=3c29e515-b02d-4c9a-9f49-a1502801c6c5 / ext4 errors=remount-ro 0 1
# swap was on /dev/sda4 during installation
#UUID=29b56165-8561-4eb2-87d2-619dab8959f6 none swap sw 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto,exec,utf8 0 0
/dev/mapper/cryptswap1 none swap sw 0 0
so after many researches I manually modified /etc/crypttab from:
cryptswap1 /dev/sda4 /dev/urandom swap,cipher=aes-cbc-essiv:sha256
to
cryptswap1 /dev/sda3 /dev/urandom swap,cipher=aes-cbc-essiv:sha256
swapon -a still refused to go on. I also launched update-initrafs -u listening to some answers here. I noticed Gparted gave /dev/sda3 as an unknown device with a red warning (used 0/2gb) so I formatted it to linux swap. Now I understood this was NOT something I should have done. After all anyway I rebooted the machine and all looks fine?:
$ sudo swapon -s
Filename Type Size Used Priority
/dev/mapper/cryptswap1 partition 2047996 0 -1
$ sudo cryptsetup status /dev/mapper/cryptswap1
/dev/mapper/cryptswap1 is active and is in use.
type: PLAIN
cipher: aes-cbc-essiv:sha256
keysize: 256 bits
device: /dev/sda3
offset: 0 sectors
size: 4096000 sectors
mode: read/write
$ free
total used free shared buffers cached
Mem: 6113568 1459488 4654080 0 47000 608280
-/+ buffers/cache: 804208 5309360
Swap: 2047996 0 2047996
$ sudo fdisk -l
Disk /dev/sda: 150.0 GB, 150039945216 bytes
60 testine, 12 settori/tracce, 407009 cilindri, totale 293046768 settori
Unità = settori di 1 * 512 = 512 byte
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Identificativo disco: 0xc554ad18
Dispositivo Boot Start End Blocks Id System
/dev/sda1 * 2048 253980671 126989312 7 HPFS/NTFS/exFAT
/dev/sda2 253980672 288950271 17484800 83 Linux
/dev/sda3 288950272 293046271 2048000 82 Linux swap / Solaris
Disco /dev/mapper/cryptswap1: 2097 MB, 2097152000 byte
255 testine, 63 settori/tracce, 254 cilindri, totale 4096000 settori
Unità = settori di 1 * 512 = 512 byte
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Identificativo disco: 0x96a661e8
The disk /dev/mapper/cryptswap1 does not contain a valid partition table (translated)
Does it seem correct or should I reformat the /dev/sda3 partition to unknown space as the installer had done? If yes, how?
Thanks for reading and helping, sorry for the long post.