Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: [tlug] automating SCSI (SATA) device add/remove
- Date: Mon, 6 Dec 2010 15:01:51 +0900
- From: Kalin KOZHUHAROV <me.kalin@example.com>
- Subject: Re: [tlug] automating SCSI (SATA) device add/remove
- References: <AANLkTimyuai7h7eJyYSuGXVHGPBqir5bBzJX5v8bgxdC@example.com> <BDAC8152-59C0-46F5-BF50-0D0187746719@example.com>
On Mon, Dec 6, 2010 at 14:33, Jawaad Mahmood <jawaad.mahmood@example.com> wrote: > Would a python script for that help, or are you looking for a command to do it? > > (probably could make a bash shell for the same thing but I've never tried) Hi Jawaad, Well, a script can do it, I happen to run Gentoo most often so Python is installed. But I'd really prefer smarter approach, a command line (assuming I am OK to do the off-by-one math). Cheers, Kalin. > On 2010/12/06, at 14:03, Kalin KOZHUHAROV <me.kalin@example.com> wrote: >> Hi, >> >> I have been pondering for quite some time at easy ways to automate >> adding removal of SATA drives on my system with CLI. >> I use different eSATA enclosures or SATA "drawers". >> >> Adding usually happens automatic, unless the drive happens to take too >> long to initialize... then I have to find the device (`dmesg`), then >> for a message like this: >> >> [451944.216906] ata5: hard resetting link >> >> I have to do: >> echo "- - -" >/sys/class/scsi_host/host4/scan >> (see the off-by-one, ata5 is host4) >> >> >> When I want to properly stop the drive before removing it, I have to do: >> hdparm -Y /dev/sdc >> echo 1 >/sys/bus/scsi/devices/host4/target4\:0\:0/4\:0\:0\:0/delete >> >> Now, I got lost in /sys many times and I need help .... I guess there >> is a shorter way from /dev/sdc to xyz/delete >> >> Can you point me to an easier way/command to do the following: >> >> 1. (attach) When I see "ata5: hard resetting link" do COMMAND ata5 and >> have it rescan the host >> 2. (detach) When I want to detach sdf, do COMMAND2 sdf and have it >> powered down and remove the device from kernel Cheers, Kalin.
- Follow-Ups:
- Re: [tlug] automating SCSI (SATA) device add/remove
- From: Taisuke Yamada
- References:
- [tlug] automating SCSI (SATA) device add/remove
- From: Kalin KOZHUHAROV
- Re: [tlug] automating SCSI (SATA) device add/remove
- From: Jawaad Mahmood
Home | Main Index | Thread Index
- Prev by Date: Re: [tlug] automating SCSI (SATA) device add/remove
- Next by Date: Re: [tlug] automating SCSI (SATA) device add/remove
- Previous by thread: Re: [tlug] automating SCSI (SATA) device add/remove
- Next by thread: Re: [tlug] automating SCSI (SATA) device add/remove
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links