In a previous install of ubuntu, my lvm encryption pw was no longer recognized and I lost it all! This occurred on a dual boot setup on a macbook pro 2010, from when I did a drive repair from within mac OS X and subsequently reset the pram. I gave on ubuntu dual boot for a while.

Recently however, I decided to try once again and installed ubuntu 15.04 on a partition of the macbook pro 2010 with the following configuration: lvm partition encryption mount point at /, 1gig unencrypted mount point /boot.

It loads fine now although I am working on configuring an encrypted swap partition (I posted it posted here: Add a swap partition post-install 15.04). The only noticible glitch appears to be a distorted screen on load-up where it should ask for the lvm encryption pass however it displays as scrambled white mesh. I can however input my lvm encryption pass here which forwards me to login to ubuntu as per normal.

My main concern is that if I run a drive repair from within my osx parition or if my ram is reset, I will lose the lvm encryption key and no longer be able to access my ubuntu partition as happened earlier on a previous install!

Any suggestions or ideas from the community here?


AFAIK, a PRAM/NVRAM reset should not affect the encryption key. You said you did a "drive repair from within mac OS X," and that action might cause problems, but that goes beyond disk encryption -- if you force a utility that doesn't understand LVM or Linux filesystems to "repair" a Linux filesystem or Linux LVM partition, the result is likely to be data corruption, whether or not encryption is used. Encryption will make data recovery from such an event much harder to do, though.

Ordinarily, I'd expect OS X's utilities to not try to "repair" a Linux filesystem or LVM partition they don't understand. They might do so if your partition type code is wrong, though. Linux partitions should be of type 0FC63DAF-8483-4772-8E79-3D69D8477DE4 (no flag set in recent versions of GParted or parted, type code 8300 in gdisk). There's the related question of hybrid MBRs. IMO, it's best to install Linux without a hybrid MBR on Macs. You can check this detail with gdisk:

$ sudo gdisk -l /dev/sda
GPT fdisk (gdisk) version 1.0.0

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

This example shows a non-hybrid MBR, as identified by the MBR: protective line; a hybrid MBR will show MBR: hybrid instead. You can convert from hybrid to protective by saving the partition table in parted or GParted or by using the n option on gdisk's experts' menu and then saving the change via w (that is, x -> n -> w).

Be aware, though, that if you're using a hybrid MBR, you may be booting Ubuntu in BIOS/CSM/legacy mode, and removing the hybrid MBR will render the Mac unable to boot in that mode. This will necessitate installing an EFI-mode boot loader. (You can check your Ubuntu boot mode by looking for a directory called /sys/firmware/efi -- if it's present, you've booted in EFI mode; if it's absent, you've booted in BIOS/CSM/legacy mode.) Also, if you're triple-booting with Windows, you must normally have a hybrid MBR. Thus, you should not blindly remove the hybrid MBR, if one is present; instead, you should first assess whether you need it and then delete it only if you don't or if you have a plan to update your boot loader(s) appropriately.

Beyond this, I agree with user68186: You should back up your data to an external disk or other external media. Risks to data loss go far beyond encryption problems and include things like physical loss of your laptop, catastrophic failure of your hard disk or SSD, accidental catastrophic mis-use of dd or other disk utilities, and so on.

  • Yes, I can now recall adding a flag in gparted. Thanks for the detailed answer! – gordon50 May 28 '15 at 20:41

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.