How to access encrypted LVM filesystem in rescue mode - ext3 filesystem cannot mount

On 2014-01-13 13:36, rhett1butler wrote:

> Here are the links to the pictures showing that Truecrypt has no trouble
> with handling the ext3 format, where some part of Linux openSUSE 13.1
> fails.
>
> http://www.susepaste.org/64897563
> http://www.susepaste.org/24957085
> http://www.susepaste.org/18427435
>
> Dolphin File Manager is just the messenger of the bad news, not the
> culprit.

Ok…

Well, I’m not knowledgeable about truecrypt (I use LUKS), but just try
the suggestions I wrote about. Might help :slight_smile:


Cheers / Saludos,

Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)

Running


segovia:/ # file -s /dev/sda3                                                                                                            
/dev/sda3: data                                                                                                                          
segovia:/ # file -s /dev/sda2
/dev/sda2: Linux rev 1.0 ext3 filesystem data, UUID=efec197d-b9c8-4e1b-aec0-be1ab5e6f4bb (needs journal recovery) (large files)          
segovia:/ #                                                                                                                  

shows that in sda2 there are plenty of files left over from yesterday’s temporary openSUSE 13.1 installation (“caceres”) for my rescue operation. I might want to clean up that part of the disk by zeroing the first 1 MB of the partition using the dd(1) command.

After regaining access to sdb (“segovia”, LVM, LUKS encrypted), I got rid of the “caceres” installation by deleting the boot flag on sda2, then deleting sda2 itself, both done from sdb (“segovia”). With this, the other partitions sda5, sda6, and sda7 disappeared automatically. Before deleting the temporary “caceres” installation, sda looked like this:


   caceres:~ # fdisk /dev/sda
 Welcome to fdisk (util-linux 2.23.2).                                                                                    
                                                                                                                          
 Changes will remain in memory only, until you decide to write them.                                                      
 Be careful before using the write command.                                                                               
 Command (m for help): p
  Disk /dev/sda: 1000.2 GB, 1000204886016 bytes, 1953525168 sectors

 Units = sectors of 1 * 512 = 512 bytes
 Sector size (logical/physical): 512 bytes / 512 bytes
 I/O size (minimum/optimal): 512 bytes / 512 bytes
 Disk label type: dos
 Disk identifier: 0x000841a6
    Device Boot      Start         End      Blocks   Id  System

 /dev/sda1               2   351824649   175912324    7  HPFS/NTFS/exFAT
 /dev/sda2   *   351825920   937760767   292967424    f  W95 Ext'd (LBA)
 /dev/sda3      1523699712  1953525167   214912728   83  Linux
 /dev/sda4       937762181  1523699711   292968765+  a6  OpenBSD
 /dev/sda5       351827968   356048895     2110464   82  Linux swap / Solaris
 /dev/sda6       356050944   397993983    20971520   83  Linux
 /dev/sda7       397996032   439939071    20971520   83  Linux

   
Partition table entries are not in disk order
  
 Command (m for help): d
 Partition number (1-7, default 7): 2
 Partition 2 is deleted

 Command (m for help): p

 Disk /dev/sda: 1000.2 GB, 1000204886016 bytes, 1953525168 sectors
 Units = sectors of 1 * 512 = 512 bytes
 Sector size (logical/physical): 512 bytes / 512 bytes
 I/O size (minimum/optimal): 512 bytes / 512 bytes
 Disk label type: dos
 Disk identifier: 0x000841a6

    Device Boot      Start         End      Blocks   Id  System
 /dev/sda1               2   351824649   175912324    7  HPFS/NTFS/exFAT
 /dev/sda3      1523699712  1953525167   214912728   83  Linux
 /dev/sda4       937762181  1523699711   292968765+  a6  OpenBSD
 

 Partition table entries are not in disk order
 

 Command (m for help):  


sda2 gone. Then I re-created a 4th partition to make full use of all disk space and avoid leaving any space idle.

The idea is to have sda as a slave drive, containing only data, no operating system. I have a third drive (“sdc”) which has a dual-boot configuration with Windows 7 and OpenBSD on it. From there, I can also access sda as pure data disk. For this configuration, I did not use the GRUB facility, but Windows 7 “bcdedit.exe” on the command line, which worked fine. Bob Cromwell on
www.cromwell-intl.com
has an excellent tutorial on how to do it.

