LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Deleted partitions on in use disk (https://www.linuxquestions.org/questions/slackware-14/deleted-partitions-on-in-use-disk-4175589119/)

enine 09-09-2016 04:46 PM

Deleted partitions on in use disk
 
oops.

Can I recover the partitions before I reboot and my box won't boot anymore :)

Emerson 09-09-2016 04:56 PM

Yes, if you write the exactly same partition table back everything will be as before. You can use testdisk to get clues where the partitions were.

enine 09-09-2016 05:13 PM

Thanks, that looks like a nice tool, I'm loading it on all my boxen now.

zk1234 09-09-2016 05:18 PM

Quote:

Originally Posted by enine (Post 5603108)
Thanks, that looks like a nice tool, I'm loading it on all my boxen now.

Do not do this !

Execute:
Code:

fdisk -l /dev/sda
If fdisk can still see your partitions, then just use cfdisk to save (write back) your partition table to your disk. It's much simpler solution.

Only if fdisk cannot see your partition anymore, then you should use testdisk.

.

Emerson 09-09-2016 05:45 PM

Not 100% sure, but methinks fdisk -l /dev/sda tries to read the partition table from drive, while plain fdisk -l reads it from /proc ... and may succeed even when the first command fails.

zk1234 09-09-2016 06:03 PM

Quote:

Originally Posted by Emerson (Post 5603123)
Not 100% sure, but methinks fdisk -l /dev/sda tries to read the partition table from drive, while plain fdisk -l reads it from /proc ... and may succeed even when the first command fails.

If fdisk, cfdisk, ..., is able to see his partitions, then he should use this tool to write them back to the disk. The whole recovery process would take one second.

PS.
Running TestDisk from the recovered hard disk drive may be not a good idea.

zerouno 09-21-2016 06:49 PM

For next time, use gpart
http://repository.slacky.eu/slackwar.../system/gpart/
It helped me to recover partition tables deleted a year earlier (obviously the filesystem was partially damaged, but partition tables was consistently restored)

zerouno 09-21-2016 06:49 PM

For next time, use gpart
http://repository.slacky.eu/slackwar.../system/gpart/
It helped me to recover partition tables deleted a year earlier (obviously the filesystem was partially damaged, but partition tables was consistently restored)


All times are GMT -5. The time now is 04:20 AM.