Skip to content

Deleted partition recovery

Hey, I've just tried to run the windows installer since I needed an win10 install on a secondary disk.

long story short, somehow I ended up with my /home partition deleted.

As far as I understand it, the data of the partition should be fine, just the partition table was rewritten.

Can I just create a new partition in the now empty space with the same params as before?

Edit: yes, I can. Worked, chroot into system shows data is still there. Can't seem to get it booting though, for some reason.

Edit: updating fstab makes the boot work now.

Case closed!

Edited 16 May 2020. We only hold this version.

1 points9 comments
Open on Reddit
About this post
Posted
Archived
Edited
Score
1 · 60% up
Kind
Text
ID
gl1374

Author

1
posts
50
comments
0
media
View profile

9 comments

Yes, that should work - so long as it is again just a modification to the partition table, and your tool doesn't go ahead and reformat it with a blank filesystem for you.

4 points

Thanks for the quick reply.

Lets hope windows isn't an idiot, fingers crossed...

2 points

Just creating the partition in the table worked. Now it doesn't complete boot though, not sure why. At least the data is still there, so the rest can be fixed, probably.

2 points

You can use testdisk, that should provide a somewhat automatic way to recover the lost partition.

3 points

Can I just create a new partition in the now empty space with the same params as before?

NO! NO! NO! STOP!

First you back up all binary data using dd

I don't really know what to do in this case, but NO! You will overwrite data and recreate a new superblock - a lookup table for all files which will not contain old data!

What was the previous file system? ext4? btrfsx? xfs?

0 points

It actually worked. I knew exactly in which sectors the ext4 partitions was, so there's that.

If I chroot into the system and mount the partition onto /home I can see my data is still there, so that's a part-win.

Now I have to figure out why the system isn't booting, I'm stuck on the 'dev/sdb2 clean ....' screen.

2 points

It actually worked. I knew exactly in which sectors the ext4 partitions was, so there's that.

Lucky you. You scared me there for a moment with "create new".

'm stuck on the 'dev/sdb2 clean ....' screen.

Probably no use, copy all the data you can somewhere else, recreate the old filesystem and copy the data back.

1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.