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
~$
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
---
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
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
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
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
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"
~$
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.
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
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
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 ---
~$
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:~$
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