Testdrive:在双启动系统上恢复意外删除的 Windows 10 分区表(非启动分区)

Testdrive:在双启动系统上恢复意外删除的 Windows 10 分区表(非启动分区)

我意外删除了双启动笔记本电脑上的大部分 Windows 分区表,并尝试修复/恢复有故障的分区表。

我有一台双启动笔记本电脑:Ubuntu 和 Windows。Grub 仍然有效(我可以启动 Ubuntu)。

  • Ubuntu 16.10(包括启动分区)位于/dev/sdb
  • Windows 10 位于/dev/sda

我意外删除了 Windows 分区表的大部分内容dev/sda(愚蠢的错误时有发生)。根据以下内容,以下是剩余的内容fdisk

$ sudo fdisk -lu /dev/sda
Disk /dev/sda: 465,8 GiB, 500107862016 bytes, 976773168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 6CAE9467-2FF5-4DB9-8E72-4321E9061C2A

Device      Start     End Sectors  Size Type
/dev/sda2  923648 1128447  204800  100M EFI System

我仍然可以从 grub 中选择 Windows,但是现在我当然只得到(德语为:恢复,系统必须修复):

关于未找到操作系统的 Windows 错误屏幕

来自我/boot/grub/grub.cfg/dev/sdb

menuentry 'Windows Boot Manager (on /dev/sda2)' --class windows --class os $menuentry_id_option 'osprober-efi-46A6-7D64' {
        insmod part_gpt
        insmod fat
        set root='hd0,gpt2'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  46A6-7D64
        else
          search --no-floppy --fs-uuid --set=root 46A6-7D64
        fi
        chainloader /EFI/Microsoft/Boot/bootmgfw.efi

testdisk结果dev/sda

TestDisk 7.0, Data Recovery Utility, April 2015
Christophe GRENIER <[email protected]>
http://www.cgsecurity.org

Disk /dev/sda - 500 GB / 465 GiB - CHS 60801 255 63
     Partition               Start        End    Size in sectors
>P MS Data                     2048     923647     921600
 P MS Data                   923648    1128447     204800 [NO NAME]
 D MS Data                  1161216  975772594  974611379
 D MS Data                974774273  975773696     999424
 D MS Data                975773696  976773119     999424

Structure: Ok.  Use Up/Down Arrow keys to select partition.
Use Left/Right Arrow keys to CHANGE partition characteristics:
                P=Primary  D=Deleted
Keys A: add partition, L: load backup, T: change type, P: list files,
     Enter: to continue
NTFS, blocksize=4096, 471 MB / 450 MiB

使用以下详细信息查看每个分区后,P: list files似乎:

  • 分区 1:恢复。可以保留吗?
  • 分区 2:确定
  • 分区 3:包含 Windows10 内容
  • 分区 4:应保持删除状态(?)
  • 分区 5:恢复。可以删除吗?

我的问题:

  • 我应该恢复分区 3 吗(使用L: load backup)?
  • 分区 4 是否应保持状态D(已删除)?无论如何,它似乎已损坏。
  • 分区 5 是否应保持状态D(已删除)?它包含恢复,但分区 1 上已有一个有效的恢复。
  • 我如何确保条目grub指向/dev/sda2正确的位置?

testdisk输入每个分区后的结果P

  • 分区 1

       P MS Data                     2048     923647     921600
    Directory /
    
    >dr-xr-xr-x     0     0         0  4-Jun-2016 23:48 .
     dr-xr-xr-x     0     0         0  4-Jun-2016 23:48 ..
     dr-xr-xr-x     0     0         0  4-Jun-2016 23:44 Recovery
     dr-xr-xr-x     0     0         0  1-Jun-2016 14:12 System Volume Information
    
  • 分区 2

       P MS Data                   923648    1128447     204800 [NO NAME]
    Directory /
    
    >drwxr-xr-x     0     0         0  2-Jun-2016 07:34 EFI
    
  • 分区 3

         MS Data                  1161216  975772594  974611379
    Directory /
    
    >dr-xr-xr-x     0     0         0 10-Feb-2017 01:05 .
     dr-xr-xr-x     0     0         0 10-Feb-2017 01:05 ..
     dr-xr-xr-x     0     0         0 22-Aug-2016 22:54 $GetCurrent
     dr-xr-xr-x     0     0         0  2-Jun-2016 10:40 $Recycle.Bin
     dr-xr-xr-x     0     0         0  8-Nov-2016 18:54 Intel
     dr-xr-xr-x     0     0         0 27-Apr-2016 07:52 Logs
     dr-xr-xr-x     0     0         0 16-Jul-2016 13:47 PerfLogs
     dr-xr-xr-x     0     0         0  2-Feb-2017 23:13 Program Files
     dr-xr-xr-x     0     0         0  2-Feb-2017 23:11 Program Files (x86)
     dr-xr-xr-x     0     0         0 22-Aug-2016 22:59 ProgramData
     dr-xr-xr-x     0     0         0 27-Dec-2016 15:55 Python36
     dr-xr-xr-x     0     0         0 22-Aug-2016 22:38 Recovery
     dr-xr-xr-x     0     0         0 20-Jun-2016 22:03 SQL Server 2000 Sample Databases
     dr-xr-xr-x     0     0         0 21-Jun-2016 20:06 SQLServer2016Media
     dr-xr-xr-x     0     0         0 10-Feb-2017 00:28 System Volume Information
     dr-xr-xr-x     0     0         0 22-Aug-2016 22:44 Users
     dr-xr-xr-x     0     0         0 10-Feb-2017 01:06 Windows
     dr-xr-xr-x     0     0         0 22-Aug-2016 22:54 Windows10Upgrade
     dr-xr-xr-x     0     0         0  5-Oct-2016 19:25 _tmp
     dr-xr-xr-x     0     0         0  4-Jun-2016 22:23 cloud
     dr-xr-xr-x     0     0         0  2-Feb-2017 18:45 projects
     dr-xr-xr-x     0     0         0 24-Jul-2016 14:35 tools
     -r--r--r--     0     0         1 30-Oct-2015 08:18 BOOTNXT
     -r--r--r--     0     0         0 27-Dec-2016 15:55 Python36:Win32App_1
     -r--r--r--     0     0         0 20-Jun-2016 22:03 SQL Server 2000 Sample Databases:Win32App_1
     -r--r--r--     0     0    395268 10-Jul-2015 13:00 bootmgr
     -r--r--r--     0     0 2550136832 10-Feb-2017 01:07 pagefile.sys
     -r--r--r--     0     0  16777216 10-Feb-2017 01:07 swapfile.sys
    
  • 分区 4

         MS Data                974774273  975773696     999424
    
    Can't open filesystem. Filesystem seems damaged.
    
  • 分区 5

         MS Data                975773696  976773119     999424
    Directory /
    
    >dr-xr-xr-x     0     0         0 18-Nov-2016 21:26 .
     dr-xr-xr-x     0     0         0 18-Nov-2016 21:26 ..
     dr-xr-xr-x     0     0         0 22-Aug-2016 23:36 Recovery
     dr-xr-xr-x     0     0         0  4-Jun-2016 22:49 System Volume Information
    

testdisk.log

Thu Feb 16 20:46:55 2017
Command line: TestDisk

TestDisk 7.0, Data Recovery Utility, April 2015
Christophe GRENIER <[email protected]>
http://www.cgsecurity.org
OS: Linux, kernel 4.8.0-37-generic (#39-Ubuntu SMP Thu Jan 26 02:27:07 UTC 2017) x86_64
Compiler: GCC 5.3
ext2fs lib: 1.43.3, ntfs lib: libntfs-3g, reiserfs lib: none, ewf lib: none, curses lib: ncurses 6.0
/dev/sda: LBA, HPA, LBA48, DCO support
/dev/sda: size       976773168 sectors
/dev/sda: user_max   976773168 sectors
/dev/sda: native_max 976773168 sectors
/dev/sda: dco        976773168 sectors
/dev/sdb: LBA, HPA, LBA48, DCO support
/dev/sdb: size       976773168 sectors
/dev/sdb: user_max   976773168 sectors
/dev/sdb: native_max 976773168 sectors
/dev/sdb: dco        976773168 sectors
Warning: can't get size for Disk /dev/mapper/control - 0 B - 0 sectors, sector size=512
Hard disk list
Disk /dev/sda - 500 GB / 465 GiB - CHS 60801 255 63, sector size=512 - Samsung SSD 850 EVO 500GB, S/N:S1YCNXAGB00962X, FW:EMT02B6Q
Disk /dev/sdb - 500 GB / 465 GiB - CHS 60801 255 63, sector size=512 - Samsung SSD 850 EVO M.2 500GB, S/N:S24CNXAH208296N, FW:EMT21B6Q

Partition table type (auto): EFI GPT
Disk /dev/sda - 500 GB / 465 GiB - Samsung SSD 850 EVO 500GB
Partition table type: EFI GPT

Analyse Disk /dev/sda - 500 GB / 465 GiB - CHS 60801 255 63
hdr_size=92
hdr_lba_self=1
hdr_lba_alt=976773167 (expected 976773167)
hdr_lba_start=34
hdr_lba_end=976773134
hdr_lba_table=2
hdr_entries=128
hdr_entsz=128
Current partition structure:
 2 P EFI System                923648    1128447     204800 [EFI system partition]

search_part()
Disk /dev/sda - 500 GB / 465 GiB - CHS 60801 255 63
NTFS at 0/32/33
filesystem size           921600
sectors_per_cluster       8
mft_lcn                   38400
mftmirr_lcn               2
clusters_per_mft_record   -10
clusters_per_index_record 1
NTFS part_offset=1048576, part_size=471859200, sector_size=512
NTFS partition cannot be added (part_offset<part_size).
NTFS at 0/32/33
filesystem size           921600
sectors_per_cluster       8
mft_lcn                   38400
mftmirr_lcn               2
clusters_per_mft_record   -10
clusters_per_index_record 1
     MS Data                     2048     923647     921600
     NTFS, blocksize=4096, 471 MB / 450 MiB
FAT32 at 57/126/6
FAT1 : 6654-7422
FAT2 : 7423-8191
start_rootdir : 8192 root cluster : 2
Data : 8192-204799
sectors : 204800
cluster_size : 2
no_of_cluster : 98304 (2 - 98305)
fat_length 769 calculated 769
set_FAT_info: name from BS used

FAT32 at 57/126/6
     MS Data                   923648    1128447     204800 [NO NAME]
     FAT32, blocksize=1024, 104 MB / 100 MiB
NTFS at 72/72/1
filesystem size           974611379
sectors_per_cluster       8
mft_lcn                   786432
mftmirr_lcn               2
clusters_per_mft_record   -10
clusters_per_index_record 1
NTFS part_offset=594542592, part_size=499001026048, sector_size=512
NTFS partition cannot be added (part_offset<part_size).
NTFS at 72/72/1
filesystem size           974611379
sectors_per_cluster       8
mft_lcn                   786432
mftmirr_lcn               2
clusters_per_mft_record   -10
clusters_per_index_record 1
     MS Data                  1161216  975772594  974611379
     NTFS, blocksize=4096, 499 GB / 464 GiB
NTFS at 60739/26/24
filesystem size           999424
sectors_per_cluster       8
mft_lcn                   41642
mftmirr_lcn               2
clusters_per_mft_record   -10
clusters_per_index_record 1
     MS Data                974774273  975773696     999424
     NTFS found using backup sector, blocksize=4096, 511 MB / 488 MiB
NTFS at 60739/26/24
filesystem size           999424
sectors_per_cluster       8
mft_lcn                   41642
mftmirr_lcn               2
clusters_per_mft_record   -10
clusters_per_index_record 1
     MS Data                975773696  976773119     999424
     NTFS, blocksize=4096, 511 MB / 488 MiB

Results
   P MS Data                     2048     923647     921600
     NTFS, blocksize=4096, 471 MB / 450 MiB
   P MS Data                   923648    1128447     204800 [NO NAME]
     FAT32, blocksize=1024, 104 MB / 100 MiB
     MS Data                  1161216  975772594  974611379
     NTFS, blocksize=4096, 499 GB / 464 GiB
     MS Data                974774273  975773696     999424
     NTFS found using backup sector, blocksize=4096, 511 MB / 488 MiB
     MS Data                975773696  976773119     999424
     NTFS, blocksize=4096, 511 MB / 488 MiB

Hint for advanced users. dmsetup may be used if you prefer to avoid to rewrite the partition table for the moment:
echo "0 921600 linear /dev/sda 2048" | dmsetup create test0
echo "0 204800 linear /dev/sda 923648" | dmsetup create test1
echo "0 974611379 linear /dev/sda 1161216" | dmsetup create test2
echo "0 999424 linear /dev/sda 974774273" | dmsetup create test3
echo "0 999424 linear /dev/sda 975773696" | dmsetup create test4
ntfs_device_testdisk_io_ioctl() unimplemented


dir_partition inode=5
   P MS Data                     2048     923647     921600
     NTFS, blocksize=4096, 471 MB / 450 MiB
Directory /
       5 dr-xr-xr-x     0      0         0  4-Jun-2016 23:48 .
       5 dr-xr-xr-x     0      0         0  4-Jun-2016 23:48 ..
      37 dr-xr-xr-x     0      0         0  4-Jun-2016 23:44 Recovery
      35 dr-xr-xr-x     0      0         0  1-Jun-2016 14:12 System Volume Information


dir_partition inode=0
   P MS Data                   923648    1128447     204800 [NO NAME]
     FAT32, blocksize=1024, 104 MB / 100 MiB
FAT: cluster=2(0x2), pos=931840
Directory /
       3 drwxr-xr-x     0      0         0  2-Jun-2016 07:34 EFI
ntfs_device_testdisk_io_ioctl() unimplemented


dir_partition inodentfs_mst_post_read_fixup_warn: magic: 0x00000000  size: 1024   usa_ofs: 0  usa_count: 65535: Invalid argument
Record 0 has no FILE magic (0x0)
Failed to load $MFT: Input/output error
ntfs_mst_post_read_fixup_warn: magic: 0x00000000  size: 1024   usa_ofs: 0  usa_count: 65535: Invalid argument
Record 0 has no FILE magic (0x0)
Failed to load $MFT: Input/output error
=5
     MS Data                  1161216  975772594  974611379
     NTFS, blocksize=4096, 499 GB / 464 GiB
Directory /
       5 dr-xr-xr-x     0      0         0 10-Feb-2017 01:05 .
       5 dr-xr-xr-x     0      0         0 10-Feb-2017 01:05 ..
     132 dr-xr-xr-x     0      0         0 22-Aug-2016 22:54 $GetCurrent
      63 dr-xr-xr-x     0      0         0  2-Jun-2016 10:40 $Recycle.Bin
   86499 dr-xr-xr-x     0      0         0  8-Nov-2016 18:54 Intel
  135457 dr-xr-xr-x     0      0         0 27-Apr-2016 07:52 Logs
  184781 dr-xr-xr-x     0      0         0 16-Jul-2016 13:47 PerfLogs
  184785 dr-xr-xr-x     0      0         0  2-Feb-2017 23:13 Program Files
  192329 dr-xr-xr-x     0      0         0  2-Feb-2017 23:11 Program Files (x86)
  192466 dr-xr-xr-x     0      0         0 22-Aug-2016 22:59 ProgramData
  279327 dr-xr-xr-x     0      0         0 27-Dec-2016 15:55 Python36
  174888 dr-xr-xr-x     0      0         0 22-Aug-2016 22:38 Recovery
  546406 dr-xr-xr-x     0      0         0 20-Jun-2016 22:03 SQL Server 2000 Sample Databases
  210433 dr-xr-xr-x     0      0         0 21-Jun-2016 20:06 SQLServer2016Media
   82311 dr-xr-xr-x     0      0         0 10-Feb-2017 00:28 System Volume Information
  192686 dr-xr-xr-x     0      0         0 22-Aug-2016 22:44 Users
  193184 dr-xr-xr-x     0      0         0 10-Feb-2017 01:06 Windows
   17780 dr-xr-xr-x     0      0         0 22-Aug-2016 22:54 Windows10Upgrade
  136591 dr-xr-xr-x     0      0         0  5-Oct-2016 19:25 _tmp
     463 dr-xr-xr-x     0      0         0  4-Jun-2016 22:23 cloud
  170100 dr-xr-xr-x     0      0         0  2-Feb-2017 18:45 projects
     300 dr-xr-xr-x     0      0         0 24-Jul-2016 14:35 tools
  389125 -r--r--r--     0      0         1 30-Oct-2015 08:18 BOOTNXT
  279327 -r--r--r--     0      0         0 27-Dec-2016 15:55 Python36:Win32App_1
  546406 -r--r--r--     0      0         0 20-Jun-2016 22:03 SQL Server 2000 Sample Databases:Win32App_1
   19844 -r--r--r--     0      0    395268 10-Jul-2015 13:00 bootmgr
      34 -r--r--r--     0      0 2550136832 10-Feb-2017 01:07 pagefile.sys
   82325 -r--r--r--     0      0  16777216 10-Feb-2017 01:07 swapfile.sys
ntfs_device_testdisk_io_ioctl() unimplemented
ntfs_device_testdisk_io_ioctl() unimplemented

     MS Data                974774273  975773696     999424
     NTFS found using backup sector, blocksize=4096, 511 MB / 488 MiB
Can't open filesystem. Filesystem seems damaged.
ntfs_device_testdisk_io_ioctl() unimplemented


dir_partition inode=5
     MS Data                975773696  976773119     999424
     NTFS, blocksize=4096, 511 MB / 488 MiB
Directory /
       5 dr-xr-xr-x     0      0         0 18-Nov-2016 21:26 .
       5 dr-xr-xr-x     0      0         0 18-Nov-2016 21:26 ..
      35 dr-xr-xr-x     0      0         0 22-Aug-2016 23:36 Recovery
      40 dr-xr-xr-x     0      0         0  4-Jun-2016 22:49 System Volume Information

interface_write()
 1 P MS Data                     2048     923647     921600
 2 P MS Data                   923648    1128447     204800 [NO NAME]
simulate write!

TestDisk exited normally.

相关内容