How can I recover an ext4 partition after luksFormat?
It was late one night when I decided to try gnome-shell 3.16 without messing up my Ubuntu box. So, I downloaded an Antergos image and booted it. I was maybe half asleep when I told the python installer (called Cnchi) to encrypt my home partition with LUKS, even though I knew that my home folder was encrypted with ecryptfs
(the Ubuntu default procedure). The moral: never play with a new distro before going to bed. As far as I can tell, the script created a container with luksFormat
, which I can open (via luksOpen
or with gnome-disks) and see nothing but the empty folders created at first login. I have already changed the /home partition mount in order to avoid any further change.
I've read some posts on how to (try to) recover a lost LUKS partition, but found none on accidental LUKS formatting.
Update
testdisk's deep search found the following two partitions whose difference is minimal: they have the same size (1764434816 sectors), but one partition starts two sectors later.
The partition beginning in sector 165566464 and ending in sector 1932001279 is the LUKS container, as reported by gparted:
If I change the D
[Deleted] label to a P
[Partition], in both cases, testdisk doesn't report any file. Insted, it shows Can't open filesystem. Filesystem seems damaged
.