1

I made one big luks device and re-used it on my debian install, then I ran into some boot problems and I need to access the filesystem.

The problem is, I decrypt the luks device and when I try to mount the filesystem I can't. It happened on debian rescue and another system rescue cd. What am I missing here? Seems something simple.

root@sysresccd /root % mkdir /media/linux
root@sysresccd /root % cryptsetup luksOpen /dev/sda2 linux
Enter passphrase for /dev/sda2: 
root@sysresccd /root % fdisk -l

Disk /dev/sda: 1000.2 GB, 1000203804160 bytes, 1953523055 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 identifier: 0x00002616

/dev/sda1   *        2048      616447      307200   83  Linux
/dev/sda2          616448  1851971583   925677568   83  Linux
/dev/sda3      1851971584  1953521663    50775040    7  HPFS/NTFS/exFAT


...... **Luks \/**

Disk /dev/mapper/linux: 947.9 GB, 947891732480 bytes, 1851351040 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 identifier: 0x0005063d

        Device Boot      Start         End      Blocks   Id  System
/dev/mapper/linux1            2048    29102079    14550016   83  Linux
/dev/mapper/linux2        29102080  1851351039   911124480   83  Linux

There are 2 file systems under this luks device: / and /home

root@sysresccd /root % mount /dev/mapper/linux1 /media/linux 
mount: special device /dev/mapper/linux1 does not exist

Actually, when I press tab to auto complete there is no linux1 and linux2. What's wrong? I've mounted lvm's this way before and nothing likenthis happened.

  • 1
    I assume you did an ls -a /dev/mapper to make sure? also, you talk about LUKS, but then you mention LVM. which one is it? these are not the same thing. – strugee Oct 24 '13 at 2:55
  • No no, there is no lvm in this setup, i was talking about past installations/mounts. I think i didnt.. i tought i was targeting the right devices and was failing because of some module. – Roberto Oct 25 '13 at 17:30
3

It's unusual to have partitions on a LUKS device. The partition device may also be called linuxp1. If it's not there, you can use one of partx, kpartx, or losetup --partscan to make partition devices available. You can also map it manually using losetup --offset.

  • I gave up and started another install, but thanks anyway, may be usefull in the future. I remember seeing linuxp1 when the boot failed, then i tought about fstab and initram. About partitions, i could be wrong, i dont know too much about luks and dm crypt thing, but, everytime i did setup a encrypted install, i could only make 1 ´´partition´´ per luks, if that make sense to you. This time was different, i activated the existing encrypted device manually and could make more than one. – Roberto Oct 25 '13 at 16:52
  • Actually the boot failed because it couldnt find /dev/mapper/linuxp1 if im not mistaken. Well, too late, thank guys haha. – Roberto Oct 25 '13 at 17:27
  • As I said, it's unusual to have partitions on a LUKS device in the first place. Unless you're using this LUKS device as a VM container, you'd usually go for LVM there. – frostschutz Oct 25 '13 at 17:29
  • I used to do this, then i tought it was another layer of risk to deal when power failures happen, or im wrong? Happened sometimes and no problems, but who knows. – Roberto Oct 25 '13 at 17:34
  • @Roberto what do you mean by "this"? – strugee Oct 25 '13 at 20:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.