Last month I was thinking whether I should put Linux onto this third drive (sdc), but half way into re-partitioning Linux asked me where to put the swap partition, and being limited to four primary partitions on this disk and my limited skills in UNIX I didn’t want to push my luck and shoot holes into my working Windows7+OpenBSD configuration that might take me a few days to re-create, so I might do that later when I have gained more confidence in moving around the ‘house’ and understand GFT, the GRUB and GRUB2 facilities and the differences between UEFI and MBR better.

I like the OpenBSD environment, less polished than openSUSE+KDE, but far less bloat also, which I find appealing.

On 2014-01-13 14:16, rhett1butler wrote:
>
> Running
>
>
> Code:
> --------------------
>
> segovia:/ # file -s /dev/sda3
> /dev/sda3: data
> segovia:/ # file -s /dev/sda2
> /dev/sda2: Linux rev 1.0 ext3 filesystem data, UUID=efec197d-b9c8-4e1b-aec0-be1ab5e6f4bb (needs journal recovery) (large files)
> segovia:/ #
>
> --------------------

Well, you see there why sda3 can not be mounted: it is not an ext3
filesystem. It can be an encrypted partition, though, but one that has
to be decrypted first, and then mounted. This is just an speculation of
mine, can’t say if it is your case. You using truecrypt confuses things
for me.

> shows that in sda2 there are plenty of files left over from yesterday’s
> temporary openSUSE 13.1 installation (“caceres”) for my rescue
> operation. I might want to clean up that part of the disk by zeroing the
> first 1 MB of the partition using the dd(1) command.

Well, you can do that, but it is not needed. just reformatting a
partition is normally enough.

Again speculating, maybe truecrypt still can recognize that there is an
encrypted something in there, with just a format. I don’t know.

(A format in Linux just erases some sectors at the start of the disk and
creates some empty structures to locate files. The files that were there
are still there, but nobody knows where. It is possible to recover
“some” of them by scanning the entire partition and reconstructing the
resulting jigsaw. Can take days, and results vary from wonderful to
disastrous)

(A dd erase of the start does not destroy the files, either, just they
are not locatable - similar to a format as above situation)

> After regaining access to sdb (“segovia”, LVM, LUKS encrypted), I got
> rid of the “caceres” installation by deleting the boot flag on sda2,
> then deleting sda2 itself, both done from sdb (“segovia”). With this,
> the other partitions sda5, sda6, and sda7 disappeared automatically.

Yes, if you delete the “extended” partition, all the logical partitions
inside (sda5 onwards) dissapear.

> Before deleting the temporary “caceres” installation, sda looked like
> this:


>
>
> sda2 gone. Then I re-created a 4th partition to make full use of all
> disk space and avoid leaving any space idle.

Ok.

> The idea is to have sda as a slave drive, containing only data, no
> operating system. I have a third drive (“sdc”) which has a dual-boot
> configuration with Windows 7 and OpenBSD on it. From there, I can also
> access sda as pure data disk. For this configuration, I did not use the
> GRUB facility, but Windows 7 “bcdedit.exe” on the command line, which
> worked fine. Bob Cromwell on
> ‘www.cromwell-intl.com’ (http://www.cromwell-intl.com)
> has an excellent tutorial on how to do it.

Ok.

Yes, W7 with standard partitions can use bcdedit to handle booting of
other systems. W8 with GPT partitions can not.

> Last month I was thinking whether I should put Linux onto this third
> drive (sdc), but half way into re-partitioning Linux asked me where to
> put the swap partition, and being limited to four primary partitions on
> this disk and my limited skills in UNIX I didn’t want to push my luck
> and shoot holes into my working Windows7+OpenBSD configuration that
> might take me a few days to re-create, so I might do that later when I
> have gained more confidence in moving around the ‘house’ and understand
> GFT, the GRUB and GRUB2 facilities and the differences between UEFI and
> MBR better.

That’s very sensible :slight_smile:

> I like the OpenBSD environment, less polished than openSUSE+KDE, but far
> less bloat also, which I find appealing.

Use what works for you and you like best. We are not distro fanatics
here at openSUSE, which is something I appreciate :slight_smile:


Cheers / Saludos,

Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)