1

I had a good-working system. Cent OS 6. But after I made a reboot luks-partition has been unmounted. And our system administrator have a weekends now :(

Please help me to mount a luks partition again.

I know the path to encrypted file and password.

System administrator's records says: "Encrypted file located at /path/file and mount to /crypt. Password is xxxxx" That's all.

Before reboot the server I made a records of 'mount' command, the related partition was:

/dev/mapper/crypt_fun /crypt ext4 rw,relatime,barrier=1,data=ordered 0 0

Now I try this commands:

cryptsetup luksOpen /dev/loop0 /path/file

type a password

mount /path/file /crypt

But nothing works good :( Please help me.

Vasvas
  • 13
  • 1
  • 4

1 Answers1

4

Given the above, my guess is that you would need to do something like this.

  • First make your file accessible via a loopback device
    • losetup /dev/loop/0 /path/file
  • Open the loopback device to crypt_fun
    • cryptsetup luksOpen /dev/loop/0 crypt_fun
  • Mount it
    • mount /dev/mapper/crypt_fun /crypt
Zoredache
  • 130,897
  • 41
  • 276
  • 420
  • You can also skip to step 2 if you simply supply `/path/file` and `crypt_fun` it will automatically handle the loop device and creating the mapper, then you can proceed to step 3. – dragon788 Nov 15 '18 at 20:47
  • @dragon788 yeah, I think when I was answering this back in 2013, I was using old at the time distro that wasn't automatically creating loop devices. – Zoredache Nov 16 '18 at 00:17