Finding Encrypted LVM Physical Volumes: Untested Solution

Charles Curley charlescurley at
Tue Feb 12 10:47:35 MST 2013

On Tue, 12 Feb 2013 10:09:40 -0700
Charles Curley <charlescurley at> wrote:

> Last year I used LVM and encrypted (dm-mod) it. This year, I did the
> same. I can boot to either Y or Y-1, but which ever one I boot too, I
> can't read the other.

Got it. I finally hit the right terms to search the net on. Based on I
came up with a script for the purpose. I haven't tested it, but this
should do what I need:

    # A script to mount last year's drive on this one. Based on

    # The target partition

    # The volume group name

    # Encryption....
    cryptsetup luksOpen $part crypt1

    # scan for new volume groups
    vgscan --mknodes

    # Activate the volume groups
    vgchange -ay

    # Create mount points as needed.
    mkdir -p /mnt/$vgName

    # Mount 'em up
    mount -r /dev/mapper/dzur2012-root /mnt/$vgName/
    mount -r /dev/mapper/dzur2012-home /mnt/$vgName/home

I'll test that the next time I reboot. As this is Debian stable, that
my not be until next year. :-)


Charles Curley                  /"\    ASCII Ribbon Campaign
Looking for fine software       \ /    Respect for open standards
and/or writing?                  X     No HTML/RTF in email    / \    No M$ Word docs in email

Key fingerprint = CE5C 6645 A45A 64E4 94C0  809C FFF6 4C48 4ECD DFDB

More information about the PLUG mailing list