<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On 31 Jul 2015, at 12:15, Richard W.M. Jones <<a href="mailto:rjones@redhat.com">rjones@redhat.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">On Wed, Jul 29, 2015 at 01:12:11PM +0100, Keith Roberts wrote:<br><blockquote type="cite"><blockquote type="cite"><rescue> cryptsetup open /dev/sda2 sysroot<br></blockquote>Enter passphrase for /dev/sda2: <br>[  355.726880] device-mapper: table: 253:0: crypt: unknown target type<br>[  355.727799] device-mapper: ioctl: error adding target to table<br>device-mapper: reload ioctl on temporary-cryptsetup-148 failed: Invalid argument<br>Failed to open temporary keystore device.<br>device-mapper: remove ioctl on temporary-cryptsetup-148 failed: No such device or address<br>...<br><blockquote type="cite"><rescue> <br></blockquote><br>Any ideas why I cannot open the LUKS encrypted partition please?<br></blockquote><br>It's a good question.  The error seems to indicate that the<br>dm-crypt.ko kernel module is not loaded, so I guess you could try<br>'modprobe dm-crypt' before the cryptsetup command.  (Also check your<br>*host* kernel supports dm-crypt).<br></blockquote><div><br></div><div><br></div><div>Hi Rich.</div><div><br></div><div>That was on an openSUSE 13.1 box using the default guestfs-tools package.</div><div><br></div><div>However on an openSUSE 12.3 box with the 3rd party OBS repo installed all went well.</div><div><span style="font-family: Courier; font-size: 12pt; font-style: oblique;"><br></span></div><div><span style="font-family: Courier; font-size: 12pt; font-style: oblique;"># unlock the encrypted root partition</span></div><div><div class="page" title="Page 2"><div class="layoutArea"><div class="column">
                                        <pre><span style="font-size: 12.000000pt; font-family: 'Courier'">><rescue> cryptsetup luksOpen /dev/sda2 luksdev
Enter passphrase for /dev/sda2:
[  901.852083] bio: create slab <bio-1> at 1
[  906.679106] bio: create slab <bio-1> at 1
</span></pre>
                                        <pre><span style="font-size: 12.000000pt; font-family: 'Courier'; font-style: oblique"># scan for all volume groups on encrypted LVM device
</span></pre>
                                        <pre><span style="font-size: 12.000000pt; font-family: 'Courier'">><rescue> lvm vgscan
  Reading all physical volumes.  This may take a while...
  Found volume group "system" using metadata type lvm2
</span></pre>
                                        <pre><span style="font-size: 12.000000pt; font-family: 'Courier'; font-style: oblique"># list logical volumes found
</span></pre>
                                        <pre><span style="font-size: 12.000000pt; font-family: 'Courier'">><rescue> lvm lvs
  LV   VG     Attr      LSize Pool Origin Data%  Move Log Copy%
</span></pre>
                                        <pre><span style="font-size: 12.000000pt; font-family: 'Courier'">Convert
  root system -wi------ 8.53g
  swap system -wi------ 1.31g
</span></pre>
                                </div>
                        </div>
                        <div class="layoutArea">
                                <div class="column"><p><span style="font-family: Courier; font-size: 12pt; font-style: oblique;"># activate the root LV so we can e2fsck it:</span></p></div></div></div><div class="page" title="Page 3">
                        <div class="layoutArea">
                                <div class="column">
                                        <pre><span style="font-size: 12.000000pt; font-family: 'Courier'">><rescue> lvm lvchange -ay /dev/system/root
</span></pre>
                                        <pre><span style="font-size: 12.000000pt; font-family: 'Courier'">We can now see that /dev/system/root is marked as active
with the -wi-a---- attribute:
</span></pre>
                                        <pre><span style="font-size: 12.000000pt; font-family: 'Courier'">><rescue> lvm lvs
  LV   VG     Attr      LSize Pool Origin Data%  Move Log Copy%
</span></pre>
                                        <pre><span style="font-size: 12.000000pt; font-family: 'Courier'">Convert
  root system -wi-a---- 8.53g
  swap system -wi------ 1.31g
</span></pre>
                                        <pre><span style="font-size: 12.000000pt; font-family: 'Courier'">Once the LV for /dev/system/root has been activated, we can then
run a filesystem check using e2fsck:
</span></pre>
                                        <pre><span style="font-size: 12.000000pt; font-family: 'Courier'">><rescue> e2fsck -vfy -C0 /dev/system/root
e2fsck 1.42.6 (21-Sep-2012)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
</span></pre>
                                        <pre><span style="font-size: 12.000000pt; font-family: 'Courier'">Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
</span></pre>
                                </div>
                        </div>
                </div></div></div>So I’m using that 12.3 box for fixing VM filesystems until I get the other issue on 13.1 sorted out.<div><br></div><div>Kind Regards,</div><div><br></div><div>Keith</div></body></html>