Cryptsetup block info problem

Hello, i was using cryptsetup processes without any problem before. I changed the usb memory and encrypted it again. But after the encryption, the cryptsetup open command does not show dev/ mapper/disk1 in block info.

That's why problem with mount command,

How to fix this, thanks for your help.

1 Like

Usually you are mounting device' partitions like sda1 and not sda directly. Same for creating/opening a cryptdevice. I would assume the error there.

But why does cryptsetup open command not add /dev/mapper/disk1 to block info command?

Because cryptsetp device is not a block device. If you want to see ("virtual") devices also use e. g.: "fdisk -l"

You should elaborate what you want to achive exactly. And as mounting from /dev/mapper/disk1 is failing I would check if your filesystem is supported or you have created one on disk1.

I understand, but that's not exactly the problem, "cryptsetup open" command creates the encrypted device virtually on /dev/mapper/ ... directory, no problem here. The same command adds block info command /dev/mapper/ ... directory, but it doesn't show up in block info command

I see that the cryptdevice is open and mounting is failing with "invalid argument".

So what is "fdisk -l" or cat /proc/partitions actually showing? block is not showing all!

1 Like

Works for me:

dd if=/dev/zero of=/crypto bs=1M count=100
cryptsetup luksFormat /crypto
cryptsetup luksOpen /crypto open
mkfs.ext4 /dev/mapper/open
mount /dev/mapper/open /mnt
block info

See also: https://openwrt.org/docs/guide-user/storage/disk.encryption

2 Likes

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.