# encrypted system [ cancel ]

## idella4

This is network and security, so I try here.  I've bot to mount and enter an encrypted file system

	 did an install of a vm into a logical volume, trying something I hadn't done before.

Om impulse, I selected encrypted lvm partitioning.  The install was dome via a website.

It got to the second last step, then seized up.  Is a vm, though there's no reason why it can't be a full host system.

It pulled up just short of installing the bootloader.  So it can't be booted, no grub yet.

The install is virtually complete.  So mounting it, it's facing an lvm file  type, and it's encrypted.

If the install completed, it wouldn't be a problem.

I looked through man mount, and it only has this entry for mounting and encrypted system,

to use   -p and a file descriptor number that has the pass phrase.

How do you ascertain a file descriptor number?

I shouldn't have chosen it, but had no way of knowing it would fail to complete, and miss the essential install of grub.

If I can't mount it and finalize manually, the only thing is to reformat and repeat an install and lose the system.

A waste, it's complete enough to consider an installed system

man mount just doesn't even cite an lvm file type, and the instruction re the file descriptor just doesn't help.

A one line answer would resolve this.  How to mount an encrypted file system.

The passphrase I have, which is the essential element.

Anyone?

----------

## frostschutz

depends on the encryption method really, for example LUKS:

```

cryptsetup luksOpen /dev/encryptedpartition somename

<enter passphrase>

mount /dev/mapper/somename /somedir

```

----------

## idella4

well, it's a start.

```

gentoo64 ~ # cryptsetup luksOpen /dev/mapper/HyperVG01-lenny01--disk1 idella

Enter LUKS passphrase for /dev/mapper/HyperVG01-lenny01--disk1:

Command failed: /dev/mapper/HyperVG01-lenny01--disk1 is not a LUKS partition

```

Used man cryptsetup, and it seems totally restricted to the LUKS.  It isn't LUKS.

Where do I start to find out what type it is?  This is completely new to  me.

```

gentoo64 ~ # parted /dev/sdb

GNU Parted 2.2

Using /dev/sdb

Welcome to GNU Parted! Type 'help' to view a list of commands.

(parted) p

Model: ATA Maxtor 4D040H2 (scsi)

Disk /dev/sdb: 41.0GB

Sector size (logical/physical): 512B/512B

Partition Table: msdos

Number  Start   End     Size    Type     File system  Flags

 1      32.3kB  247MB   247MB   primary  ext3

 2      247MB   19.7GB  19.5GB  primary  ext3

 3      19.7GB  41.0GB  21.2GB  primary               lvm

```

```

gentoo64 ~ # cfdisk /dev/mapper/HyperVG01-lenny01--disk1

FATAL ERROR: Bad primary partition 1: Partition ends in the final partial cylinder

                         Press any key to exit cfdisk

```

Does mount really not know lvm partition types?.  

```

gentoo64 ~ # mount

/dev/mapper/HyperVG01-ubuntu01--disk1 on /mnt/ubuntu-disk type ext4 (rw)

```

is ok because it's regular ext4.  This encrypted one, how do I find out what type to mount it?

cryptsetup has no docs with it.

----------

## idella4

I followed the docs to mount this encrypted system, but I think the install perhaps corrupted it so it's unusable.  The lvm partition is /HyperVG01-lenny01--disk, alias Squeeze.

```

idella@squeeze:~$ sudo mount -t ext3 /dev/mapper/Squeeze /mnt/ftp

mount: wrong fs type, bad option, bad superblock on /dev/mapper/Squeeze,

       missing codepage or helper program, or other error

       In some cases useful info is found in syslog - try

       dmesg | tail  or so

```

```

idella@squeeze:~$ sudo umount /mnt/ftp

umount: /mnt/ftp: not mounted

idella@squeeze:~$ sudo mount -t auto /dev/mapper/HyperVG01-lenny01--disk1 /mnt/ftp

mount: /dev/mapper/HyperVG01-lenny01--disk1 already mounted or /mnt/ftp busy

idella@squeeze:~$ sudo mount  /dev/mapper/HyperVG01-lenny01--disk1 /mnt/ftp

mount: /dev/mapper/HyperVG01-lenny01--disk1 already mounted or /mnt/ftp busy

```

Using the tools I used to create it,  

```

idella@squeeze:~$ sudo cfdisk /dev/mapper/HyperVG01-lenny01--disk1

FATAL ERROR: Bad primary partition 1: Partition ends in the final partial cylinder

                            Press any key to exit cfdisk

```

this one is good, but not encrypted.

```

idella@squeeze:~$ sudo mount /dev/mapper/HyperVG01-ubuntu01--disk1 /mnt/tmp

mount: /dev/mapper/HyperVG01-ubuntu01--disk1 already mounted or /mnt/tmp busy

mount: according to mtab, /dev/mapper/HyperVG01-ubuntu01--disk1 is already mounted on /mnt/tmp

idella@squeeze:~$ ls /mnt/ftp

idella@squeeze:~$ ls /mnt/tmp

bin      etc      initrd.img      lost+found  proc     srv  var

boot     etc-mvd  initrd.img.old  media       root     sys  vmlinuz

boot-mv  exports  lib             mnt         sbin     tmp  vmlinuz.old

dev      home     lib64           opt         selinux  usr

```

forget it, too hard, just reformatted

Either the system is corrupted or I still don't have the right cipher to access it. Is it corrupt?

----------

