linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* removing AHCI SATA devices
@ 2011-02-22 16:05 Simon Mcnair
  2011-02-22 21:36 ` Jeff Garzik
  0 siblings, 1 reply; 6+ messages in thread
From: Simon Mcnair @ 2011-02-22 16:05 UTC (permalink / raw)
  To: linux-raid

hi all,
Whilst I am aware that with AHCI and SATAII I can just unplug a HDD at
will what is the correct process for doing a 'clean' dismount ?

Since MD is a layer over the top of the physical device how can you
ensure with certainty that all data has been flushed and the device
removal is clean ?

The advice I was given was that if I unmount the filesystem it'll be
fine, but I don't like the messages I get in dmesg:

ata5: exception Emask 0x10 SAct 0x0 SErr 0x4090000 action 0xe frozen
ata5: irq_stat 0x00400040, connection status changed
ata5: SError: { PHYRdyChg 10B8B DevExch }
ata5: hard resetting link
ata5: SATA link down (SStatus 0 SControl 300)
ata5: hard resetting link
ata5: SATA link down (SStatus 0 SControl 300)
ata5: limiting SATA link speed to 1.5 Gbps
ata5: hard resetting link
ata5: SATA link down (SStatus 0 SControl 310)
ata5.00: disabled
ata5: EH complete
ata5.00: detaching (SCSI 5:0:0:0)
scst: Detached from scsi5, channel 0, id 0, lun 0, type 0
sd 5:0:0:0: [sdd] Synchronizing SCSI cache
sd 5:0:0:0: [sdd] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
sd 5:0:0:0: [sdd] Stopping disk
sd 5:0:0:0: [sdd] START_STOP FAILED
sd 5:0:0:0: [sdd] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK

do I need to do:
echo 1 > /sys/block/sdd/device/delete
or follow:
http://tldp.org/HOWTO/archived/SCSI-Programming-HOWTO/SCSI-Programming-HOWTO-4.html
(Dynamically insert and remove SCSI devices)
or something else completely ? (or just put up with it ?)

Some advice would be appreciated.

regards
Simon

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: removing AHCI SATA devices
  2011-02-22 16:05 removing AHCI SATA devices Simon Mcnair
@ 2011-02-22 21:36 ` Jeff Garzik
  2011-02-23  8:27   ` Simon McNair
  0 siblings, 1 reply; 6+ messages in thread
From: Jeff Garzik @ 2011-02-22 21:36 UTC (permalink / raw)
  To: Simon Mcnair; +Cc: linux-raid

On 02/22/2011 11:05 AM, Simon Mcnair wrote:
> hi all,
> Whilst I am aware that with AHCI and SATAII I can just unplug a HDD at
> will what is the correct process for doing a 'clean' dismount ?
>
> Since MD is a layer over the top of the physical device how can you
> ensure with certainty that all data has been flushed and the device
> removal is clean ?

Simply unplugged the hard drive's SATA cable should be fine.

	Jeff




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: removing AHCI SATA devices
  2011-02-22 21:36 ` Jeff Garzik
@ 2011-02-23  8:27   ` Simon McNair
  2011-02-23 10:54     ` hansbkk
  2011-02-23 11:19     ` John Robinson
  0 siblings, 2 replies; 6+ messages in thread
From: Simon McNair @ 2011-02-23  8:27 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: linux-raid

thanks Jeff.   It just seems like a hit and miss solution (no way of 
knowing all data has been written to and that the device has been 
unmounted from all filesystems).  I kinda expected some kind of 'it is 
safe to remove /dev/sdb' in dmesg.

cheers
Simon

On 22/02/2011 21:36, Jeff Garzik wrote:
> On 02/22/2011 11:05 AM, Simon Mcnair wrote:
>> hi all,
>> Whilst I am aware that with AHCI and SATAII I can just unplug a HDD at
>> will what is the correct process for doing a 'clean' dismount ?
>>
>> Since MD is a layer over the top of the physical device how can you
>> ensure with certainty that all data has been flushed and the device
>> removal is clean ?
>
> Simply unplugged the hard drive's SATA cable should be fine.
>
>     Jeff
>
>
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: removing AHCI SATA devices
  2011-02-23  8:27   ` Simon McNair
@ 2011-02-23 10:54     ` hansbkk
  2011-02-23 11:19     ` John Robinson
  1 sibling, 0 replies; 6+ messages in thread
From: hansbkk @ 2011-02-23 10:54 UTC (permalink / raw)
  To: simonmcnair; +Cc: linux-raid

Just check it yourself before pulling the drive.

If you have lots of volumes mounted:

mount | grep sdN



On Wed, Feb 23, 2011 at 3:27 PM, Simon McNair <simonmcnair@gmail.com> wrote:
> thanks Jeff.   It just seems like a hit and miss solution (no way of knowing
> all data has been written to and that the device has been unmounted from all
> filesystems).  I kinda expected some kind of 'it is safe to remove /dev/sdb'
> in dmesg.
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: removing AHCI SATA devices
  2011-02-23  8:27   ` Simon McNair
  2011-02-23 10:54     ` hansbkk
@ 2011-02-23 11:19     ` John Robinson
  2011-02-23 16:21       ` Roberto Spadim
  1 sibling, 1 reply; 6+ messages in thread
From: John Robinson @ 2011-02-23 11:19 UTC (permalink / raw)
  To: simonmcnair; +Cc: linux-raid

On 23/02/2011 08:27, Simon McNair wrote:
> thanks Jeff. It just seems like a hit and miss solution (no way of
> knowing all data has been written to and that the device has been
> unmounted from all filesystems). I kinda expected some kind of 'it is
> safe to remove /dev/sdb' in dmesg.

I think `eject /dev/sdb` will do what you want - if it's safe to pull, 
it'll exit immediately and silently, but if it or any of its partitions 
are still associated with any filesystem or md device, and the drive 
can't safely be ejected/unplugged, it'll complain.

Cheers,

John.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: removing AHCI SATA devices
  2011-02-23 11:19     ` John Robinson
@ 2011-02-23 16:21       ` Roberto Spadim
  0 siblings, 0 replies; 6+ messages in thread
From: Roberto Spadim @ 2011-02-23 16:21 UTC (permalink / raw)
  To: John Robinson; +Cc: simonmcnair, linux-raid

i fail disk with mdadm, remove the from computer, insert again add
disk to md array, and continue using

2011/2/23 John Robinson <john.robinson@anonymous.org.uk>:
> On 23/02/2011 08:27, Simon McNair wrote:
>>
>> thanks Jeff. It just seems like a hit and miss solution (no way of
>> knowing all data has been written to and that the device has been
>> unmounted from all filesystems). I kinda expected some kind of 'it is
>> safe to remove /dev/sdb' in dmesg.
>
> I think `eject /dev/sdb` will do what you want - if it's safe to pull, it'll
> exit immediately and silently, but if it or any of its partitions are still
> associated with any filesystem or md device, and the drive can't safely be
> ejected/unplugged, it'll complain.
>
> Cheers,
>
> John.
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-raid" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>



-- 
Roberto Spadim
Spadim Technology / SPAEmpresarial
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-02-23 16:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-22 16:05 removing AHCI SATA devices Simon Mcnair
2011-02-22 21:36 ` Jeff Garzik
2011-02-23  8:27   ` Simon McNair
2011-02-23 10:54     ` hansbkk
2011-02-23 11:19     ` John Robinson
2011-02-23 16:21       ` Roberto Spadim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).