From: "BuraphaLinux Server" <buraphalinuxserver@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: SCSI vs SATA
Date: Mon, 23 Jul 2007 17:52:31 +0700 [thread overview]
Message-ID: <5d75f4610707230352j69b2ba53g1564e420fc64ea49@mail.gmail.com> (raw)
Hello,
I have had a hard time determining if /dev/sda is SCSI or SATA
from my boot scripts. It matters for smartd which needs an added
parameter -d sat in the configuration file for SATA drives. Finally I
came up with this, but I wonder if there is a better way? It appears
that
vendor is "ATA " (5 trailing spaces) for SATA. If the kernel is
ever fixed to show proper vendor information (Maxtor, Seagate,
whatever) then how can I know if /dev/sda is SCSI or SATA from a bash
script? When flaming me, please also include the proper solution.
Thanks.
#! /bin/bash
drive="sda"
vendor=$(</sys/block/${drive}/device/vendor)
if [[ "${vendor}" = "ATA " ]]
then
printf "SATA\n"
else
printf "SCSI\n"
fi
exit 0
next reply other threads:[~2007-07-23 10:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-23 10:52 BuraphaLinux Server [this message]
2007-07-23 11:00 ` Michael Tokarev
2007-07-23 11:12 ` Rene Herman
[not found] <fa.SvaaC7eLt94EpLFzyKwtVPKbm3s@ifi.uio.no>
2007-07-23 16:26 ` Robert Hancock
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5d75f4610707230352j69b2ba53g1564e420fc64ea49@mail.gmail.com \
--to=buraphalinuxserver@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®