PDA

View Full Version : lvm swap parition encrypted by luks doesn't boot



ethanw
2016-05-24, 01:15
The problem is that I can boot into /boot (GRUB2 and unencrypted) and / (/dev/sda6), but swap (/dev/sda7)
It didn't even ask me the paraphrase to unlock swap partition.

lsblk -l


NAME FSTYPE LABEL UUID MOUNTPOINT
sda
├─sda1 ntfs System Reserved aaaa
├─sda2 ntfs bbbb
├─sda3 ntfs FTW cccc
├─sda4
├─sda5 ext2 dddd /boot
├─sda6 crypto_LU eeee
│ └─sda6_crypt
│ ext4 xxxx /
└─sda7
sr0


/etc/crypttab


sda6_crypt UUID=xxxx none luks
sda7_crypt UUID=xxxx none luks,swap


fdisk -l


Disk /dev/sda: 698.7 GiB, 750156374016 bytes, 1465149168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x6d51c383

Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 206847 204800 100M 7 HPFS/NTFS/exFAT
/dev/sda2 206848 307202047 306995200 146.4G 7 HPFS/NTFS/exFAT
/dev/sda3 307202048 512002047 204800000 97.7G 7 HPFS/NTFS/exFAT
/dev/sda4 512004094 1465147391 953143298 454.5G 5 Extended
/dev/sda5 512004096 512489471 485376 237M 83 Linux
/dev/sda6 512491520 1449598975 937107456 446.9G 83 Linux
/dev/sda7 1449601024 1465147391 15546368 7.4G 82 Linux swap / Solaris

Partition 4 does not start on physical sector boundary.


Disk /dev/mapper/sda6_crypt: 446.9 GiB, 479796920320 bytes, 937103360 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


/dev/disk/by-uuid$ ls -al


total 0
drwxr-xr-x 2 root root 160 May 24 13:46 .
drwxr-xr-x 6 root root 120 May 24 13:46 ..
lrwxrwxrwx 1 root root 10 May 24 17:46 aaaa -> ../../dm-0
lrwxrwxrwx 1 root root 10 May 24 17:46 bbbb -> ../../sda2
lrwxrwxrwx 1 root root 10 May 24 17:46 cccc -> ../../sda3
lrwxrwxrwx 1 root root 10 May 24 17:46 dddd -> ../../sda6
lrwxrwxrwx 1 root root 10 May 24 17:46 eeee -> ../../sda1
lrwxrwxrwx 1 root root 10 May 24 17:46 ffff -> ../../sda5


swapon -s





df


Filesystem 1K-blocks Used Available Use% Mounted on
udev 1871648 0 1871648 0% /dev
tmpfs 377036 6104 370932 2% /run
/dev/mapper/sda6_crypt 461068320 19845720 417778632 5% /
tmpfs 1885172 48952 1836220 3% /dev/shm
tmpfs 5120 4 5116 1% /run/lock
tmpfs 1885172 0 1885172 0% /sys/fs/cgroup
/dev/sda5 235021 71958 150929 33% /boot
tmpfs 377036 24 377012 1% /run/user/1000


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/sda6_crypt / ext4 errors=remount-ro 0 1
# /boot was on /dev/sda5 during installation
UUID=aaaa /boot ext2 defaults 0 2
/dev/mapper/sda7_crypt none swap sw 0 0


Did I miss anything so that everybody won't give their hands on my thead?
Should I do anything?

rawkahn
2017-10-06, 02:14
Im having the same problem. Did you ever figure out a solution?