JP Vossen on 1 Nov 2009 12:44:21 -0800


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Partition image/restore on Encrypted LVM vg


> Date: Sat, 31 Oct 2009 23:09:49 -0400
> From: Lee Marzke <lee@marzke.net>
> 
> I'd like to try upgrading my Ubuntu to the new 9.10 release but I need a way
> to revert.   Normally I'd copy the partition with 'dd' or other tools, 
> but in this case I've got (root, swap, home) in an encrypted vg0
> 
> I could create the image in runlevel 1, but how would I be able to
> restore it if needed? I think Knoppix will load an encrypted partition, but
> only if it contains a single volume, not an LVM volume group.

I just did that on my Mini9, which has a similar setup (clear /boot, 
encrypted LVM for the rest).  Any imager should be able to do it, but it 
will require a 'dd' image of the entire thing, since by definition the 
encrypted stuff is a) unreadable outside itself and b) random and thus 
uncompressible.

That didn't matter for the Mini, since it only has 16G SSD.  It could 
get old for large disks though.

I first attempted to use aa1backup 
(http://macles.blogspot.com/2008/12/acer-aspire-one-aa1backup.html ) on 
a 40G drive in the USB enclosure .  I booted the USB drive and tried a 
full backup but got "fatal error occurred - slax data not found" . 
Various t-shooting didn't help, but I didn't spent that much time on it.

Then I tried Clonezilla ZIP to USB , which worked, but as noted did a 
full dd of the entire SSD since it couldn't get into the crypt-fs stuff.
* wget 
'https://sourceforge.net/projects/clonezilla/files/clonezilla_live_alternative/OldFiles/20090812-jaunty/clonezilla-live-20090812-jaunty.zip/download' 

* Follow: http://clonezilla.org/clonezilla-live/liveusb.php
   - unzip clonezilla-live-20090812-jaunty.zip -d /media/disk-1
   - cd /media/disk-1/utils/linux/
   - bash makeboot.sh /dev/sdb2

I found the Clonezilla interface a tad clunky, but it had a lot of 
backup and restore options and it looks like it would be great for 
scripted use.  It can write to disk or image, as you might expect, so 
depending on your setup writing a copy of your disks to a new disk might 
be easiest.

I did not test my backup image, which is of course a unacceptible in 
real production, but I had also copied imporant stuff elsewhere [1], so 
I didn't care that much.  I *did* end up using Clonezilla to restore the 
image, which worked fine, since my first upgrade attempt failed 
miserably (I think I was too early by about a week).  The second attempt 
"worked" though it was not seamless enough for newbies, and I had/have 
some lingering issues that may be related to the ext4 driver.  Note the 
mini uses the LPIA architecture, not x86 or x64, so it may be less 
supported/tested/whatever.

Good luck, let us know,
JP
______________________________________________
[1] Mounted the same 40G USB drive and:
sudo cp -a /boot/ /etc/ /home/ /root/ /var/ /media/disk/mini9/
----------------------------|:::======|-------------------------------
JP Vossen, CISSP            |:::======|      http://bashcookbook.com/
My Account, My Opinions     |=========|      http://www.jpsdomain.org/
----------------------------|=========|-------------------------------
"Microsoft Tax" = the additional hardware & yearly fees for the add-on
software required to protect Windows from its own poorly designed and
implemented self, while the overhead incidentally flattens Moore's Law.
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug