You are not logged in.

#1 2014-07-14 13:58:58

blackdev1l
Member
Registered: 2014-06-12
Posts: 14

[SOLVED] I accidently "sgdisk --zap-all" the wrong hard disk

Moderator comment [ewaller]  To anyone reading this thread, please, please be aware that this is a command that can quickly and easily destroy important information on your disks if you do it wrong.  Do not try this at home

Hello. I have 2 hard disk, one ssd with the system that i used to install arch, and one HDD of 2tb with all my data in it.
I use "sgdisk --zap-all" on the HDD (silly me) and now i'd like to recover data. Is there something i can do? I didn't touch the HDD after that.

Last edited by blackdev1l (2014-07-15 16:29:56)

Offline

#2 2014-07-14 14:02:14

Spider.007
Member
Registered: 2004-06-20
Posts: 1,176

Re: [SOLVED] I accidently "sgdisk --zap-all" the wrong hard disk

Well actually zap-all 'only' deletes the mbr & gtp tables; meaning the filesystem is still there. Do you happen to know how many partitions were on the disk; and what size they were?

Offline

#3 2014-07-14 14:04:32

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] I accidently "sgdisk --zap-all" the wrong hard disk

In case somebody wonders what does 'sgdisk --zap-all' do:
http://www.rodsbooks.com/gdisk/sgdisk.html

man sgdisk wrote:

-Z, --zap-all
    Zap (destroy) the GPT and MBR data structures and then exit. This option works much like -z, but as it wipes the MBR as well as the GPT, it's more suitable if you want to repartition a disk after using this option, and completely unsuitable if you've already repartitioned the disk.

Offline

#4 2014-07-14 14:13:56

blackdev1l
Member
Registered: 2014-06-12
Posts: 14

Re: [SOLVED] I accidently "sgdisk --zap-all" the wrong hard disk

Spider.007 wrote:

Well actually zap-all 'only' deletes the mbr & gtp tables; meaning the filesystem is still there. Do you happen to know how many partitions were on the disk; and what size they were?

It was just one partition of 300MB and the rest of HDD in ntfs (i was using windows)

Offline

#5 2014-07-14 16:26:23

Spider.007
Member
Registered: 2004-06-20
Posts: 1,176

Re: [SOLVED] I accidently "sgdisk --zap-all" the wrong hard disk

This page contains a few links; plus shows how to do it manually:

http://tldp.org/HOWTO/Partition/recovering.html

Offline

#6 2014-07-14 17:04:01

blackdev1l
Member
Registered: 2014-06-12
Posts: 14

Re: [SOLVED] I accidently "sgdisk --zap-all" the wrong hard disk

Spider.007 wrote:

This page contains a few links; plus shows how to do it manually:

http://tldp.org/HOWTO/Partition/recovering.html

testDisk gives me this :

Disk /dev/sda - 2000 GB / 1863 GiB - CHS 243201 255 63
     Partition               Start        End    Size in sectors
>P MS Data                     2048     718847     716800 [System Reserved]
   MS Data                   720896 3907022840 3906301945 [Dati]
   MS Data                   720903 3907022847 3906301945

I need the one labeld with "dati"

after i write the partition table i can't mount it. I just have /dev/sda1 which is [System Reserved] (a kaspersky antivirus thing)

Offline

#7 2014-07-14 17:07:12

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [SOLVED] I accidently "sgdisk --zap-all" the wrong hard disk

Not an Installation issue, moving to NC...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#8 2014-07-15 07:56:41

Spider.007
Member
Registered: 2004-06-20
Posts: 1,176

Re: [SOLVED] I accidently "sgdisk --zap-all" the wrong hard disk

Which partition table did you write? I'd say that writing the table you quoted should give you at least sda1 & 2; regardless of wether the offsets are correct for a valid filesystem to be found. What is the output from `parted /dev/sda unit b p`

Offline

#9 2014-07-15 11:42:53

blackdev1l
Member
Registered: 2014-06-12
Posts: 14

Re: [SOLVED] I accidently "sgdisk --zap-all" the wrong hard disk

Spider.007 wrote:

Which partition table did you write? I'd say that writing the table you quoted should give you at least sda1 & 2; regardless of wether the offsets are correct for a valid filesystem to be found. What is the output from `parted /dev/sda unit b p`

i frirst  chose EFI/GPT and then when i found the partitions i wrote "dati"

Model: ATA ST2000DM001-9YN1 (scsi)
Disk /dev/sda: 2000398934016B
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:

Number  Start     End         Size        File system  Name  Flags
1      1048576B  368050175B  367001600B  ntfs

Last edited by blackdev1l (2014-07-15 11:44:28)

Offline

#10 2014-07-15 16:29:32

blackdev1l
Member
Registered: 2014-06-12
Posts: 14

Re: [SOLVED] I accidently "sgdisk --zap-all" the wrong hard disk

Just found out that i have to press right arrow for select the partition on testDisk. Solved.

Offline

#11 2014-07-15 16:33:36

Spider.007
Member
Registered: 2004-06-20
Posts: 1,176

Re: [SOLVED] I accidently "sgdisk --zap-all" the wrong hard disk

Okay, great!

Then you won't need the suggestion I originally posted here wink

Last edited by Spider.007 (2014-07-15 16:35:40)

Offline

Board footer

Powered by FluxBB