2

In a moment of inattention, I ran luksFormat on /dev/sda instead of on /dev/sda1. Now I would like to undo that operation. Checking man for cryptsetup doesn't reveal an obvious method.

`lsblk -f1 shows the following:

sda          crypto_LUKS                       45e143e4-7d5b-4f20-b552-f301ced442f4 
└─sda1       crypto_LUKS                       55c24c05-d113-4df5-2715-f0d4072f5343 

Normally, when I do this, there is no output to the right of sda. That's the state where I would like to end up after correcting my mistake.

I can lose sda1 at this point too. There is nothing important on it and I can recreate it in a minute. In short, I would like to start over with this block device after my mistake. However, running gdisk /dev/sda and making a new partition table and a new partition does not remove the crypto_LUKS from sda.

1 Answer 1

3

If there's no issue with recovering/keeping any data on the drive, and using gdisk (or equivalent) directly to make a new partition table does not work, you can wipe the header (and any partition tables) on the block device with dd if=/dev/zero of=/dev/sda bs=8M count=4. That should let you create a fresh partition table on the device with gdisk afterwards.

NOTE: This operation is destructive, so make sure to assign the correct device to the of= option!

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.