How to make a valid FAT Boot sector
Posted: 08 Feb 2021, 20:59
What is my next step?
Push me in the right direction
Mon Feb 8 13:52:13 2021
Command line: TestDisk
TestDisk 7.2-WIP, Data Recovery Utility, December 2020
Christophe GRENIER <grenier@cgsecurity.org>
https://www.cgsecurity.org
OS: Windows 7 (7601) SP1
Compiler: GCC 9.3, Cygwin32 3001.4
ext2fs lib: 1.45.3, ntfs lib: 10:0:0, reiserfs lib: none, ewf lib: 20140608, curses lib: ncurses 6.1
disk_get_size_win32 IOCTL_DISK_GET_LENGTH_INFO(/dev/sda)=2000398934016
disk_get_size_win32 IOCTL_DISK_GET_LENGTH_INFO(/dev/sdb)=2000398933504
disk_get_size_win32 IOCTL_DISK_GET_LENGTH_INFO(/dev/sdd)=255869321216
disk_get_size_win32 IOCTL_DISK_GET_LENGTH_INFO(\\.\PhysicalDrive0)=2000398934016
disk_get_size_win32 IOCTL_DISK_GET_LENGTH_INFO(\\.\PhysicalDrive1)=2000398933504
filewin32_getfilesize(\\.\PhysicalDrive2) GetFileSize err Incorrect function.
filewin32_setfilepointer(\\.\PhysicalDrive2) SetFilePointer err Incorrect function.
Warning: can't get size for \\.\PhysicalDrive2
disk_get_size_win32 IOCTL_DISK_GET_LENGTH_INFO(\\.\PhysicalDrive3)=255869321216
filewin32_getfilesize(\\.\PhysicalDrive4) GetFileSize err Incorrect function.
filewin32_setfilepointer(\\.\PhysicalDrive4) SetFilePointer err Incorrect function.
Warning: can't get size for \\.\PhysicalDrive4
filewin32_getfilesize(\\.\PhysicalDrive5) GetFileSize err Incorrect function.
filewin32_setfilepointer(\\.\PhysicalDrive5) SetFilePointer err Incorrect function.
Warning: can't get size for \\.\PhysicalDrive5
disk_get_size_win32 IOCTL_DISK_GET_LENGTH_INFO(\\.\C:)=2000291889152
filewin32_getfilesize(\\.\D:) GetFileSize err Incorrect function.
filewin32_setfilepointer(\\.\D:) SetFilePointer err Incorrect function.
Warning: can't get size for \\.\D:
disk_get_size_win32 IOCTL_DISK_GET_LENGTH_INFO(\\.\E:)=2000395698176
disk_get_size_win32 IOCTL_DISK_GET_LENGTH_INFO(\\.\F:)=0
Warning: can't get size for \\.\F:
disk_get_size_win32 IOCTL_DISK_GET_LENGTH_INFO(\\.\G:)=0
Warning: can't get size for \\.\G:
disk_get_size_win32 IOCTL_DISK_GET_LENGTH_INFO(\\.\H:)=0
Warning: can't get size for \\.\H:
disk_get_size_win32 IOCTL_DISK_GET_LENGTH_INFO(\\.\I:)=44040192
Hard disk list
Disk /dev/sda - 2000 GB / 1863 GiB - CHS 243201 255 63, sector size=512 - ST2000DM008-2FR102, S/N:202020202020202020202020465a324c46455456, FW:0001
Disk /dev/sdb - 2000 GB / 1863 GiB - CHS 243201 255 63, sector size=512 - Seagate BUP Slim BL, S/N:NA9LWKJ4, FW:0108
Disk /dev/sdd - 255 GB / 238 GiB - CHS 31107 255 63, sector size=512 - Generic- USB3.0 CRW -1, FW:1.00
Partition table type (auto): Intel
Disk /dev/sdd - 255 GB / 238 GiB - Generic- USB3.0 CRW -1
Partition table type: Intel
Analyse Disk /dev/sdd - 255 GB / 238 GiB - CHS 31107 255 63
Geometry from i386 MBR: head=255 sector=63
FAT32 at 0/130/3
Info: size boot_sector 85611, partition 86016
FAT1 : 32-690
FAT2 : 691-1349
start_rootdir : 1350 root cluster : 2
Data : 1350-85610
sectors : 85611
cluster_size : 1
no_of_cluster : 84261 (2 - 84262)
fat_length 659 calculated 659
heads/cylinder 64 (FAT) != 255 (HD)
sect/track 32 (FAT) != 63 (HD)
Current partition structure:
Warning: number of heads/cylinder mismatches 64 (FAT) != 255 (HD)
Warning: number of sectors per track mismatches 32 (FAT) != 63 (HD)
1 * FAT32 0 130 3 5 220 23 86016 [boot]
2 P Linux 6 30 25 31107 171 40 499646464 [rootfs]
search_part()
Disk /dev/sdd - 255 GB / 238 GiB - CHS 31107 255 63
FAT32 at 0/130/3
FAT1 : 32-690
FAT2 : 691-1349
start_rootdir : 1350 root cluster : 2
Data : 1350-85610
sectors : 85611
cluster_size : 1
no_of_cluster : 84261 (2 - 84262)
fat_length 659 calculated 659
heads/cylinder 64 (FAT) != 255 (HD)
sect/track 32 (FAT) != 63 (HD)
FAT32 at 0/130/3
FAT: cluster=2(0x2), pos=9542
FAT: cluster=107(0x6b), pos=9647
FAT: cluster=273(0x111), pos=9813
FAT: cluster=471(0x1d7), pos=10011
FAT: cluster=42904(0xa798), pos=52444
FAT: cluster=2885(0xb45), pos=12425
FAT: cluster=5728(0x1660), pos=15268
FAT32 0 130 3 5 213 59 85611 [boot]
FAT32, blocksize=512, 43 MB / 41 MiB
recover_EXT2: s_block_group_nr=0/1906, s_mnt_count=26/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8096
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 62455808
recover_EXT2: part_size 499646464
Filesystem created: Tue Mar 13 18:10:46 2018
Last mount time: Mon Nov 25 10:29:01 2019
Linux 6 30 25 31107 171 40 499646464 [rootfs]
ext4 blocksize=4096 Large_file Sparse_SB, 255 GB / 238 GiB
file_pread(6,8,buffer,499744768(31107/171/41)) ReadFile The drive cannot find the sector requested.
file_pread(6,1,buffer,499744768(31107/171/41)) ReadFile The drive cannot find the sector requested.
file_pread(6,1,buffer,499744769(31107/171/42)) lseek err Invalid argument
file_pread(6,14,buffer,499744770(31107/171/43)) lseek err Invalid argument
file_pread(6,3,buffer,499744784(31107/171/57)) lseek err Invalid argument
file_pread(6,3,buffer,499744831(31107/172/41)) lseek err Invalid argument
file_pread(6,8,buffer,499744847(31107/172/57)) lseek err Invalid argument
file_pread(6,11,buffer,499744894(31107/173/41)) lseek err Invalid argument
file_pread(6,2,buffer,499746816(31107/204/10)) lseek err Invalid argument
Results
* FAT32 0 130 3 5 220 23 86016 [boot]
FAT32, blocksize=512, 44 MB / 42 MiB
P Linux 6 30 25 31107 171 40 499646464 [rootfs]
ext4 blocksize=4096 Large_file Sparse_SB, 255 GB / 238 GiB
interface_write()
1 * FAT32 0 130 3 5 220 23 86016 [boot]
2 P Linux 6 30 25 31107 171 40 499646464 [rootfs]
simulate write!
write_mbr_i386: starting...
write_all_log_i386: starting...
No extended partition
Interface Advanced
Geometry from i386 MBR: head=255 sector=63
FAT32 at 0/130/3
Info: size boot_sector 85611, partition 86016
FAT1 : 32-690
FAT2 : 691-1349
start_rootdir : 1350 root cluster : 2
Data : 1350-85610
sectors : 85611
cluster_size : 1
no_of_cluster : 84261 (2 - 84262)
fat_length 659 calculated 659
heads/cylinder 64 (FAT) != 255 (HD)
sect/track 32 (FAT) != 63 (HD)
1 * FAT32 0 130 3 5 220 23 86016 [boot]
FAT32, blocksize=512, 44 MB / 42 MiB
2 P Linux 6 30 25 31107 171 40 499646464 [rootfs]
ext4 blocksize=4096 Large_file Sparse_SB, 255 GB / 238 GiB
fat32_boot_sector
1 * FAT32 0 130 3 5 220 23 86016 [boot]
FAT32, blocksize=512, 44 MB / 42 MiB
FAT32 at 0/130/3
Info: size boot_sector 85611, partition 86016
FAT1 : 32-690
FAT2 : 691-1349
start_rootdir : 1350 root cluster : 2
Data : 1350-85610
sectors : 85611
cluster_size : 1
no_of_cluster : 84261 (2 - 84262)
fat_length 659 calculated 659
heads/cylinder 64 (FAT) != 255 (HD)
sect/track 32 (FAT) != 63 (HD)
FAT32 at 0/130/3
Info: size boot_sector 85611, partition 86016
FAT1 : 32-690
FAT2 : 691-1349
start_rootdir : 1350 root cluster : 2
Data : 1350-85610
sectors : 85611
cluster_size : 1
no_of_cluster : 84261 (2 - 84262)
fat_length 659 calculated 659
heads/cylinder 64 (FAT) != 255 (HD)
sect/track 32 (FAT) != 63 (HD)
Boot sector
Warning: number of heads/cylinder mismatches 64 (FAT) != 255 (HD)
Warning: number of sectors per track mismatches 32 (FAT) != 63 (HD)
OK
Backup boot sector
Warning: number of heads/cylinder mismatches 64 (FAT) != 255 (HD)
Warning: number of sectors per track mismatches 32 (FAT) != 63 (HD)
OK
Second sectors (cluster information) are not identical.
A valid FAT Boot sector must be present in order to access
any data; even if the partition is not bootable.
Push me in the right direction
Mon Feb 8 13:52:13 2021
Command line: TestDisk
TestDisk 7.2-WIP, Data Recovery Utility, December 2020
Christophe GRENIER <grenier@cgsecurity.org>
https://www.cgsecurity.org
OS: Windows 7 (7601) SP1
Compiler: GCC 9.3, Cygwin32 3001.4
ext2fs lib: 1.45.3, ntfs lib: 10:0:0, reiserfs lib: none, ewf lib: 20140608, curses lib: ncurses 6.1
disk_get_size_win32 IOCTL_DISK_GET_LENGTH_INFO(/dev/sda)=2000398934016
disk_get_size_win32 IOCTL_DISK_GET_LENGTH_INFO(/dev/sdb)=2000398933504
disk_get_size_win32 IOCTL_DISK_GET_LENGTH_INFO(/dev/sdd)=255869321216
disk_get_size_win32 IOCTL_DISK_GET_LENGTH_INFO(\\.\PhysicalDrive0)=2000398934016
disk_get_size_win32 IOCTL_DISK_GET_LENGTH_INFO(\\.\PhysicalDrive1)=2000398933504
filewin32_getfilesize(\\.\PhysicalDrive2) GetFileSize err Incorrect function.
filewin32_setfilepointer(\\.\PhysicalDrive2) SetFilePointer err Incorrect function.
Warning: can't get size for \\.\PhysicalDrive2
disk_get_size_win32 IOCTL_DISK_GET_LENGTH_INFO(\\.\PhysicalDrive3)=255869321216
filewin32_getfilesize(\\.\PhysicalDrive4) GetFileSize err Incorrect function.
filewin32_setfilepointer(\\.\PhysicalDrive4) SetFilePointer err Incorrect function.
Warning: can't get size for \\.\PhysicalDrive4
filewin32_getfilesize(\\.\PhysicalDrive5) GetFileSize err Incorrect function.
filewin32_setfilepointer(\\.\PhysicalDrive5) SetFilePointer err Incorrect function.
Warning: can't get size for \\.\PhysicalDrive5
disk_get_size_win32 IOCTL_DISK_GET_LENGTH_INFO(\\.\C:)=2000291889152
filewin32_getfilesize(\\.\D:) GetFileSize err Incorrect function.
filewin32_setfilepointer(\\.\D:) SetFilePointer err Incorrect function.
Warning: can't get size for \\.\D:
disk_get_size_win32 IOCTL_DISK_GET_LENGTH_INFO(\\.\E:)=2000395698176
disk_get_size_win32 IOCTL_DISK_GET_LENGTH_INFO(\\.\F:)=0
Warning: can't get size for \\.\F:
disk_get_size_win32 IOCTL_DISK_GET_LENGTH_INFO(\\.\G:)=0
Warning: can't get size for \\.\G:
disk_get_size_win32 IOCTL_DISK_GET_LENGTH_INFO(\\.\H:)=0
Warning: can't get size for \\.\H:
disk_get_size_win32 IOCTL_DISK_GET_LENGTH_INFO(\\.\I:)=44040192
Hard disk list
Disk /dev/sda - 2000 GB / 1863 GiB - CHS 243201 255 63, sector size=512 - ST2000DM008-2FR102, S/N:202020202020202020202020465a324c46455456, FW:0001
Disk /dev/sdb - 2000 GB / 1863 GiB - CHS 243201 255 63, sector size=512 - Seagate BUP Slim BL, S/N:NA9LWKJ4, FW:0108
Disk /dev/sdd - 255 GB / 238 GiB - CHS 31107 255 63, sector size=512 - Generic- USB3.0 CRW -1, FW:1.00
Partition table type (auto): Intel
Disk /dev/sdd - 255 GB / 238 GiB - Generic- USB3.0 CRW -1
Partition table type: Intel
Analyse Disk /dev/sdd - 255 GB / 238 GiB - CHS 31107 255 63
Geometry from i386 MBR: head=255 sector=63
FAT32 at 0/130/3
Info: size boot_sector 85611, partition 86016
FAT1 : 32-690
FAT2 : 691-1349
start_rootdir : 1350 root cluster : 2
Data : 1350-85610
sectors : 85611
cluster_size : 1
no_of_cluster : 84261 (2 - 84262)
fat_length 659 calculated 659
heads/cylinder 64 (FAT) != 255 (HD)
sect/track 32 (FAT) != 63 (HD)
Current partition structure:
Warning: number of heads/cylinder mismatches 64 (FAT) != 255 (HD)
Warning: number of sectors per track mismatches 32 (FAT) != 63 (HD)
1 * FAT32 0 130 3 5 220 23 86016 [boot]
2 P Linux 6 30 25 31107 171 40 499646464 [rootfs]
search_part()
Disk /dev/sdd - 255 GB / 238 GiB - CHS 31107 255 63
FAT32 at 0/130/3
FAT1 : 32-690
FAT2 : 691-1349
start_rootdir : 1350 root cluster : 2
Data : 1350-85610
sectors : 85611
cluster_size : 1
no_of_cluster : 84261 (2 - 84262)
fat_length 659 calculated 659
heads/cylinder 64 (FAT) != 255 (HD)
sect/track 32 (FAT) != 63 (HD)
FAT32 at 0/130/3
FAT: cluster=2(0x2), pos=9542
FAT: cluster=107(0x6b), pos=9647
FAT: cluster=273(0x111), pos=9813
FAT: cluster=471(0x1d7), pos=10011
FAT: cluster=42904(0xa798), pos=52444
FAT: cluster=2885(0xb45), pos=12425
FAT: cluster=5728(0x1660), pos=15268
FAT32 0 130 3 5 213 59 85611 [boot]
FAT32, blocksize=512, 43 MB / 41 MiB
recover_EXT2: s_block_group_nr=0/1906, s_mnt_count=26/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8096
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 62455808
recover_EXT2: part_size 499646464
Filesystem created: Tue Mar 13 18:10:46 2018
Last mount time: Mon Nov 25 10:29:01 2019
Linux 6 30 25 31107 171 40 499646464 [rootfs]
ext4 blocksize=4096 Large_file Sparse_SB, 255 GB / 238 GiB
file_pread(6,8,buffer,499744768(31107/171/41)) ReadFile The drive cannot find the sector requested.
file_pread(6,1,buffer,499744768(31107/171/41)) ReadFile The drive cannot find the sector requested.
file_pread(6,1,buffer,499744769(31107/171/42)) lseek err Invalid argument
file_pread(6,14,buffer,499744770(31107/171/43)) lseek err Invalid argument
file_pread(6,3,buffer,499744784(31107/171/57)) lseek err Invalid argument
file_pread(6,3,buffer,499744831(31107/172/41)) lseek err Invalid argument
file_pread(6,8,buffer,499744847(31107/172/57)) lseek err Invalid argument
file_pread(6,11,buffer,499744894(31107/173/41)) lseek err Invalid argument
file_pread(6,2,buffer,499746816(31107/204/10)) lseek err Invalid argument
Results
* FAT32 0 130 3 5 220 23 86016 [boot]
FAT32, blocksize=512, 44 MB / 42 MiB
P Linux 6 30 25 31107 171 40 499646464 [rootfs]
ext4 blocksize=4096 Large_file Sparse_SB, 255 GB / 238 GiB
interface_write()
1 * FAT32 0 130 3 5 220 23 86016 [boot]
2 P Linux 6 30 25 31107 171 40 499646464 [rootfs]
simulate write!
write_mbr_i386: starting...
write_all_log_i386: starting...
No extended partition
Interface Advanced
Geometry from i386 MBR: head=255 sector=63
FAT32 at 0/130/3
Info: size boot_sector 85611, partition 86016
FAT1 : 32-690
FAT2 : 691-1349
start_rootdir : 1350 root cluster : 2
Data : 1350-85610
sectors : 85611
cluster_size : 1
no_of_cluster : 84261 (2 - 84262)
fat_length 659 calculated 659
heads/cylinder 64 (FAT) != 255 (HD)
sect/track 32 (FAT) != 63 (HD)
1 * FAT32 0 130 3 5 220 23 86016 [boot]
FAT32, blocksize=512, 44 MB / 42 MiB
2 P Linux 6 30 25 31107 171 40 499646464 [rootfs]
ext4 blocksize=4096 Large_file Sparse_SB, 255 GB / 238 GiB
fat32_boot_sector
1 * FAT32 0 130 3 5 220 23 86016 [boot]
FAT32, blocksize=512, 44 MB / 42 MiB
FAT32 at 0/130/3
Info: size boot_sector 85611, partition 86016
FAT1 : 32-690
FAT2 : 691-1349
start_rootdir : 1350 root cluster : 2
Data : 1350-85610
sectors : 85611
cluster_size : 1
no_of_cluster : 84261 (2 - 84262)
fat_length 659 calculated 659
heads/cylinder 64 (FAT) != 255 (HD)
sect/track 32 (FAT) != 63 (HD)
FAT32 at 0/130/3
Info: size boot_sector 85611, partition 86016
FAT1 : 32-690
FAT2 : 691-1349
start_rootdir : 1350 root cluster : 2
Data : 1350-85610
sectors : 85611
cluster_size : 1
no_of_cluster : 84261 (2 - 84262)
fat_length 659 calculated 659
heads/cylinder 64 (FAT) != 255 (HD)
sect/track 32 (FAT) != 63 (HD)
Boot sector
Warning: number of heads/cylinder mismatches 64 (FAT) != 255 (HD)
Warning: number of sectors per track mismatches 32 (FAT) != 63 (HD)
OK
Backup boot sector
Warning: number of heads/cylinder mismatches 64 (FAT) != 255 (HD)
Warning: number of sectors per track mismatches 32 (FAT) != 63 (HD)
OK
Second sectors (cluster information) are not identical.
A valid FAT Boot sector must be present in order to access
any data; even if the partition is not bootable.