Results 1 to 5 of 5

Thread: [SOLVED] How to Restore to an Encrypted File System?

  1. #1
    Join Date
    May 2007
    Location
    South West England
    Beans
    97

    Question [SOLVED] How to Restore to an Encrypted File System?

    I need to restore a Hardy installation that I have backed up as a backup.tar.bz2 file. Making it a little more complicated is the fact that it is on a laptop using an encrypted file system of the type created by the "Alternate Install" CD.

    So far I have:
    - re-installed Hardy from the "Alternate" CD using the encrypted file system option, and the same password and parameters as the original install,
    - un-tarred the backup over the new installation, including /boot folder.

    On re-booting, it stalls at the point where it should ask for the encryption password. Running the recovery boot shows that the boot process looks for a specific UUID and doesn't find it - presumably it's looking for the original UUID but not finding it as there is now a new encrypted partition with a different UUID.

    So, how to fix this? Is there somewhere in the boot partition that holds the UUID? If so, where?
    Or is there a better procedure for restoring an encrypted installation?

    TIA

    PS - I needed to restore a complete backup to reinstate V8.04 after updating an Inspiron 1525 laptop to V8.10. I made the mistake of believing that it was ready for use. I was wrong as there were insurmountable problems with webcam video and sound level from microphones, etc.
    Last edited by jbrice; December 16th, 2008 at 01:37 PM. Reason: Add a warning PS to others...

  2. #2
    Join Date
    Jun 2006
    Location
    Texas
    Beans
    3,930
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: How to Restore to an Encrypted File System?

    Just a wild guess since I don't use encryption. Boot with a live CD and find your partitions UUID by:
    Code:
    sudo blkid
    Now fix the UUID's in /boot/grub/menu.lst and /etc/fstab.
    UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things. -- Doug Gwyn
    SystemRescueCd | Dual Boot | psychocats | FAQ

  3. #3
    Join Date
    May 2007
    Location
    South West England
    Beans
    97

    Re: How to Restore to an Encrypted File System?

    Thanks for the suggestions.

    sudo blkid
    OK - that gives me the UUIDs


    Now fix the UUID's in /boot/grub/menu.lst and /etc/fstab.
    The grub entries don't use UUIDs, and /etc/fstab is hidden inside the encrypted partition and so couldn't cause a problem at this point in the boot sequence.

  4. #4
    Join Date
    Jun 2006
    Location
    Texas
    Beans
    3,930
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: How to Restore to an Encrypted File System?

    Grub has to tell the Kernel where the / (root partition) of the files system is. This is done with the root option.

    either by UUiD

    Code:
    kernel /boot/vmlinuz-2.6.24-22-generic root=UUID=fdd1413c-1ad8-4353-be07-dcda96b8a21d ro
    or by device
    Code:
    kernel        /boot/vmlinuz-2.6.24-22-generic root=/dev/sda2 ro
    in either case make sure its pointing to the correct partition.

    BTW: I am assuming you are getting to the GRUB menu when you boot and it hanging after you select Ubuntu. is that correct? Don't use encryption so don't know when it asks for the encryption keu.
    Last edited by louieb; December 16th, 2008 at 02:10 AM.
    UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things. -- Doug Gwyn
    SystemRescueCd | Dual Boot | psychocats | FAQ

  5. #5
    Join Date
    May 2007
    Location
    South West England
    Beans
    97

    Thumbs down Re: How to Restore to an Encrypted File System?

    Thanks again.

    Yes, it is getting as far as the GRUB menu, but the boot code is of the form:
    kernel /boot/vmlinuz-2.6.24-22-generic root=/dev/mapper/machinename-root
    So unable to do clever stuff like changing the UUID in the menu.lst. Also, as the encrypted partition is not ext2/3 format, I can't use tune2fs to change the UUID to the one expected in the boot code.

    I suspect that the clever stuff - including the expected UUID - is hidden in a customised initrd file. However this is all stretching my knowledge of Linux beyond its elastic limit!

    Unfortunately this still leaves me with an unusable laptop.

    Later....
    I think I have done it - here are the steps for anyone else in this position:

    1) Reinstall Ubuntu from "Alternate" CD using same parameters (esp. machine name) as backed-up installation,
    2) Log into new installation,
    3) Update the new installation (so that both this and the backed-up system are using same version Linux kernal),
    4) Copy the contents of the /boot folder, /etc/fstab and /etc/crypttab onto an external medium such as a memory stick,
    5) Over-write the installation with the backed-up system,
    6) If they have been over-written by the restore operation, replace contents of the /boot folder, /etc/fstab and /etc/crypttab with the copies from the external medium (these files contain reference to hard disk UUIDs which will have changed after the re-install),
    7) Reboot, and you should now be able to log into your restored installation.

    I would any constructive comments on the above, or easier ways of backing-up and restoring an encrypted Ubuntu installation.
    Last edited by jbrice; January 9th, 2009 at 03:21 PM. Reason: Successful re-install! Later - added cryttab to list to be copied.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •