2

Wanting to make sure I'm doing this right. I get the warning on both /dev/sdX and "/dev/mapper/luks-xxxx-xx. . ." when I run fdisk -l. This is what I did to encrypt it:

cryptsetup -y -v luksFormat /dev/sdX
cryptsetup luksOpen /dev/sdX diskX
sudo mkfs.ext4 /dev/mapper/diskX

It was encrypted before so I didn't bother using dd. It also shows up as unallocated in gparted, which may be due to the partition table. I don't know. Also I've been mounting it using PCManFM instead of luksOpen because it's easier.

Anything I'm doing wrong?

1

You are not doing anything wrong. This behavior in fdisk and gparted is expected since you formatted the entire raw device as a LUKS volume, so there is no partition table on the device. The partition table normally resides at the beginning of the device (and also the end of the device for GPT), but it is not strictly necessary if the whole device will be encrypted anyway.

However, I prefer to have a partition table even on devices containing only a single volume (whether it be LUKS or a filesystem) for the following reasons:

  • Standard tools will recognize that there is an existing partition even if they do not recognize the contents inside the partition, so they are less prone to accidentally overwrite the contents.
  • More flexibility for resizing in the future, in case you want to shrink the volume to create space for another partition.
| improve this answer | |

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.