Skip to content

Instantly share code, notes, and snippets.

@jonasrosland
Last active August 3, 2020 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonasrosland/576aa85f679e643fabfb36f0f6f31a9e to your computer and use it in GitHub Desktop.
Save jonasrosland/576aa85f679e643fabfb36f0f6f31a9e to your computer and use it in GitHub Desktop.
sg_raw tests

Drive tests for OpCode: 0xF1

Download required binaries:

For Windows:

For RHEL-based Linux:

For Debian-based Linux:

Run the tests

For Windows:

  • Put the .bat file into the directory of the unzipped sg3_utils
  • Run the .bat file

For Linux:

  • Run the .sh file after installing the binaries
@echo off
set /p drive_letter=Enter the drive letter for your ODD to test if it supports OpCode: 0xF1:
set /p ODD=Enter the model name of your ODD:
sg_raw -v -r 2352 -R %drive_letter%: F1 06 00 00 00 00 00 00 0b 00 -o "Last read sector - %ODD%.bin"
sg_raw -v -r 2352 -R %drive_letter%: F1 06 00 00 0b 00 00 00 0b 00 -o "Last read sector + 1 - %ODD%.bin"
sg_raw -v -r 2352 -R %drive_letter%: F1 06 00 00 16 00 00 00 0b 00 -o "Last read sector + 2 - %ODD%.bin"
sg_raw -v -r 2352 -R %drive_letter%: F1 06 00 00 21 00 00 00 0b 00 -o "Last read sector + 3 - %ODD%.bin"
sg_raw -v -r 2352 -R %drive_letter%: F1 06 00 00 2c 00 00 00 0b 00 -o "Last read sector + 4 - %ODD%.bin"
sg_raw -v -r 2352 -R %drive_letter%: F1 06 00 00 37 00 00 00 0b 00 -o "Last read sector + 5 - $ODD.bin"
sg_raw -v -r 2352 -R %drive_letter%: F1 06 00 00 42 00 00 00 0b 00 -o "Last read sector + 6 - $ODD.bin"
sg_raw -v -r 2352 -R %drive_letter%: F1 06 00 00 4d 00 00 00 0b 00 -o "Last read sector + 7 - $ODD.bin"
#!/bin/bash
echo "Enter the drive path (/dev/sr0) for your ODD to test if it supports OpCode: 0xF1:"
read drive_path
echo Enter the model name of your ODD:
read ODD
sg_raw -v -r 2352 -R $drive_path F1 06 00 00 00 00 00 00 0b 00 -o "Last read sector - $ODD.bin"
sg_raw -v -r 2352 -R $drive_path F1 06 00 00 0b 00 00 00 0b 00 -o "Last read sector + 1 - $ODD.bin"
sg_raw -v -r 2352 -R $drive_path F1 06 00 00 16 00 00 00 0b 00 -o "Last read sector + 2 - $ODD.bin"
sg_raw -v -r 2352 -R $drive_path F1 06 00 00 21 00 00 00 0b 00 -o "Last read sector + 3 - $ODD.bin"
sg_raw -v -r 2352 -R $drive_path F1 06 00 00 2c 00 00 00 0b 00 -o "Last read sector + 4 - $ODD.bin"
sg_raw -v -r 2352 -R $drive_path F1 06 00 00 37 00 00 00 0b 00 -o "Last read sector + 5 - $ODD.bin"
sg_raw -v -r 2352 -R $drive_path F1 06 00 00 42 00 00 00 0b 00 -o "Last read sector + 6 - $ODD.bin"
sg_raw -v -r 2352 -R $drive_path F1 06 00 00 4d 00 00 00 0b 00 -o "Last read sector + 7 - $ODD.bin"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment