GithubHelp home page GithubHelp logo

Comments (1)

vonericsen avatar vonericsen commented on July 19, 2024

Hi @BillyCrook,
In openSeaChest, you can display the handles with the block handles (hard drives only, may not work properly on tapes, cds, etc) adding -F sd on the command line, so there's already a way to do this today.
There is also an option to show the relationship between sd and sg adding -F sgtosd to be similar to the output of lsscsi -g.
Full example: openSeaChest_Basics -s -F sd

Now, the difference between SG and SD is that SD is a block handle, really only meant for read/write and SG is a generic interface to send any commands you want.
You can specify /dev/sd? handles to these tools as well as other opensource tools without an issue because of the mapping provided by the Linux kernel, version 2.7+. In earlier versions of the kernel, this mapping was not available so only SG could be used for SG passthrough and SD for read/write and possibly other legacy methods.
The main reason openSeaChest defaults to SG instead of SD is because of customer reported problems with the power control tools to show the current power mode.
Whenever the handle was opened as /dev/sd?, the drive would be spun up, but this did not happen with /dev/sg? to the same device. When I debugged this issue with a SATA bus analyzer, I found that there were other commands being sent to the drive and spinning it up at the call to open the handle. The best reason I could come up for this behavior is that because SD is a block handle, meant for read and write, the OS was making sure the drive is in an active state and ready to process any further read/write commands as quickly as possible.
The solution that I came up with for this issue is when a /dev/sd? handle is received, openSeaChest will map it to the matching /dev/sg? handle on the system using the sysfs.

from openseachest.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.