Menu

error trying to use ddru_ntfsbad with Basic data partition

df 925
2021-12-28
2022-01-04
  • df 925

    df 925 - 2021-12-28

    Hi

    I tried to run
    ddru_ntfsfindbad -i 659554304 /dev/sda mapfile

    ddru_ntfsfindbad 1.5 20150109
    Reading the logfile into memory...
    Reading partition boot sector...
    ERROR! This program only allows for 8 sectors per MFT record, and this partition boot sector reports 1968
    ERROR! Unable to correctly process the partition boot sector

    based on
    fdisk -lu /dev/sda

    Disk /dev/sda: 1.82 TiB, 2000398933504 bytes, 3907029167 sectors
    Disk model: BUP Ultra Touch
    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: 8BB1F33B-CBFA-4A6D-AF91-B4EABE93FF50

    Device Start End Sectors Size Type
    /dev/sda1 2048 1026047 1024000 500M EFI System
    /dev/sda2 1026048 1288191 262144 128M Microsoft reserved
    /dev/sda3 1288192 1925378047 1924089856 917.5G Microsoft basic data
    /dev/sda4 1925378048 1927122943 1744896 852M Windows recovery environment
    /dev/sda5 1927122944 1953523711 26400768 12.6G Windows recovery environment

    Not sure if someone could help me understand what I am doing wrong?

    The mapfile I'm using looks like this
    0xA39DA3FE00 + 3

    pos size status

    0x00000000 0xA39D7A8000 +
    0xA39D7A8000 0x00001000 -
    0xA39D7A9000 0x0014A000 +
    0xA39D8F3000 0x00001000 -
    0xA39D8F4000 0x0014B000 +
    0xA39DA3F000 0x00001000 -
    0xA39DA40000 0x4543376000 +

     

    Last edit: df 925 2021-12-28
  • maximus57

    maximus57 - 2021-12-29

    Please provide the output from the following commands:

    sudo fdisk -lu /dev/sda
    sudo lsblk -f /dev/sda
    sudo xxd -s 659554304 -l 512 /dev/sda

    fdisk is to verify it is still the same disk from your post
    lsblk should show the partition types and verify the targeted one is ntfs
    xxd will provide a hex dump of the partition boot sector to verify that it is a valid ntfs boot sector

    The error indicates it is not a valid ntfs boot sector.

     
  • df 925

    df 925 - 2021-12-31

    Hi Maximus,

    Thank you so much for helping, I super appreciate it.

    sudo fdisk -lu /dev/sda

    The backup GPT table is not on the end of the device.
    
    Disk /dev/sda: 1.82 TiB, 2000398933504 bytes, 3907029167 sectors
    Disk model: BUP Ultra Touch 
    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: 8BB1F33B-CBFA-4A6D-AF91-B4EABE93FF50
    
    Device          Start        End    Sectors   Size Type
    /dev/sda1        2048    1026047    1024000   500M EFI System
    /dev/sda2     1026048    1288191     262144   128M Microsoft reserved
    /dev/sda3     1288192 1925378047 1924089856 917.5G Microsoft basic data
    /dev/sda4  1925378048 1927122943    1744896   852M Windows recovery environment
    /dev/sda5  1927122944 1953523711   26400768  12.6G Windows recovery environment
    

    sudo lsblk -f /dev/sda

    NAME   FSTYPE FSVER LABEL      UUID                                 FSAVAIL FSUSE% MOUNTPOINT
    sda                                                                                
    ├─sda1 vfat   FAT32 ESP        4AF0-A894                                           
    ├─sda2                                                                             
    ├─sda3 ntfs         OS         FCE21BD9E21B96CC                                    
    ├─sda4 ntfs         WINRETOOLS 5A7C2E477C2E1E6F                                    
    └─sda5 ntfs         Image      D6322EED322ED1F3                                  
    

    sudo xxd -s 659554304 -l 512 /dev/sda

    27500000: eb52 904e 5446 5320 2020 2000 0208 0000  .R.NTFS    .....
    27500010: 0000 0000 00f8 0000 3f00 ff00 00a8 1300  ........?.......
    27500020: 0000 0000 8000 8000 ff47 af72 0000 0000  .........G.r....
    27500030: 0000 0c00 0000 0000 0200 0000 0000 0000  ................
    27500040: f600 0000 0100 0000 cc96 1be2 d91b e2fc  ................
    27500050: 0000 0000 fa33 c08e d0bc 007c fb68 c007  .....3.....|.h..
    27500060: 1f1e 6866 00cb 8816 0e00 6681 3e03 004e  ..hf......f.>..N
    27500070: 5446 5375 15b4 41bb aa55 cd13 720c 81fb  TFSu..A..U..r...
    27500080: 55aa 7506 f7c1 0100 7503 e9dd 001e 83ec  U.u.....u.......
    27500090: 1868 1a00 b448 8a16 0e00 8bf4 161f cd13  .h...H..........
    275000a0: 9f83 c418 9e58 1f72 e13b 060b 0075 dba3  .....X.r.;...u..
    275000b0: 0f00 c12e 0f00 041e 5a33 dbb9 0020 2bc8  ........Z3... +.
    275000c0: 66ff 0611 0003 160f 008e c2ff 0616 00e8  f...............
    275000d0: 4b00 2bc8 77ef b800 bbcd 1a66 23c0 752d  K.+.w......f#.u-
    275000e0: 6681 fb54 4350 4175 2481 f902 0172 1e16  f..TCPAu$....r..
    275000f0: 6807 bb16 6852 1116 6809 0066 5366 5366  h...hR..h..fSfSf
    27500100: 5516 1616 68b8 0166 610e 07cd 1a33 c0bf  U...h..fa....3..
    27500110: 0a13 b9f6 0cfc f3aa e9fe 0190 9066 601e  .............f`.
    27500120: 0666 a111 0066 0306 1c00 1e66 6800 0000  .f...f.....fh...
    27500130: 0066 5006 5368 0100 6810 00b4 428a 160e  .fP.Sh..h...B...
    27500140: 0016 1f8b f4cd 1366 595b 5a66 5966 591f  .......fY[ZfYfY.
    27500150: 0f82 1600 66ff 0611 0003 160f 008e c2ff  ....f...........
    27500160: 0e16 0075 bc07 1f66 61c3 a1f6 01e8 0900  ...u...fa.......
    27500170: a1fa 01e8 0300 f4eb fd8b f0ac 3c00 7409  ............<.t.
    27500180: b40e bb07 00cd 10eb f2c3 0d0a 4120 6469  ............A di
    27500190: 736b 2072 6561 6420 6572 726f 7220 6f63  sk read error oc
    275001a0: 6375 7272 6564 000d 0a42 4f4f 544d 4752  curred...BOOTMGR
    
     
  • maximus57

    maximus57 - 2021-12-31

    I think I can see what is happening, but it shouldn't happen. A signed
    character with a value of 0xF6 is being considered positive when it
    should be considered a negative value by the system. It would seem your
    system is defaulting to an unsigned character.

    What OS are you using, and what is your computer architecture? I am
    curious about the system and why it is like this. Can you run the
    following command and provide me the dmesg.txt file?

    dmesg > dmesg.txt

    In the source file "makefile" you can make a change to hopefully fix
    this. Line 5 reads as follows:

    CFLAGS = -Wall -W
    Change it to:

    CFLAGS = -Wall -W -fsigned-char
    The run the following commands from within the source folder to remake
    the program and reinstall it:

    make clean
    make
    sudo make install

    Regards,
    Scott

     
  • df 925

    df 925 - 2022-01-01

    The original hdd is from a dell xps.
    I used gddrescue from systemrescue to clone it to a USB drive on the same machine.
    Then I used a Raspberry PI 3 with Rasbian to run ddrutility on that same USB.

    Attached is the dmesg from the Rasberry PI to run ddrutility.

    I used apt install to get ddrutility, so I'll need to figure out how to run a make, or maybe do it on another OS?

    Thanks again!
    DF

     
  • df 925

    df 925 - 2022-01-01

    To branch this discussion, is there anyway to use the MFT and the mapfile to do the same? That way I wouldn't have to connect the USB to anything?

    Thx
    DF

     
  • maximus57

    maximus57 - 2022-01-01

    How did you install ddrutility on Rasbian in the first place? If you followed the standard instructions, you already ran make during the installation process. You need to do that again but with a modified makefile edited as described.

    I do not know of any way to do anything with just the MFT and mapfile, even though that is all that is required. Your only options are try to to recompile ddrutility with the modified makefile, or use something other than a Raspberry Pi that does not have an ARM processor. If there are not too many errors, you could try to run the regular ddru_findbad, but it requires other dependencies to be installed, plus it is real slow.

     
  • df 925

    df 925 - 2022-01-01

    again greatly appreciate the insight.

    On Rasbian, I just used apt install ddrutility. I'll play around with the makefile today and hopefully that will be it.

    excellent tool, and appreciate the work you put into it!

    Not too many errors, only 3 errors 4k in size, but last time I ran ddru_findbad on the same raspberry pi, it locked up, so I gave up.

     
  • df 925

    df 925 - 2022-01-02

    Just for anyone that tries this on RPI3 and Raspian:

    Its a 1TB partition, and my RPI3 only has 1GB RAM. I bumped Raspbian to 2G swap, but it appears to still run out of memory running ntfscluster.

    Inode 633741 is an extent of inode 629525.
    Inode 633742 is an extent of inode 629525.
    Inode 633749 is an extent of inode 631663.
    Failed to malloc 4096 bytes: Cannot allocate memory
    Couldn't read the data runs.
    

    With the larger memory I'm trying to run ddru_findbad /dev/sda mapfile -Q
    this worked, however yielded one line that strikes me as odd

    results_summary.txt shows :
    0 sectors were in partitions that were able to be processed
    I'm hoping that just means that there were no files, but not sure if it actually means it wasn't able look at the partition.

    ########## ddru_findbad 1.11 20141015 summary output file ##########
    ########## Note that the quick option was used ##########
    ########## Therefore this is not a complete result ##########
    ########## And the stats will not be accurate ##########
    ########## Note that the quick ntfs option was used ##########
    ########## NTFS results will be complete but ##########
    ########## will not have sector counts ##########
    There are 6 bad sectors total from the log file
    0 sectors were in partitions that were able to be processed
    0 sectors are listed as allocated
    0 of those have a file or data listing related to them
    leaving 0 that do not have a file or data listing related to them
    0 sectors are listed as not allocated
    ...................................................................
    Below is the list of files related to the bad sectors
    with the number of bad sectors in each file
    ...................................................................
    

    however results_info.txt

    ########## ddru_findbad 1.11 20141015 info output file ##########
    ##########################################################
    ########## fdisk output ##########
    Disk /dev/sda: 1.82 TiB, 2000398933504 bytes, 3907029167 sectors
    Disk model: BUP Ultra Touch 
    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: 8BB1F33B-CBFA-4A6D-AF91-B4EABE93FF50
    
    Device          Start        End    Sectors   Size Type
    /dev/sda1        2048    1026047    1024000   500M EFI System
    /dev/sda2     1026048    1288191     262144   128M Microsoft reserved
    /dev/sda3     1288192 1925378047 1924089856 917.5G Microsoft basic data
    /dev/sda4  1925378048 1927122943    1744896   852M Windows recovery environment
    /dev/sda5  1927122944 1953523711   26400768  12.6G Windows recovery environment
    ##########################################################
    ########## mmls output ##########
    GUID Partition Table (EFI)
    Offset Sector: 0
    Units are in 512-byte sectors
    
          Slot      Start        End          Length       Description
    000:  Meta      0000000000   0000000000   0000000001   Safety Table
    001:  -------   0000000000   0000002047   0000002048   Unallocated
    002:  Meta      0000000001   0000000001   0000000001   GPT Header
    003:  Meta      0000000002   0000000033   0000000032   Partition Table
    004:  000       0000002048   0001026047   0001024000   EFI system partition
    005:  001       0001026048   0001288191   0000262144   Microsoft reserved partit
    ion
    006:  002       0001288192   1925378047   1924089856   Basic data partition
    007:  003       1925378048   1927122943   0001744896   
    008:  004       1927122944   1953523711   0026400768   
    009:  -------   1953523712   3907029166   1953505455   Unallocated
    ...................................................................
    ...................................................................
    Partition /dev/sda3 type NTFS is found to be ntfs
    ##########################################################
    ########## Partition /dev/sda3 fsstat short output ##########
    FILE SYSTEM INFORMATION
    --------------------------------------------
    File System Type: NTFS
    Volume Serial Number: FCE21BD9E21B96CC
    OEM Name: NTFS    
    Volume Name: OS
    Version: Windows XP
    
    METADATA INFORMATION
    --------------------------------------------
    First Cluster of MFT: 786432
    First Cluster of MFT Mirror: 2
    Size of MFT Entries: 1024 bytes
    Size of Index Records: 4096 bytes
    Range: 0 - 718080
    Root Directory: 5
    
    CONTENT INFORMATION
    --------------------------------------------
    Sector Size: 512
    Cluster Size: 4096
    Total Cluster Range: 0 - 240511230
    Total Sector Range: 0 - 1924089854
    
    $AttrDef Attribute Values:
    $STANDARD_INFORMATION (16)   Size: 48-72   Flags: Resident
    $ATTRIBUTE_LIST (32)   Size: No Limit   Flags: Non-resident
    $FILE_NAME (48)   Size: 68-578   Flags: Resident,Index
    $OBJECT_ID (64)   Size: 0-256   Flags: Resident
    $SECURITY_DESCRIPTOR (80)   Size: No Limit   Flags: Non-resident
    $VOLUME_NAME (96)   Size: 2-256   Flags: Resident
    $VOLUME_INFORMATION (112)   Size: 12-12   Flags: Resident
    $DATA (128)   Size: No Limit   Flags: 
    $INDEX_ROOT (144)   Size: No Limit   Flags: Resident
    $INDEX_ALLOCATION (160)   Size: No Limit   Flags: Non-resident
    $BITMAP (176)   Size: No Limit   Flags: Non-resident
    $REPARSE_POINT (192)   Size: 0-16384   Flags: Non-resident
    $EA_INFORMATION (208)   Size: 8-8   Flags: Resident
    $EA (224)   Size: 0-65536   Flags: 
    $LOGGED_UTILITY_STREAM (256)   Size: 0-65536   Flags: Non-resident
    
    ########## List of bad sectors as a sector range list ##########
    1372503360 1372503367
    1372506008 1372506015
    1372508664 1372508671
    

    So close, but I'm hoping that the bad sectors didnt have files on them
    thx
    DF

     

    Last edit: df 925 2022-01-02
  • df 925

    df 925 - 2022-01-04

    Hi

    just wanted to close this out.

    I was able to use an old Dell E6420 laptop, and use Ubuntu 18.04 trial, and install ddrutility.

    ddru_ntfsfindbad /dev/sdc mapfile reported an error about unknown partition, but I think thats because I did not use the -i option to specify the correct partition.

    I was able to use ddru_findbad /dev/sdc mapfile and that was successful

    Scott, so thankful for your excellent tool and your help

    Best,
    DF

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.