LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 09-09-2016, 04:46 PM   #1
enine
Senior Member
 
Registered: Nov 2003
Distribution: Slackʍɐɹǝ
Posts: 1,486
Blog Entries: 4

Rep: Reputation: 282Reputation: 282Reputation: 282
Deleted partitions on in use disk


oops.

Can I recover the partitions before I reboot and my box won't boot anymore
 
Old 09-09-2016, 04:56 PM   #2
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
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.
 
1 members found this post helpful.
Old 09-09-2016, 05:13 PM   #3
enine
Senior Member
 
Registered: Nov 2003
Distribution: Slackʍɐɹǝ
Posts: 1,486

Original Poster
Blog Entries: 4

Rep: Reputation: 282Reputation: 282Reputation: 282
Thanks, that looks like a nice tool, I'm loading it on all my boxen now.
 
Old 09-09-2016, 05:18 PM   #4
zk1234
4MLinux Maintainer
 
Registered: Oct 2010
Location: Poland
Distribution: 4MLinux, Slackware
Posts: 1,253

Rep: Reputation: 220Reputation: 220Reputation: 220
Quote:
Originally Posted by enine View Post
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.

.

Last edited by zk1234; 09-09-2016 at 05:25 PM.
 
Old 09-09-2016, 05:45 PM   #5
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
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.
 
Old 09-09-2016, 06:03 PM   #6
zk1234
4MLinux Maintainer
 
Registered: Oct 2010
Location: Poland
Distribution: 4MLinux, Slackware
Posts: 1,253

Rep: Reputation: 220Reputation: 220Reputation: 220
Quote:
Originally Posted by Emerson View Post
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.

Last edited by zk1234; 09-09-2016 at 06:06 PM.
 
Old 09-21-2016, 06:49 PM   #7
zerouno
Member
 
Registered: Oct 2009
Location: Italy
Distribution: Slackware
Posts: 983

Rep: Reputation: 352Reputation: 352Reputation: 352Reputation: 352
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)
 
Old 09-21-2016, 06:49 PM   #8
zerouno
Member
 
Registered: Oct 2009
Location: Italy
Distribution: Slackware
Posts: 983

Rep: Reputation: 352Reputation: 352Reputation: 352Reputation: 352
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)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] what is a logical partitions and group partitions and how to check disk space on a partition ITareliteralyMyInitials Linux - Newbie 10 02-08-2016 11:19 AM
How to recover partitions deleted by mistake? Tassadar Linux - General 3 06-18-2014 12:58 AM
Deleted my partitions in cfdisk... technik733 Linux - Software 3 05-18-2009 10:02 PM
accidentally deleted partitions somae Linux - Hardware 3 01-13-2009 08:57 AM
bonehead mistake deleted partitions on wrong disk gfem Fedora 1 12-08-2007 12:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 08:01 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration