Severe damage to ext4 filesystem

Using TestDisk to repair the filesystem
Forum rules
When asking for technical support:
- Search for posts on the same topic before posting a new question.
- Give clear, specific information in the title of your post.
- Include as many details as you can, MOST POSTS WILL GET ONLY ONE OR TWO ANSWERS.
- Post a follow up with a "Thank you" or "This worked!"
- When you learn something, use that knowledge to HELP ANOTHER USER LATER.
Before posting, please read https://www.cgsecurity.org/testdisk.pdf
Locked
Message
Author
JHMarx
Posts: 5
Joined: 11 Feb 2022, 08:24

Severe damage to ext4 filesystem

#1 Post by JHMarx »

Hello:

For whatever reasons (from carelesness to a USB drive with ID issues) I ended up dd'ing an *.iso image on to a new Toshiba Ultrastar 300Gb SAS HDD containing relatively important stuff. I say relatively because I cannot exactly recall what was there.

The drive contains only unencripted data in one primary partition, no OS files or boot record.
It is formatted as ext4 and needs admin credentials to be accessed.
I have not removed the tray from cage as it is not written to.

[Please don't ask about the backup ...]

My setup uses Linux Devuan Beowulf with a backported kernel:

Code: Select all

~$ uname -a
Linux devuan 5.10.0-0.bpo.3-amd64 #1 SMP Debian 5.10.13-1~bpo10+1 (2021-02-11) x86_64 GNU/Linux
~$ 
So I went to see what the testdisk 7.0 utility (from the Devuan repository) had to say with respect to the drive (/dev/sdf):

Code: Select all

---
TestDisk 7.0, Data Recovery Utility, April 2015
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org

TestDisk is free software, and
comes with ABSOLUTELY NO WARRANTY.

Select a media (use Arrow keys, then press Enter):
--- snip ---
> Disk /dev/sdf - 300 GB / 279 GiB - HITACHI HUS153030VLS300
---
TestDisk detected an Intel/PC partition as expected, which I selected:

Code: Select all

Disk /dev/sdf - 300 GB / 279 GiB - HITACHI HUS153030VLS300

Please select the partition table type, press Enter when done.
>[Intel  ] Intel/PC partition
--- snip ---

Disk /dev/sdf - 300 GB / 279 GiB - HITACHI HUS153030VLS300
     CHS 36472 255 63 - sector size=512
I selected [Analyse] and TestDisk found the partition:

Code: Select all

Disk /dev/sdf - 300 GB / 279 GiB - CHS 36472 255 63
Current partition structure:
     Partition                  Start        End    Size in sectors

No ext2, JFS, Reiser, cramfs or XFS marker
 1 * Linux                    0  32 33 36472 225 41  585934848
 1 * Linux                    0  32 33 36472 225 41  585934848
I then selected [Quick Search] and waited for the result:

Code: Select all

Disk /dev/sdf - 300 GB / 279 GiB - CHS 36472 255 63
     Partition               Start        End    Size in sectors
>* Linux                    0  32 33 36472 225 41  585934848 [300Gb]   <- black fg on green bg ...   =^D

Structure: Ok.  Use Up/Down Arrow keys to select partition.   <-- Says it is OK ...   =^D
Use Left/Right Arrow keys to CHANGE partition characteristics:
*=Primary bootable  P=Primary  L=Logical  E=Extended  D=Deleted
Keys A: add partition, L: load backup, T: change type, P: list files,
     Enter: to continue
ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 299 GB / 279 GiB
I did not choose the [Deeper Search] option because I knew it was only one partition on the drive.

Happy with the results, I went ahead and selected [Write] to write the partition structure to the disk, confirming with (Y).

It (apparently) wrote the partition and informed me that I had to reboot:

Code: Select all

You will have to reboot for the change to take effect.
>Ok
So far so good, or so I thought.

After rebooting I see that the drive is still an isoimage and that nothing was written to the drive.

Code: Select all

~$ blkid
--- snip ---
/dev/sdf1: UUID="2021-10-14-13-08-50-00" LABEL="ISOIMAGE" TYPE="iso9660" PTUUID="12a82752" PTTYPE="dos" PARTUUID="563437db-01"
~$ 
I have seen this type of issues with USB drives before.
ie: ended up write-only after dd'ing with an *.iso file.

So I went to [Advanced] Filesystem Utils to see what it was about as I had never used that before and got this:

Code: Select all

Disk /dev/sdf - 300 GB / 279 GiB - CHS 36472 255 63

     Partition                  Start        End    Size in sectors
> 1 * Linux                    0  32 33 36472 225 41  585934848

 [  Type  ] >[Superblock]  [*ist]  [Image Creation]  [  Quit  ]
                    Locate ext2/ext3/ext4 backup superblock

The [*ist] option got me this:

Code: Select all

 [  Type  ]  [Superblock] >[ *ist ]  [Image Creation]  [  Quit  ]
                              List and copy files

Support for this filesystem hasn't been enable during compilation.
I then tried the [Superblock] option and got this:

Code: Select all

Disk /dev/sdf - 300 GB / 279 GiB - CHS 36472 255 63

     Partition                  Start        End    Size in sectors

  Linux                    0  32 33 36472 225 41  585934848 [300Gb]
superblock 819200, blocksize=4096 [300Gb]
superblock 884736, blocksize=4096 [300Gb]
superblock 1605632, blocksize=4096 [300Gb]
superblock 2654208, blocksize=4096 [300Gb]
superblock 4096000, blocksize=4096 [300Gb]
superblock 7962624, blocksize=4096 [300Gb]
superblock 11239424, blocksize=4096 [300Gb]
superblock 20480000, blocksize=4096 [300Gb]
superblock 23887872, blocksize=4096 [300Gb]
superblock 71663616, blocksize=4096 [300Gb]

To repair the filesystem using alternate superblock, run
fsck.ext4 -p -b superblock -B blocksize device
But I don't know what to do with this.

For completeness' sake I am adding the output from GSmartControl, hdmarm and lsblk.

This is the output from GSmartControl

Code: Select all

smartctl 6.6 2017-11-05 r4594 [x86_64-linux-5.10.0-0.bpo.3-amd64] (local build)
Copyright (C) 2002-17, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Vendor:               HITACHI
Product:              HUS153030VLS300
Revision:             A410
User Capacity:        300,000,000,000 bytes [300 GB]
Logical block size:   512 bytes
Rotation Rate:        15000 rpm
Logical Unit id:      0x5000cca00d1ec930
Serial number:        JHVJXVVC
Device type:          disk
Transport protocol:   SAS (SPL-3)
Local Time is:        Fri Feb 11 04:51:48 2022 -03
SMART support is:     Available - device has SMART capability.
SMART support is:     Enabled
Temperature Warning:  Enabled
Read Cache is:        Enabled
Writeback Cache is:   Enabled

=== START OF READ SMART DATA SECTION ===
SMART Health Status: OK

Current Drive Temperature:     42 C
Drive Trip Temperature:        85 C

Manufactured in week 25 of year 2012
Specified cycle count over device lifetime:  50000
Accumulated start-stop cycles:  21
Elements in grown defect list: 0

Vendor (Seagate) cache information
  Blocks sent to initiator = 1419654463488
This is the output from lsblk:

Code: Select all

~$ lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
--- snip ---
sdf      8:80   0 279.4G  0 disk 
`-sdf1   8:81   0 279.4G  0 part 
--- snip ---
~$ 
This is the output from hdparm

Code: Select all

~$ sudo hdparm /dev/sdf

/dev/sdf:
SG_IO: bad/missing sense data, sb[]:  70 00 05 00 00 00 00 18 00 00 00 00 20 00 00 c0 00 00 00 00 15 0a 00 00 00 00 00 00 00 00 00 00
SG_IO: bad/missing sense data, sb[]:  70 00 05 00 00 00 00 18 00 00 00 00 20 00 00 c0 00 00 00 00 15 0a 00 00 00 00 00 00 00 00 00 00
 HDIO_DRIVE_CMD(identify) failed: Input/output error
 readonly      =  0 (off)
 readahead     = 256 (on)
SG_IO: bad/missing sense data, sb[]:  70 00 05 00 00 00 00 18 00 00 00 00 20 00 00 c0 00 00 00 00 15 0a 00 00 00 00 00 00 00 00 00 00
SG_IO: bad/missing sense data, sb[]:  70 00 05 00 00 00 00 18 00 00 00 00 20 00 00 c0 00 00 00 00 15 0a 00 00 00 00 00 00 00 00 00 00
 HDIO_DRIVE_CMD(identify) failed: Input/output error
 geometry      = 36472/255/63, sectors = 585937500, start = 0
groucho@devuan:~$ 
The hardware seems to have no issues whatsoever so there isn't a mechanical/electrical issue here.

I assume that the partition and it's contents is recoverable by writing the partiton structure to the drive.
But TestDisk was not able to do that and I have no idea as to what to do to get it done.

I'd appreciate advice on how to continue with this.

Thanks in advance,

JHM

recuperation
Posts: 2735
Joined: 04 Jan 2019, 09:48
Location: Hannover, Deutschland (Germany, Allemagne)

Re: Severe damage to ext4 filesystem

#2 Post by recuperation »

How big is your ISO file?

If you overwrote your drive there shouldn't be any partition anymore that covers the whole drive unless you had a iso file with a size of 300GB.
I have seen this type of issues with USB drives before .
ie: ended up write-only after dd'ing with an *.iso file.
But your drive is SAS drive. How did you connect it?

I am wondering about "HDIO_DRIVE_CMD(identify) failed: Input/output error".
Do you get this message when quering your other drives as well?

Please uses the latest Testdisk version. You can run it from a live linux on a USB stick.

JHMarx
Posts: 5
Joined: 11 Feb 2022, 08:24

Re: Severe damage to ext4 filesystem

#3 Post by JHMarx »

Hello:

Thanks for the fast reply.
Much appreciated.
recuperation wrote: 11 Feb 2022, 10:45 How big is your ISO file?
The *.iso file is 1.2G:

Code: Select all

~/Downloads$ ls -lh chimaera_amd64_desktop-live.iso
-rw-r--r-- 1 user user 1.2G Feb 10 19:10 chimaera_amd64_desktop-live.iso
~/Downloads$ 
I have seen this type of issues with USB drives before .
ie: ended up write-only after dd'ing with an *.iso file.
recuperation wrote: 11 Feb 2022, 10:45 ... drive is SAS drive. How did you connect it?
It is on-line in my box.
I dd'id the *iso file to the drive instead of dd'ing it to the USB stick.

Code: Select all

~$ sudo dd if=/home/user/Downloads/chimaera_amd64_desktop-live.iso of=/dev/sdg1 bs=1M
The problem arose as I used lsblk to re-check the USB drive's asigned letter instead of checking it with gparted.
Big mistake as for some reason the USB drive did not mount and /dev/sdg1 ended up being the SAS drive.
recuperation wrote: 11 Feb 2022, 10:45 I am wondering about "HDIO_DRIVE_CMD(identify) failed: Input/output error".
Do you get this message when quering your other drives as well?
Yes.
The three drives are Hitachi HUS153030VLS300 (A410) SAS (SPL-3) with Smartctl 6.6 2017-11-05 r4594
They are an IBM part: 39R7344.

Code: Select all

~$ sudo hdparm /dev/sdc /dev/sdd /dev/sdf

/dev/sdc:
SG_IO: bad/missing sense data, sb[]:  70 00 05 00 00 00 00 18 00 00 00 00 20 00 00 c0 00 00 00 00 15 0a 00 00 00 00 00 00 00 00 00 00
SG_IO: bad/missing sense data, sb[]:  70 00 05 00 00 00 00 18 00 00 00 00 20 00 00 c0 00 00 00 00 15 0a 00 00 00 00 00 00 00 00 00 00
 HDIO_DRIVE_CMD(identify) failed: Input/output error
 readonly      =  0 (off)
 readahead     = 256 (on)
SG_IO: bad/missing sense data, sb[]:  70 00 05 00 00 00 00 18 00 00 00 00 20 00 00 c0 00 00 00 00 15 0a 00 00 00 00 00 00 00 00 00 00
SG_IO: bad/missing sense data, sb[]:  70 00 05 00 00 00 00 18 00 00 00 00 20 00 00 c0 00 00 00 00 15 0a 00 00 00 00 00 00 00 00 00 00
 HDIO_DRIVE_CMD(identify) failed: Input/output error
 geometry      = 36472/255/63, sectors = 585937500, start = 0

/dev/sdd:
SG_IO: bad/missing sense data, sb[]:  70 00 05 00 00 00 00 18 00 00 00 00 20 00 00 c0 00 00 00 00 15 0a 00 00 00 00 00 00 00 00 00 00
SG_IO: bad/missing sense data, sb[]:  70 00 05 00 00 00 00 18 00 00 00 00 20 00 00 c0 00 00 00 00 15 0a 00 00 00 00 00 00 00 00 00 00
 HDIO_DRIVE_CMD(identify) failed: Input/output error
 readonly      =  0 (off)
 readahead     = 256 (on)
SG_IO: bad/missing sense data, sb[]:  70 00 05 00 00 00 00 18 00 00 00 00 20 00 00 c0 00 00 00 00 15 0a 00 00 00 00 00 00 00 00 00 00
SG_IO: bad/missing sense data, sb[]:  70 00 05 00 00 00 00 18 00 00 00 00 20 00 00 c0 00 00 00 00 15 0a 00 00 00 00 00 00 00 00 00 00
 HDIO_DRIVE_CMD(identify) failed: Input/output error
 geometry      = 36472/255/63, sectors = 585937500, start = 0

/dev/sdf:
SG_IO: bad/missing sense data, sb[]:  70 00 05 00 00 00 00 18 00 00 00 00 20 00 00 c0 00 00 00 00 15 0a 00 00 00 00 00 00 00 00 00 00
SG_IO: bad/missing sense data, sb[]:  70 00 05 00 00 00 00 18 00 00 00 00 20 00 00 c0 00 00 00 00 15 0a 00 00 00 00 00 00 00 00 00 00
 HDIO_DRIVE_CMD(identify) failed: Input/output error
 readonly      =  0 (off)
 readahead     = 256 (on)
SG_IO: bad/missing sense data, sb[]:  70 00 05 00 00 00 00 18 00 00 00 00 20 00 00 c0 00 00 00 00 15 0a 00 00 00 00 00 00 00 00 00 00
SG_IO: bad/missing sense data, sb[]:  70 00 05 00 00 00 00 18 00 00 00 00 20 00 00 c0 00 00 00 00 15 0a 00 00 00 00 00 00 00 00 00 00
 HDIO_DRIVE_CMD(identify) failed: Input/output error
 geometry      = 36472/255/63, sectors = 585937500, start = 0
groucho@devuan:~$ 
The fourth drive, an IBM-ESXS GNA073C3ESTT0Z N (BH0D) is also SAS (SPL-3) and shows a similar ouput:

Code: Select all

~$ sudo hdparm /dev/sde
/dev/sde:
SG_IO: bad/missing sense data, sb[]:  70 00 05 00 00 00 00 18 00 00 00 00 20 00 00 c0 00 00 00 00 15 0a 00 00 00 00 00 00 00 00 00 00
SG_IO: bad/missing sense data, sb[]:  70 00 05 00 00 00 00 18 00 00 00 00 20 00 00 c0 00 00 00 00 15 0a 00 00 00 00 00 00 00 00 00 00
 HDIO_DRIVE_CMD(identify) failed: Input/output error
 readonly      =  0 (off)
 readahead     = 256 (on)
SG_IO: bad/missing sense data, sb[]:  70 00 05 00 00 00 00 18 00 00 00 00 20 00 00 c0 00 00 00 00 15 0a 00 00 00 00 00 00 00 00 00 00
SG_IO: bad/missing sense data, sb[]:  70 00 05 00 00 00 00 18 00 00 00 00 20 00 00 c0 00 00 00 00 15 0a 00 00 00 00 00 00 00 00 00 00
 HDIO_DRIVE_CMD(identify) failed: Input/output error
 geometry      = 8924/255/63, sectors = 143374000, start = 0
~$ 
But the two 2.5" SATA drives I have inside the box (ex-portable USB drives) do not:

Code: Select all

~$ sudo hdparm /dev/sda /dev/sdb

/dev/sda:
 multcount     = 16 (on)
 IO_support    =  1 (32-bit)
 readonly      =  0 (off)
 readahead     = 256 (on)
 geometry      = 60801/255/63, sectors = 976773168, start = 0

/dev/sdb:
 multcount     =  1 (on)
 IO_support    =  1 (32-bit)
 readonly      =  0 (off)
 readahead     = 256 (on)
 geometry      = 14593/255/63, sectors = 234441648, start = 0
~$
Maybe the errors are related to the drives having custom firmware from IBM.
Or just because they are SAS drives?
recuperation wrote: 11 Feb 2022, 10:45 Please uses the latest Testdisk ...
I downloaded it last night and ran it the same way I did before, with the exception attempting to write the partiton data to the drive.
Here's the testdisk.log file:

Code: Select all

~/Downloads/testdisk-7.2-WIP$ cat testdisk.log

Fri Feb 11 05:39:41 2022
Command line: TestDisk

TestDisk 7.2-WIP, Data Recovery Utility, Novembre 2020
Christophe GRENIER <grenier@cgsecurity.org>
https://www.cgsecurity.org
OS: Linux, kernel 5.10.0-0.bpo.3-amd64 (#1 SMP Debian 5.10.13-1~bpo10+1 (2021-02-11)) x86_64
Compiler: GCC 4.4
ext2fs lib: 1.42.8, ntfs lib: libntfs-3g, reiserfs lib: 0.3.1-rc8, ewf lib: 20120504, curses lib: ncurses 5.7
/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 support
/dev/sdb: size       234441648 sectors
/dev/sdb: user_max   234441648 sectors
/dev/sdb: native_max 234441648 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 - Hitachi HTS545050A7E380, S/N:TEJ51139GBLN2S, FW:GG2OA7A0
Disk /dev/sdb - 120 GB / 111 GiB - CHS 14593 255 63, sector size=512 - KINGSTON SV300S37A120G, S/N:50026B724A0B05D2, FW:541ABBF0
Disk /dev/sdc - 300 GB / 279 GiB - CHS 36472 255 63, sector size=512 - HITACHI HUS153030VLS300, FW:A410
Disk /dev/sdd - 300 GB / 279 GiB - CHS 36472 255 63, sector size=512 - HITACHI HUS153030VLS300, FW:A410
Disk /dev/sde - 73 GB / 68 GiB - CHS 8924 255 63, sector size=512 - IBM-ESXS GNA073C3ESTT0Z N, FW:BH0D
Disk /dev/sdf - 300 GB / 279 GiB - CHS 36472 255 63, sector size=512 - HITACHI HUS153030VLS300, FW:A410

Partition table type (auto): Intel
Disk /dev/sdf - 300 GB / 279 GiB - HITACHI HUS153030VLS300
Partition table type: Intel

Analyse Disk /dev/sdf - 300 GB / 279 GiB - CHS 36472 255 63
Geometry from i386 MBR: head=255 sector=63
check_part_i386 failed for partition type 83
Current partition structure:
No ext2, JFS, Reiser, cramfs or XFS marker
 1 * Linux                    0  32 33 36472 225 41  585934848
 1 * Linux                    0  32 33 36472 225 41  585934848

search_part()
Disk /dev/sdf - 300 GB / 279 GiB - CHS 36472 255 63

block_group_nr 25

recover_EXT2: "e2fsck -b 819200 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=25/2235, s_mnt_count=12/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 73241856
recover_EXT2: part_size 585934848
Filesystem created: Wed Feb  9 18:14:38 2022
Last mount time:    Wed Feb  9 21:19:46 2022
     Linux                    0  32 33 36472 225 41  585934848 [300Gb]
     ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 299 GB / 279 GiB

Results
   * Linux                    0  32 33 36472 225 41  585934848 [300Gb]
     ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 299 GB / 279 GiB

Hint for advanced users: dmsetup may be used if you prefer to avoid rewriting the partition table for the moment:
echo "0 585934848 linear /dev/sdf 2048" | dmsetup create test0

interface_write()
 1 * Linux                    0  32 33 36472 225 41  585934848 [300Gb]
simulate write!

write_mbr_i386: starting...
write_all_log_i386: starting...
No extended partition

Interface Advanced
Geometry from i386 MBR: head=255 sector=63
check_part_i386 failed for partition type 83
 1 * Linux                    0  32 33 36472 225 41  585934848
Couldn't open reiser filesystem 

 1 * Linux                    0  32 33 36472 225 41  585934848
Can't open filesystem. Filesystem seems damaged.
Couldn't open reiser filesystem 

 1 * Linux                    0  32 33 36472 225 41  585934848
Can't open filesystem. Filesystem seems damaged.

TestDisk exited normally.
~/Downloads/testdisk-7.2-WIP$ 
Thanks in advance.

Best,

JHM

JHMarx
Posts: 5
Joined: 11 Feb 2022, 08:24

Re: Severe damage to ext4 filesystem

#4 Post by JHMarx »

Hello:
recuperation wrote: 11 Feb 2022, 10:45 .. uses the latest Testdisk version.
... un it from a live linux on a USB stick.
As per your suggestion, I ran testdisk again from a Knoppix USB.
Unfortunately, it did not write the partition to the drive.

Here is the content of the testdisk.log file:

Code: Select all

Fri Feb 11 20:59:57 2022
Command line: TestDisk /debug

TestDisk 7.1, Data Recovery Utility, July 2019
Christophe GRENIER <grenier@cgsecurity.org>
https://www.cgsecurity.org
OS: Linux, kernel 5.10.10-64 (#3 SMP PREEMPT Sun Feb 7 09:26:54 CET 2021) x86_64
Compiler: GCC 9.2
ext2fs lib: 1.45.7, ntfs lib: libntfs-3g, reiserfs lib: none, ewf lib: none, curses lib: ncurses 6.1
/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 support
/dev/sdb: size       234441648 sectors
/dev/sdb: user_max   234441648 sectors
/dev/sdb: native_max 234441648 sectors
Warning: can't get size for Disk /dev/mapper/control - 0 B - 0 sectors, sector size=512
Warning: can't get size for Disk /dev/loop0 - 0 B - 0 sectors, sector size=512
Warning: can't get size for Disk /dev/loop1 - 0 B - 0 sectors, sector size=512
Warning: can't get size for Disk /dev/loop2 - 0 B - 0 sectors, sector size=512
Warning: can't get size for Disk /dev/loop3 - 0 B - 0 sectors, sector size=512
Warning: can't get size for Disk /dev/loop4 - 0 B - 0 sectors, sector size=512
Warning: can't get size for Disk /dev/loop5 - 0 B - 0 sectors, sector size=512
Warning: can't get size for Disk /dev/loop6 - 0 B - 0 sectors, sector size=512
Warning: can't get size for Disk /dev/loop7 - 0 B - 0 sectors, sector size=512
Hard disk list
Disk /dev/sda - 500 GB / 465 GiB - CHS 60801 255 63, sector size=512 - Hitachi HTS545050A7E380, S/N:TEJ51139GBLN2S, FW:GG2OA7A0
Disk /dev/sdb - 120 GB / 111 GiB - CHS 14593 255 63, sector size=512 - KINGSTON SV300S37A120G, S/N:50026B724A0B05D2, FW:541ABBF0
Disk /dev/sdc - 300 GB / 279 GiB - CHS 36472 255 63, sector size=512 - HITACHI HUS153030VLS300, FW:A410
Disk /dev/sdd - 300 GB / 279 GiB - CHS 36472 255 63, sector size=512 - HITACHI HUS153030VLS300, FW:A410
Disk /dev/sde - 73 GB / 68 GiB - CHS 8924 255 63, sector size=512 - IBM-ESXS GNA073C3ESTT0Z N, FW:BH0D
Disk /dev/sdf - 300 GB / 279 GiB - CHS 36472 255 63, sector size=512 - HITACHI HUS153030VLS300, FW:A410
Disk /dev/sdg - 15 GB / 14 GiB - CHS 14782 64 32, sector size=512 - Kingston DataTraveler 2.0, FW:1.00

Partition table type (auto): Intel
Disk /dev/sdf - 300 GB / 279 GiB - HITACHI HUS153030VLS300
Partition table type: Intel

Analyse Disk /dev/sdf - 300 GB / 279 GiB - CHS 36472 255 63
Geometry from i386 MBR: head=255 sector=63
check_part_i386 failed for partition type 83
Current partition structure:
No ext2, JFS, Reiser, cramfs or XFS marker
 1 * Linux                    0  32 33 36472 225 41  585934848
 1 * Linux                    0  32 33 36472 225 41  585934848

search_part()
Disk /dev/sdf - 300 GB / 279 GiB - CHS 36472 255 63

block_group_nr 25

recover_EXT2: "e2fsck -b 819200 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=25/2235, s_mnt_count=12/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 73241856
recover_EXT2: part_size 585934848
Filesystem created: Wed Feb  9 16:14:38 2022
Last mount time:    Wed Feb  9 19:19:46 2022
     Linux                    0  32 33 36472 225 41  585934848 [300Gb]
     ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 299 GB / 279 GiB

Results
   * Linux                    0  32 33 36472 225 41  585934848 [300Gb]
     ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 299 GB / 279 GiB

Hint for advanced users: dmsetup may be used if you prefer to avoid rewriting the partition table for the moment:
echo "0 585934848 linear /dev/sdf 2048" | dmsetup create test0

interface_write()
 1 * Linux                    0  32 33 36472 225 41  585934848 [300Gb]
write!

write_mbr_i386: starting...
write_all_log_i386: starting...
No extended partition
Need to fix
 1 * Linux                    0  32 33 36472 225 41  585934848 [300Gb]
     ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 299 GB / 279 GiB
You will have to reboot for the change to take effect.

TestDisk exited normally.

Is there a way to get testdisk to write to the drive?

Thanks in advance.

JHM

recuperation
Posts: 2735
Joined: 04 Jan 2019, 09:48
Location: Hannover, Deutschland (Germany, Allemagne)

Re: Severe damage to ext4 filesystem

#5 Post by recuperation »

JHMarx wrote: 11 Feb 2022, 09:24 For whatever reasons (from carelesness to a USB drive with ID issues) I ended up dd'ing an *.iso image on to a new Toshiba Ultrastar 300Gb SAS HDD containing relatively important stuff.
What are "ID issues"?

I have not removed the tray from cage as it is not written to.
??? This is totally incomprehensible for me.
I did not choose the [Deeper Search] option because I knew it was only one partition on the drive.
Testdisk should find superblock information behind the end of the ISO file (if there is any space left). By not running deep search you might have ignored helpful information.

When you used dd to write to the drive named sdf you must have overwritten the partition table. The partition table of sdf as shown in your log file does not reflect your supposed overwriting transaction as its shows a partition spanning the whole drive.

You either did not manage to write your ISO file or your ISO file contains a protective MBR and a GPT (partition table).
I don't know if ISO file can be set up this way.
Please check if running Testdisk in GPT yields different partition table results.
Is there a way to get testdisk to write to the drive?
I don't know as already smartmontools failed. I have no experience with SAS drives.
You don't need write access to recover your "relative important stuff" anyway.

Run deep search and check the results using the "p"-key ("list files"). You can copy your stuff from there to a healthy other drive.

JHMarx
Posts: 5
Joined: 11 Feb 2022, 08:24

Re: Severe damage to ext4 filesystem

#6 Post by JHMarx »

Hello:
recuperation wrote: 12 Feb 2022, 12:20 What are "ID issues"?
Like I mentioned in my last post:
The problem arose as I used lsblk to re-check the USB drive's asigned letter instead of checking it with gparted.
Big mistake as for some reason the USB drive did not mount and /dev/sdg1 ended up being the SAS drive.
recuperation wrote: 12 Feb 2022, 12:20
I did not choose the [Deeper Search] ...
Testdisk should find superblock information behind the end of the ISO file (if there is any space left). By not running deep search you might have ignored helpful information.
I see.
I'll get to that and post the results.
recuperation wrote: 12 Feb 2022, 12:20 When you used dd to write to the drive named sdf you must have overwritten the partition table.
The partition table of sdf as shown in your log file does not reflect your supposed overwriting transaction as its shows a partition spanning the whole drive.
I see.
recuperation wrote: 12 Feb 2022, 12:20 You either did not manage to write your ISO file ...
Hmm ...
I think I did.

I can mount it and read its contents.

Code: Select all

~$ sudo blkid
--- snip ---
/dev/sdg1: UUID="2021-10-14-13-08-50-00" LABEL="ISOIMAGE" TYPE="iso9660" PTUUID="12a82752" PTTYPE="dos" PARTUUID="563437db-01"
~$

Code: Select all

~$ mount
/dev/sdg1 on /media/groucho/ISOIMAGE type iso9660 (ro,nosuid,nodev,relatime,nojoliet,check=s,map=n,blocksize=2048,uid=1000,gid=1000,dmode=500,fmode=400,uhelper=udisks2)
~$ 
recuperation wrote: 12 Feb 2022, 12:20 ... or your ISO file contains a protective MBR and a GPT (partition table).
I don't know if ISO file can be set up this way.
recuperation wrote: 12 Feb 2022, 12:20 Please check if running Testdisk in GPT yields different partition table results.
I'll do that and post back.
recuperation wrote: 12 Feb 2022, 12:20
Is there a way to get testdisk to write to the drive?
I don't know as already smartmontools failed ...
You don't need write access to recover your "relative important stuff" anyway.
Run deep search and check the results using the "p"-key ("list files"). You can copy your stuff from there to a healthy other drive.
Right.

Thanks so much for your help.

Best,

JHM

JHMarx
Posts: 5
Joined: 11 Feb 2022, 08:24

Re: Severe damage to ext4 filesystem

#7 Post by JHMarx »

Hello:
recuperation wrote: 12 Feb 2022, 12:20 I don't know as already smartmontools failed ...
It would seem that hdparm is not a suitable tool to work with SAS drives.
https://sourceforge.net/p/hdparm/bugs/73/
Mark Lord - 2017-01-17 wrote: Perhaps the two SAS drives do not implement the SATA IDENTIFY command, which is what hdparm is sending them. If they don't have that command, they will fail the request.

sginfo probably sends pure SCSI commands to the drives, which is why it works (SAS drives normally speak SCSI).

hdparm is for ATA/SATA drives, and for any drives/chips that understand ATA/SATA commands (including some USB enclosures).
So I tried sginfo to see what data I would get from the drive:
-a option = Display inquiry info, serial # and all mode pages.
-A option = Similar to '-a' but displays all subpages as well.

I chose -A as probably being the most complete one.

Code: Select all

~$ sudo sginfo -A /dev/sdf
[sudo] password for groucho:
INQUIRY response (cmd: 0x12)
----------------------------
Device Type                        0
Vendor:                    HITACHI
Product:                   HUS153030VLS300
Revision level:            A410

Serial Number '        JHVJXVVC'

Read-Write Error Recovery mode page (0x1)
-----------------------------------------
AWRE                               1
ARRE                               1
TB                                 0
RC                                 0
EER                                0
PER                                0
DTE                                0
DCR                                0
Read Retry Count                   1
Correction Span                    0
Head Offset Count                  0
Data Strobe Offset Count           0
Write Retry Count                  1
Recovery Time Limit (ms)           0

Disconnect-Reconnect mode page (0x2)
------------------------------------
Buffer full ratio                  0
Buffer empty ratio                 0
Bus Inactivity Limit (SAS: 100us)  0
Disconnect Time Limit              0
Connect Time Limit (SAS: 100us)    0
Maximum Burst Size                 0
EMDP                               0
Fair Arbitration (fcp:faa,fab,fac) 0
DIMM                               0
DTDC                               0
First Burst Size                   0

Format Device mode page (0x3)
-----------------------------
Tracks per Zone                    2902
Alternate sectors per zone         0
Alternate tracks per zone          0
Alternate tracks per lu            0
Sectors per track                  1080
Data bytes per physical sector     512
Interleave                         1
Track skew factor                  20
Cylinder skew factor               30
Supports Soft Sectoring            0
Supports Hard Sectoring            1
Removable Medium                   0
Surface                            0

Rigid Disk Geometry mode page (0x4)
-----------------------------------
Number of cylinders                83199
Number of heads                    8
Starting cyl. write precomp        0
Starting cyl. reduced current      0
Device step rate                   0
Landing Zone Cylinder              0
RPL                                0
Rotational Offset                  0
Rotational Rate                    15000

Verify Error Recovery mode page (0x7)
-------------------------------------
EER                                0
PER                                0
DTE                                0
DCR                                0
Verify Retry Count                 1
Verify Correction Span (bits)      0
Verify Recovery Time Limit (ms)    0

Caching mode page (0x8)
-----------------------
Initiator Control                  0
ABPF                               0
CAP                                0
DISC                               0
SIZE                               0
Write Cache Enabled                1
MF                                 0
Read Cache Disabled                0
Demand Read Retention Priority     0
Demand Write Retention Priority    0
Disable Pre-fetch Transfer Length  65535
Minimum Pre-fetch                  0
Maximum Pre-fetch                  65535
Maximum Pre-fetch Ceiling          65535
FSW                                0
LBCSS                              0
DRA                                0
NV_DIS                             0
Number of Cache Segments           8
Cache Segment size                 0
Non-Cache Segment size             0

Control mode page (0xa)
-----------------------
TST                                0
TMF_ONLY                           0
D_SENSE                            0
GLTSD                              0
RLEC                               0
Queue Algorithm Modifier           0
QErr                               0
DQue [obsolete]                    0
TAS                                0
RAC                                0
UA_INTLCK_CTRL                     0
SWP                                0
RAERP [obs.]                       0
UAAERP [obs.]                      0
EAERP [obs.]                       0
ATO                                0
TAS                                0
AUTOLOAD MODE                      0
Ready AER Holdoff Period [obs.]    0
Busy Timeout Period                0
Extended self-test completion time 3593

Control Extension mode subpage (0xa,0x1)
--------------------------------------------
TCMOS                              0
SCSIP                              0
IALUAE                             0
Initial Priority                   0

Notch and Partition mode page (0xc)
-----------------------------------
Notched Drive                      1
Logical or Physical Notch          0
Max # of notches                   36
Active Notch                       0
Starting Boundary                  0x100
Ending Boundary                    0x1456700
Pages Notched                      00000000 0000100c

SAS logical unit mode page (0x18)
----------------------------------------------------
Transport Layer Retries            0

SAS SSP port control mode page (0x19)
-------------------------------------
Ready LED meaning                  0
I_T Nexus Loss time                2000
Initiator response time-out        2000

SAS Phy Control and Discover mode subpage (0x19,0x1)
--------------------------------------------
Number of phys                     2
Phy Identifier                     0
Attached Device type               1
Negotiated Logical Link rate       9
Attached SSP Initiator port        1
Attached STP Initiator port        1
Attached SMP Initiator port        1
Attached SSP Target port           0
Attached STP Target port           0
Attached SMP Target port           0
SAS address                        0x5000cca00d1ec931
Attached SAS address               0x500605b002b27cf1
Attached Phy identifier            3
Programmed Min Physical Link rate  8
Hardware Min Physical Link rate    8
Programmed Max Physical Link rate  9
Hardware Max Physical Link rate    9
Phy Identifier                     1
Attached Device type               0
Negotiated Logical Link rate       0
Attached SSP Initiator port        0
Attached STP Initiator port        0
Attached SMP Initiator port        0
Attached SSP Target port           0
Attached STP Target port           0
Attached SMP Target port           0
SAS address                        0x5000cca00d1ec932
Attached SAS address               0x0000000000000000
Attached Phy identifier            0
Programmed Min Physical Link rate  8
Hardware Min Physical Link rate    8
Programmed Max Physical Link rate  9
Hardware Max Physical Link rate    9

SAS SSP shared protocol specific port mode subpage (0x19,0x2)
-----------------------------------------------------
Power loss timeout(ms)             0

Power Condition mode page (0x1a)
--------------------------------
Idle                               0
Standby                            0
Idle Condition counter (100ms)     0
Standby Condition counter (100ms)  0

Informational Exceptions mode page (0x1c)
-----------------------------------------
PERF                               0
EBF                                0
EWASC                              1
DEXCPT                             0
TEST                               0
EBACKERR                           0
LOGERR                             0
MRIE                               0
Interval Timer                     0
Report Count                       0

Background control mode subpage (0x1c,0x1)
--------------------------------------------
Enable background medium scan      1
Enable pre-scan                    0
BMS interval time (hour)           168
Pre-scan timeout value (hour)      0

mode page: 0x00   [Vendor (non-page format)]
---------------
0x00                               0x80
0x01                               0x0e
0x02                               0x00
0x03                               0x00
0x04                               0x00
0x05                               0x02
0x06                               0x00
0x07                               0x00
0x08                               0x00
0x09                               0x00
0x0a                               0x00
0x0b                               0x30
0x0c                               0x0a
0x0d                               0x0a
0x0e                               0x00
0x0f                               0x00

groucho@devuan:~$
Another tool to use would be sdparm:
https://sg.danny.cz/sg/sdparm.html

I also tried sdparm to see what data I would get from the drive:

Code: Select all

~$ sudo sdparm -all /dev/sdf
    /dev/sdf: HITACHI   HUS153030VLS300   A410
    Direct access device specific parameters: WP=0  DPOFUA=1
Read write error recovery [rw] mode page [PS=1]:
  AWRE          1  [cha: y, def:  1, sav:  1]  Automatic write reallocation enabled
  ARRE          1  [cha: y, def:  1, sav:  1]  Automatic read reallocation enabled
  TB            0  [cha: y, def:  0, sav:  0]  Transfer block
  RC            0  [cha: y, def:  0, sav:  0]  Read continuous
	0: error recovery may cause delays
	1: transfer data without waiting for error recovery
  EER           0  [cha: n, def:  0, sav:  0]  Enable early recovery (obsolete)
	1: increase chance of mis-detection or mis-correction of error
  PER           0  [cha: y, def:  0, sav:  0]  Post error
	0: do not post recovered errors
	1: report recovered errors (via sense key: recovered error)
  DTE           0  [cha: y, def:  0, sav:  0]  Data terminate on error
	1: terminate data transfer when recovered error detected
  DCR           0  [cha: y, def:  0, sav:  0]  Disable correction (obsolete)
  RRC           1  [cha: y, def:  1, sav:  1]  Read retry count
  COR_S         0  [cha: y, def:  0, sav:  0]  Correction span (obsolete)
  HOC           0  [cha: y, def:  0, sav:  0]  Head offset count (obsolete)
  DSOC          0  [cha: y, def:  0, sav:  0]  Data strobe offset count (obsolete)
  LBPERE        0  [cha: n, def:  0, sav:  0]  Logical block provisioning error reporting enabled
  MWR           0  [cha: n, def:  0, sav:  0]  Misaligned write reporting
	0: disabled, don't report
	1: enabled, complete and report
	2: terminate, terminate and report
  WRC           1  [cha: y, def:  1, sav:  1]  Write retry count
  RTL           0  [cha: y, def:  0, sav:  0]  Recovery time limit (ms)
	0: default, -1: 65.5 seconds
Disconnect-reconnect (SPC + transports) [dr] mode page [PS=1]:
  BFR           0  [cha: y, def:  0, sav:  0]  Buffer full ratio
	fraction where this value is numerator, 256 is denominator
  BER           0  [cha: y, def:  0, sav:  0]  Buffer empty ratio
	fraction where this value is numerator, 256 is denominator
  BIL           0  [cha: y, def:  0, sav:  0]  Bus inactivity limit
	for unit see specific transport
  DTL           0  [cha: n, def:  0, sav:  0]  Disconnect time limit
	for unit see specific transport
  CTL           0  [cha: y, def:  0, sav:  0]  Connect time limit
	for unit see specific transport
  MBS           0  [cha: y, def:  0, sav:  0]  Maximum burst size (512 bytes)
  EMDP          0  [cha: n, def:  0, sav:  0]  Enable modify data pointers
	1: target may send data out of order
  FA            0  [cha: n, def:  0, sav:  0]  Fair arbitration
  DIMM          0  [cha: n, def:  0, sav:  0]  Disconnect immediate
  DTDC          0  [cha: n, def:  0, sav:  0]  Data transfer disconnect control
  FBS           0  [cha: n, def:  0, sav:  0]  First burst size (512 bytes)
Format (SBC) [fo] mode page [PS=0]:
  TPZ           2902  [cha: n, def:2902, sav:2902]  Tracks per zone
  ASPZ          0  [cha: n, def:  0, sav:  0]  Alternate sectors per zone
  ATPZ          0  [cha: n, def:  0, sav:  0]  Alternate tracks per zone
  ATPLU         0  [cha: n, def:  0, sav:  0]  Alternate tracks per logical unit
  SPT           1080  [cha: n, def:1080, sav:1080]  Sectors per track
  DBPPS         512  [cha: n, def:512, sav:512]  Data bytes per physical sector
  INTLV         1  [cha: n, def:  1, sav:  1]  Interleave
  TSF           20  [cha: n, def: 20, sav: 20]  Track skew factor
  CSF           30  [cha: n, def: 30, sav: 30]  Cylinder skew factor
  SSEC          0  [cha: n, def:  0, sav:  0]  Soft sector
  HSEC          1  [cha: n, def:  1, sav:  1]  Hard sector
  RMB           0  [cha: n, def:  0, sav:  0]  Removable
  SURF          0  [cha: n, def:  0, sav:  0]  Surface
Rigid disk (SBC) [rd] mode page [PS=0]:
  NOC           83199  [cha: n, def:83199, sav:83199]  Number of cylinders
  NOH           8  [cha: n, def:  8, sav:  8]  Number of heads
  SCWP          0  [cha: n, def:  0, sav:  0]  Starting cylinder for write precompensation
  SCRWC         0  [cha: n, def:  0, sav:  0]  Starting cylinder for reduced write current
  DSR           0  [cha: n, def:  0, sav:  0]  Device step rate
  LZC           0  [cha: n, def:  0, sav:  0]  Landing zone cylinder
  RPL           0  [cha: n, def:  0, sav:  0]  Rotational position locking
  ROTO          0  [cha: n, def:  0, sav:  0]  Rotational offset
  MRR           15000  [cha: n, def:15000, sav:15000]  Medium rotation rate (rpm)
Verify error recovery (SBC) [ve] mode page [PS=1]:
  V_EER         0  [cha: n, def:  0, sav:  0]  Enable early recovery (obsolete) 
  V_PER         0  [cha: y, def:  0, sav:  0]  Post error
  V_DTE         0  [cha: y, def:  0, sav:  0]  Data terminate on error
  V_DCR         0  [cha: y, def:  0, sav:  0]  Disable correction (obsolete)
  V_RC          1  [cha: y, def:  1, sav:  1]  Verify retry count
  V_COR_S       0  [cha: n, def:  0, sav:  0]  Verify correction span (obsolete)
  V_RTL         0  [cha: y, def:  0, sav:  0]  Verify recovery time limit (ms)
Caching (SBC) [ca] mode page [PS=1]:
  IC            0  [cha: y, def:  0, sav:  0]  Initiator control
	0: disk uses own adaptive caching algorithm
	1: disk caching algorithm controlled by NCS or CCS
  ABPF          0  [cha: y, def:  0, sav:  0]  Abort pre-fetch
  CAP           0  [cha: y, def:  0, sav:  0]  Caching analysis permitted
  DISC          0  [cha: y, def:  0, sav:  0]  Discontinuity
	0: pre-fetch truncated or wrapped at time discontinuity
	1: pre-fetch continues across time discontinuity
  SIZE          0  [cha: y, def:  0, sav:  0]  Size enable
	0: number of cache segments (NCS) controls cache segmentation
	1: the cache segment size (CCS) controls cache segmentation
  WCE           1  [cha: y, def:  1, sav:  1]  Write cache enable
  MF            0  [cha: y, def:  0, sav:  0]  Multiplication factor
	0: MIPF and MAPF specify blocks
	1: multiply MIPF and MAPF by blocks in read command
  RCD           0  [cha: y, def:  0, sav:  0]  Read cache disable
  DRRP          0  [cha: y, def:  0, sav:  0]  Demand read retention priority
	0: treat requested and other data equally
	1: replace requested data before other data
	15: replace other data before requested data
  WRP           0  [cha: y, def:  0, sav:  0]  Write retention priority
	0: treat requested and other data equally
	1: replace requested data before other data
	15: replace other data before requested data
  DPTL          -1  [cha: y, def: -1, sav: -1]  Disable pre-fetch transfer length
  MIPF          0  [cha: y, def:  0, sav:  0]  Minimum pre-fetch
  MAPF          -1  [cha: y, def: -1, sav: -1]  Maximum pre-fetch
  MAPFC         -1  [cha: y, def: -1, sav: -1]  Maximum pre-fetch ceiling
  FSW           0  [cha: y, def:  0, sav:  0]  Force sequential write
  LBCSS         0  [cha: y, def:  0, sav:  0]  Logical block cache segment size
	0: CSS unit is bytes; 1: CSS unit is blocks
  DRA           0  [cha: y, def:  0, sav:  0]  Disable read ahead
  SYNC_PROG     0  [cha: n, def:  0, sav:  0]  Synchronous cache progress indication
	0: no pollable sense data during sync
	1: allow pollable sense data, allow all commands during sync
	2: allow pollable sense data, allow some commands during sync
  NV_DIS        0  [cha: n, def:  0, sav:  0]  Non-volatile cache disable
  NCS           8  [cha: y, def:  8, sav:  8]  Number of cache segments
  CSS           0  [cha: y, def:  0, sav:  0]  Cache segment size
Control [co] mode page [PS=1]:
  TST           0  [cha: n, def:  0, sav:  0]  Task set type
	0: lu maintains one task set for all I_T nexuses
	1: lu maintains separate task sets for each I_T nexus
  TMF_ONLY      0  [cha: n, def:  0, sav:  0]  Task management functions only
  DPICZ         0  [cha: n, def:  0, sav:  0]  Disable protection information check if protect field zero
  D_SENSE       0  [cha: n, def:  0, sav:  0]  Descriptor format sense data
  GLTSD         0  [cha: n, def:  0, sav:  0]  Global logging target save disable
  RLEC          0  [cha: n, def:  0, sav:  0]  Report log exception condition
  QAM           0  [cha: y, def:  0, sav:  0]  Queue algorithm modifier
	0: restricted re-ordering; 1: unrestricted
  NUAR          0  [cha: n, def:  0, sav:  0]  No unit attention on release
  QERR          0  [cha: y, def:  0, sav:  0]  Queue error management
	0: only affected task gets CC; 1: affected tasks aborted
	3: affected tasks aborted on same I_T nexus
  RAC           0  [cha: n, def:  0, sav:  0]  Report a check
  UA_INTLCK     0  [cha: n, def:  0, sav:  0]  Unit attention interlocks control
	0: unit attention cleared with check condition status
	2: unit attention not cleared with check condition status
	3: as 2 plus ua on busy, task set full or reservation conflict
  SWP           0  [cha: n, def:  0, sav:  0]  Software write protect
  ATO           0  [cha: y, def:  0, sav:  0]  Application tag owner
  TAS           0  [cha: n, def:  0, sav:  0]  Task aborted status
	0: tasks aborted without response to app client
	1: any other I_T nexuses receive task aborted
  ATMPE         0  [cha: n, def:  0, sav:  0]  Application tag mode page enabled
  RWWP          0  [cha: n, def:  0, sav:  0]  Reject write without protection
  SBLP          0  [cha: n, def:  0, sav:  0]  Supported block lengths and protection information
  AUTOLOAD      0  [cha: n, def:  0, sav:  0]  Autoload mode
	0: medium loaded for full access
	1: loaded for medium auxiliary access only
	2: medium shall not be loaded
  BTP           0  [cha: y, def:  0, sav:  0]  Busy timeout period (100us)
	0: undefined
	0ffffh (-1): unlimited
  ESTCT         3593  [cha: n, def:3593, sav:3593]  Extended self test completion time (sec)
	0ffffh (-1) takes 65535 seconds or longer
Control extension [coe] mode page [PS=1]:
  DLC           0  [cha: n, def:  0, sav:  0]  Device life control
	0: may degrade performance to prolong life
	1: shall not degrade performance
  TCMOS         0  [cha: n, def:  0, sav:  0]  Timestamp changeable by methods outside standard
  SCSIP         0  [cha: n, def:  0, sav:  0]  SCSI timestamp commands take precedence over other methods
  IALUAE        0  [cha: n, def:  0, sav:  0]  Implicit asymmetric logical unit access enabled
  INIT_PR       0  [cha: n, def:  0, sav:  0]  Initial command priority
	0: none or vendor
	1: highest
	15: lowest
  MSDL          0  [cha: n, def:  0, sav:  0]  Maximum sense data length
	0: unlimited
Protocol specific logical unit [pl] mode page [PS=0]:
  LUPID         6  [cha: n, def:  6, sav:  6]  Logical unit's (transport) protocol identifier
	0: fcp; 1: spi; 4: srp; 5: iscsi; 6: sas/spl; 7: adt;
	8: ata/acs; 9: uas; 10: sop
	[try adding '-t <transport>' to get more fields]
Protocol specific port [pp] mode page [PS=1]:
  PPID          6  [cha: n, def:  6, sav:  6]  Port's (transport) protocol identifier
	0: fcp; 1: spi; 4: srp; 5: iscsi; 6: sas/spl; 7: adt;
	8: ata/acs; 9: uas; 10: sop
	[try adding '-t <transport>' to get more fields]
Power condition [po] mode page [PS=1]:
  PM_BG         0  [cha: n, def:  0, sav:  0]  Power management, background functions, precedence
	0: vendor specific; 1: background function higher
	2: power management higher
  STANDBY_Y     0  [cha: n, def:  0, sav:  0]  Standby_y timer enable
  IDLE_C        0  [cha: n, def:  0, sav:  0]  Idle_c timer enable
  IDLE_B        0  [cha: n, def:  0, sav:  0]  Idle_b timer enable
  IDLE          0  [cha: y, def:  0, sav:  0]  Idle_a timer enable
	named IDLE prior to spc4r18, thence IDLE_A
  STANDBY       0  [cha: y, def:  0, sav:  0]  Standby_z timer enable
	named STANDBY prior to spc4r18, thence STANDBY_Z
  ICT           0  [cha: y, def:  0, sav:  0]  Idle_a condition timer (100 ms)
	named IDLE prior to spc4r18, thence IDLE_A
  SCT           0  [cha: y, def:  0, sav:  0]  Standby_z condition timer (100 ms)
	named STANDBY prior to spc4r18, thence STANDBY_Z
Informational exceptions control [ie] mode page [PS=1]:
  PERF          0  [cha: y, def:  0, sav:  0]  Performance (impact of ie operations)
	0: normal (some delays); 1: abridge ie operations
  EBF           0  [cha: y, def:  0, sav:  0]  Enable background function
  EWASC         1  [cha: y, def:  1, sav:  1]  Enable warning
  DEXCPT        0  [cha: y, def:  0, sav:  0]  Disable exceptions
  TEST          0  [cha: y, def:  0, sav:  0]  Test (simulate device failure)
  EBACKERR      0  [cha: y, def:  0, sav:  0]  Enable background (scan + self test) error reporting
  LOGERR        0  [cha: y, def:  0, sav:  0]  Log informational exception errors
  MRIE          0  [cha: y, def:  0, sav:  0]  Method of reporting informational exceptions
	0: no reporting; 1: async reporting (obs); 2: unit attention
	3: conditional recovered error; 4: recovered error
	5: check condition with no sense; 6: request sense only
  INTT          0  [cha: y, def:  0, sav:  0]  Interval timer (100 ms)
  REPC          0  [cha: y, def:  0, sav:  0]  Report count (or Test flag number [SSC-3])
Background control (SBC) [bc] mode page [PS=1]:
  S_L_FULL      0  [cha: y, def:  0, sav:  0]  Suspend on log full
  LOWIR         0  [cha: y, def:  0, sav:  0]  Log only when intervention required
  EN_BMS        1  [cha: y, def:  1, sav:  1]  Enable background medium scan
  EN_PS         0  [cha: y, def:  0, sav:  0]  Enable pre-scan
  BMS_I         168  [cha: y, def:168, sav:168]  Background medium scan interval time (hour)
  BPS_TL        0  [cha: y, def:  0, sav:  0]  Background pre-scan time limit (hour)
  MIN_IDLE      0  [cha: y, def:  0, sav:  0]  Minumum idle time before background scan (ms)
  MAX_SUSP      0  [cha: y, def:  0, sav:  0]  Maximum time to suspend background scan (ms)
~$ 
recuperation wrote: 12 Feb 2022, 12:20 You don't need write access to recover ...
I was referring to TestDisk not writing the partition data it found to the drive.
recuperation wrote: 12 Feb 2022, 12:20 Run deep search and check the results using the "p"-key ("list files"). You can copy your stuff from there to a healthy other drive.
I also ran TestDisk as suggested:

Code: Select all

TestDisk 7.2-WIP, Data Recovery Utility, Novembre 2020
Christophe GRENIER <grenier@cgsecurity.org>
https://www.cgsecurity.org

Disk /dev/sdg - 300 GB / 279 GiB - CHS 36472 255 63
     Partition               Start        End    Size in sectors
>* Linux                    0  32 33 36472 225 41  585934848 [300Gb]

Structure: Ok.  Use Up/Down Arrow keys to select partition.
Use Left/Right Arrow keys to CHANGE partition characteristics:
*=Primary bootable  P=Primary  L=Logical  E=Extended  D=Deleted
Keys A: add partition, L: load backup, T: change type, P: list files,
     Enter: to continue
ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 299 GB / 279 GiB
Selected deeper search and got this:

Code: Select all

TestDisk 7.2-WIP, Data Recovery Utility, Novembre 2020
Christophe GRENIER <grenier@cgsecurity.org>
https://www.cgsecurity.org

Disk /dev/sdg - 300 GB / 279 GiB - CHS 36472 255 63
     Partition               Start        End    Size in sectors
>D Linux                    0  32 33 36472 225 41  585934848 [300Gb]
 D FAT16 LBA             2392  51 28  2457 120 31    1048576 [LIBREELEC]
 D FAT16 LBA             2398 244 23  2415  70 23     262144 [NO NAME]
 D Linux                 2429 141 17  2654  45 15    3608576
 D Linux                 2442 207  6  2667 111  4    3608576
 D Linux                 2476 119 12  2701  23 10    3608576
 D Linux                 2478 129 20  2703  33 18    3608576
 D Linux                 2494 210 21  2719 114 19    3608576
 D Linux                 2518 169 18  2522 189 33      65536 [STORAGE]
 D Linux                 2518 169 20  2522 189 35      65536 [STORAGE]
 D Linux                 2525 204 46  2529 224 61      65536 [STORAGE]
 D FAT12                34279 141 39 34279 206 39       4096 [IBM DFT]

Structure: Ok.  Use Up/Down Arrow keys to select partition.
Use Left/Right Arrow keys to CHANGE partition characteristics:
*=Primary bootable  P=Primary  L=Logical  E=Extended  D=Deleted
Keys A: add partition, L: load backup, T: change type, P: list files,
     Enter: to continue
ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 299 GB / 279 GiB
I selected 'P' and got nothing in any partition.

Does the sginfo and sdparm tools tell you anything useful?
I cannot make heads or tails from it. 8^/

Thanks for your input.

Best,

JHM

Locked