4

I was battling with setting up a Mint install on an encrypted hard-drive, and I think I partially succeeded. But I cannot boot the system because some configuration is not correct. I have no idea how to fix it now.

The rough guidelines I followed was along the lines of http://blog.andreas-haerter.com/2011/06/18/ubuntu-full-disk-encryption-lvm-luks.sh

The differences are that I partitioned with GParted. I'm also dual-booting with Windows, and I'm not using extra partition for /home.

  • vg is on extended partition /dev/sda4, within logical partition /dev/sda5

  • /boot in on primary partition /dev/sda3

  • bootloader is on /dev/sda

The install went good, I can mount the file-system as in script, from live DVD, but the script in chroot part failed, and the system doesn't boot...

Can anyone tell me what do I have to do to allow boot to mount the encrypted partition?

Is it enough to edit fstab and crypttab only? They seem to reside on the encrypted partition, so not readable by boot...

If it's enough, what they should look like? Everything seems very confusing, and I cannot find a good source I could read about the problem...

UPDATES:

fdisk -l /dev/sda

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      206847      102400    7  HPFS/NTFS/exFAT
/dev/sda2          206848   209715199   104754176    7  HPFS/NTFS/exFAT
/dev/sda3       209715200   210763775      524288   83  Linux
/dev/sda4       210763776   625141759   207188992    5  Extended
/dev/sda5       210765824   567281663   178257920   83  Linux
/dev/sda6       567283712   625141759    28929024    7  HPFS/NTFS/exFAT

pvs

PV         VG   Fmt  Attr PSize   PFree
/dev/dm-0  mint lvm2 a-   170.00g    0 

pvscan

PV /dev/dm-0   VG mint   lvm2 [170.00 GiB / 0    free]
Total: 1 [170.00 GiB] / in use: 1 [170.00 GiB] / in no VG: 0 [0   ]

vgscan

Reading all physical volumes.  This may take a while...
Found volume group "mint" using metadata type lvm2

vgs

VG   #PV #LV #SN Attr   VSize   VFree
mint   1   2   0 wz--n- 170.00g    0 

mount /dev/mapper/mint-root /mnt + cat /mnt/etc/fstab

# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    nodev,noexec,nosuid 0       0
/dev/mapper/mint-root /               ext4    errors=remount-ro 0       1
# /boot was on /dev/sda3 during installation
UUID={uuidhre} /boot           ext4    defaults        0       2
/dev/mapper/mint-swap none            swap    sw              0       0

cat /mnt/etc/crypttab - manually edited

# <target name> <source device>     <key file>  <options>
lvm_crypt /dev/sda5 none luks

The tutorial for the reference in readable format: http://blog.andreas-haerter.com/2011/06/18/ubuntu-full-disk-encryption-lvm-luks

SOLUTION:

The post install update doesn't work in tutorial. You have to create the crypttab file manually, or fix it up before calling initramfs.

I called everything except intitramfs, opened the /mnt/etc/crypttab with nano, patched the file, and then called chroot with initramfs only. Everything worked smoothly this way.

5
  • @Gilles: I updated the post.
    – Coder
    Commented Jul 19, 2012 at 6:07
  • What happens when you try to boot? Do you get a passphrase prompt? Where does the boot process stop, with what error messages? Commented Jul 19, 2012 at 7:20
  • @Gilles: cryptsetup: evms_activate is not available
    – Coder
    Commented Jul 19, 2012 at 7:54
  • I don't think that message matters, EVMS is an obsolete technology and not something you might be using accidentally. What else do you see? Do you get a prompt? Commented Jul 19, 2012 at 8:20
  • I just fixed the error by deleting partitions, recreating LVM, reinstalling the OS and doing a little change in chroot script that was used in tutorial. I will update the post in a minute. Thanks everyone for clearing few things up! And by the way, Mint is amazing, IMHO, cleanest and neatest GUI I've ever seen on any OS, including Windows and Mac!
    – Coder
    Commented Jul 19, 2012 at 8:25

1 Answer 1

3

There's a evident wrong configuration:

lvm_crypt /dev/sda5 none luks

You decrypted the volume and named it lvm_crypt while mounting /dev/mapper/mint-root

Were you asked to input the password during boot ?

Also, did you updated initramfs afterwards ? Because this crypttab need to be embedded since it's for root partition.

EDIT

mint_root /dev/sda5 none luks

And chroot inside, do update-initramfs -u will fix it.

2
  • This was a best guess attempt after update script failed. No, if I boot from /dev/sda there is an error, but I cannot remember what error. I created this file with a hand directly under /mnt/etc/crypttab. How does it have to look?
    – Coder
    Commented Jul 19, 2012 at 6:36
  • Yeah, that script that generated the crypttab was wrong, but I missed something after fixing it, and initramfs didn't helped (I think I forgot to mount the boot from /dev/sda3). So I recreated/reinstalled everything, and by modifying crypttab before initramfs, everything works now!
    – Coder
    Commented Jul 19, 2012 at 8:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .