B
B
betal2015-03-24 16:20:43
Debian
betal, 2015-03-24 16:20:43

Accidentally erased GPT partitions on a working system, how to restore until I rebooted?

I inattentively read the manuals for new utilities, accidentally erased GPT partitions, I want to restore until I rebooted, maybe there are ideas?

############################### gdisk -l /dev/sdd
GPT fdisk (gdisk) version 0.8.5

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.
Disk /dev/sdd: 2930277168 sectors, 1.4 TiB
Logical sector size: 512 bytes
Disk identifier (GUID): A5461408-36C1-4D62-897B-FF0851338577
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 2930277134
Partitions will be aligned on 2048-sector boundaries
Total free space is 2797 sectors (1.4 MiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048          999423   487.0 MiB   EF00  
   2          999424       293967871   139.7 GiB   EF00  
   3       293967872       333029375   18.6 GiB    0700  
   4       333029376       625997823   139.7 GiB   0700  
   5       625997824      2930276351   1.1 TiB     0700  

############################### # gdisk -l /dev/sdf
GPT fdisk (gdisk) version 0.8.5

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: not present

Creating new GPT entries.
Disk /dev/sdf: 2930277168 sectors, 1.4 TiB
Logical sector size: 512 bytes
Disk identifier (GUID): 3E95168C-8B62-4A01-B836-301D6B6050A0
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 2930277134
Partitions will be aligned on 2048-sector boundaries
Total free space is 2930277101 sectors (1.4 TiB)

Number  Start (sector)    End (sector)  Size       Code  Name

############################### # sgdisk -d /dev/sdd

############################### # sgdisk -R /dev/sdd

############################### # sgdisk -R /dev/sdd /dev/sdf 

Creating new GPT entries.
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot.
The operation has completed successfully.
[email protected]:~# gdisk -l /dev/sdf
GPT fdisk (gdisk) version 0.8.5

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: not present

Creating new GPT entries.
Disk /dev/sdf: 2930277168 sectors, 1.4 TiB
Logical sector size: 512 bytes
Disk identifier (GUID): BB6D5B73-1A75-493A-982B-1488C973F579
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 2930277134
Partitions will be aligned on 2048-sector boundaries
Total free space is 2930277101 sectors (1.4 TiB)

Number  Start (sector)    End (sector)  Size       Code  Name

############################### # gdisk -l /dev/sdd
GPT fdisk (gdisk) version 0.8.5

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.
Disk /dev/sdd: 2930277168 sectors, 1.4 TiB
Logical sector size: 512 bytes
Disk identifier (GUID): CD553698-A13F-496E-A06F-2CAA3F9FD859
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 2930277134
Partitions will be aligned on 2048-sector boundaries
Total free space is 2930277101 sectors (1.4 TiB)

Number  Start (sector)    End (sector)  Size       Code  Name

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
betal, 2015-03-24
@betal

I'll answer myself:
### testdisk /dev/sdd
Or options gdisk /dev/sdd
r

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question