New hdd, no data; using as storage hdd only - no os. I just encrypted my hdd and it has no partition. If I do the following, will the encryption be deleted? The size of the hdd is too large for "fdisk". Below is an example of someone else trying to do the same thing with their ouput afterwards.

I encrypted using the following format: 
cryptsetup luksFormat /dev/sdX
cryptsetup luksOpen /dev/sdX external_disk
mkfs /dev/mapper/external_disk
cryptsetup luksCLose external_disk 

I created a partition using the folling:

sudo parted /dev/sda

Output: GNU Parted 2.3 Using /dev/sda Welcome to GNU Parted! Type 'help' to view a list of commands. (parted)

Creates a new GPT disklabel i.e. partition table:

mklabel gpt

Next, set the default unit to TB, enter:

unit TB

To create a 2TB partition size, enter:

mkpart primary 0.00TB 2.00TB

To print the current partitions, enter:


Sample outputs:

Model: ATA ST33000651AS (scsi) Disk /dev/sda: 2.00TB Sector size (logical/physical): 512B/512B Partition Table: gpt Number Start End Size File system Name Flags 1 0.00TB 2.00TB 2.00TB ext4 primary

Quit and save the changes, enter:


Use the mkfs.ext4 command to format the file system, enter:

mkfs.ext4 /dev/sda1

update: I got a similar output except that my logical partition size was 512bytes and the physical was (like) 4068. 
But now it seems my encryption is gone as I can mount and open the partition without a password. 

  • The encryption will not be deleted in the way that after this procedure the data will be unencrypted. But the data will likely be no more accessible at all, no matter if you know the password or not. – Steffen Ullrich Sep 2 '19 at 16:56
  • How did you encrypt the HDD exactly? – user1686 Sep 2 '19 at 17:11
  • If you did not partition at all, then data will be deleted. You probably started write at beginning of drive where partition table info normally is and then writing partition table overwrites beginning of your data, and then rest will not be readable. Back up all your data & then restore it after repartitioning. – oldfred Sep 2 '19 at 17:17
  • "I just encrypted my hdd and it has no partition." This makes no sense. You mean the encryption process broke the partitioning, or...?? Your OS cannot write to a drive that doesn't have at least one partition. – Tetsujin Sep 2 '19 at 17:24
  • @grawity cryptsetup luksFormat /dev/sdX; cryptsetup luksOpen /dev/sdX external_disk; mkfs /dev/mapper/external_disk; cryptsetup luksCLose external_disk – topencrypt Sep 2 '19 at 18:16

With the schema written in the question, GPT partitioning was not needed and not used. The schema there created the needed partition.

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.