2002-01-23 20:02:50

by Max

[permalink] [raw]
Subject: hot IDE change

This question is more about hardware, but is also related to Linux.
If I have a harddisk, plugged into the motherboard (IDE cable and power),
can I turn it off, plugging out first power cable, then IDE cable.
Can it harm harddisk or motherboard?
If I can do it, then will Linux detect it back, if I make this
operation back: i.e. plug IDE cable, then power cable.

Best regards.


2002-01-23 20:13:14

by Ed Sweetman

[permalink] [raw]
Subject: Re: hot IDE change

On Wed, 2002-01-23 at 18:05, ertzog wrote:
> This question is more about hardware, but is also related to Linux.
> If I have a harddisk, plugged into the motherboard (IDE cable and power),
> can I turn it off, plugging out first power cable, then IDE cable.
> Can it harm harddisk or motherboard?
> If I can do it, then will Linux detect it back, if I make this
> operation back: i.e. plug IDE cable, then power cable.
>
> Best regards.


it's possible, yes. and yes linux will do what you need to do. The
question is can you do it without breaking anything.

2002-01-23 20:56:58

by Richard B. Johnson

[permalink] [raw]
Subject: Re: hot IDE change

On Wed, 23 Jan 2002, ertzog wrote:

> This question is more about hardware, but is also related to Linux.
> If I have a harddisk, plugged into the motherboard (IDE cable and power),
> can I turn it off, plugging out first power cable, then IDE cable.
> Can it harm harddisk or motherboard?
> If I can do it, then will Linux detect it back, if I make this
> operation back: i.e. plug IDE cable, then power cable.
>
> Best regards.
>

Linux doesn't care as long as it has been dismounted.

BUT! When you remove power to the drive by pulling its plug, you
are now pulling all those bits low. The IDE interface is just a
transceiver. The controller is in the drive. You may have just
glitched or crashed a bus. This may eventually cause an OOPS or
just make the machine stop.

So, you decide to pull the IDE cable first. Well, if you made
sure that all active bits were disconnected at the same time,
(grin), maybe you can get away with it.

Next stop. Now you have to pull out the power plug making sure
that the ground pins are not disconnected before either of the
voltages, and the two voltages are removed at the same time.
Failure to do this can (read will) generate spurious writes to
the disk media.

Now, do you want to plug in another drive? If the five-volts
isn't present before the +12V, you may back-feed the 5-volt
logic through its protection diodes. If this generates enough
voltage to start up the electronics, you can end up with
strange states that may prevent the disk from ever starting.
This can burn out the transistors that drive the pancake-motor
winding.

I certainly suggest that you turn off the power before you
muck with IDE drives. SCSI is different. It's message-based.
There is no physical connection to your PC's internals, only
logical. With robust SCSI controllers, designed for hot-swapping,
you don't have to worry. Even non-hot-swappable drives and
controllers can survive lots of power-on activity. It is, however,
possible to permanently damage a SCSI disk if you connect the
power plug in such a way that the +12 volts (the yellow wire) makes
a connection first before the +5 volts. Hot-swap trays and connectors
prevent this.

Cheers,
Dick Johnson

Penguin : Linux version 2.4.1 on an i686 machine (797.90 BogoMips).

I was going to compile a list of innovations that could be
attributed to Microsoft. Once I realized that Ctrl-Alt-Del
was handled in the BIOS, I found that there aren't any.


2002-01-23 21:15:18

by Petr Vandrovec

[permalink] [raw]
Subject: Re: hot IDE change

On 23 Jan 02 at 15:56, Richard B. Johnson wrote:
> > This question is more about hardware, but is also related to Linux.
> > If I have a harddisk, plugged into the motherboard (IDE cable and power),
> > can I turn it off, plugging out first power cable, then IDE cable.
> > Can it harm harddisk or motherboard?
> > If I can do it, then will Linux detect it back, if I make this
> > operation back: i.e. plug IDE cable, then power cable.
>
> Linux doesn't care as long as it has been dismounted.

Do not forget to run 'sync' after you dismount it.

> So, you decide to pull the IDE cable first. Well, if you made
> sure that all active bits were disconnected at the same time,
> (grin), maybe you can get away with it.

My non-hotpluggable bay first disconnect power, and it works fine,
every friday evening for more than two years... But I have this
device alone on its cable, so there is no traffic when I disconnect it.
And I probably lost warranty by doing that.

> Now, do you want to plug in another drive? If the five-volts
> isn't present before the +12V, you may back-feed the 5-volt
> logic through its protection diodes. If this generates enough

Unless something changed behind my back, do not do it. As kernel
have no idea that you removed drive, it will not invalidate its
caches. Maybe you could workaround this (at least you have to ask
it to rescan partition table), but I decided to not plug IDE HDD into
machine when kernel runs. So I reboot my system on each Monday morning,
and I plug hdd in when BIOS checks memory. It resets your uptime to zero,
but as I upgrade kernel much more often, it is not a big problem.

Only problem I had were ATAPI devices. There is stupid paragraph about
creating `virtual' slave when none is present, in the ATAPI standard,
and so even if you plug HDD into the box as a slave to ATAPI device,
you'll not see it until you powercycle your ATAPI device... At least
my Chineese CDROM behaves that way, so I put it on its own cable.
Best regards,
Petr Vandrovec
[email protected]


2002-01-23 21:18:28

by Matus Horvath

[permalink] [raw]
Subject: RE: hot IDE change

> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]]On Behalf Of ertzog
> Sent: Thursday, January 24, 2002 12:05 AM
> To: [email protected]
> Subject: hot IDE change
>
>
> This question is more about hardware, but is also related to Linux.
> If I have a harddisk, plugged into the motherboard (IDE cable
> and power),
> can I turn it off, plugging out first power cable, then IDE cable.
> Can it harm harddisk or motherboard?

This is exactly how I broke my CD-ROM drive - just hot-unplugged a
disk on the same IDE cable. IDE is really not meant for hotplugging.
It may work for a while (as it worked for me) but I would not try it (again).

---
Matus Horvath
[email protected]

?:.?˛???m???ka??b???zwm??b????˛???m?b??????z_???^n?r???z???h?????&???z??z?ޗ?+??+zf???h???~????i?????????z_???j:+v???)ߣ?m?S?y??杶????i??????????i

2002-01-23 21:26:38

by John Heil

[permalink] [raw]
Subject: Re: hot IDE change

On Wed, 23 Jan 2002, ertzog wrote:

> Date: Wed, 23 Jan 2002 23:05:19 +0000 (GMT)
> From: ertzog <[email protected]>
> To: [email protected]
> Subject: hot IDE change
>
> This question is more about hardware, but is also related to Linux.
> If I have a harddisk, plugged into the motherboard (IDE cable and power),
> can I turn it off, plugging out first power cable, then IDE cable.
> Can it harm harddisk or motherboard?
> If I can do it, then will Linux detect it back, if I make this
> operation back: i.e. plug IDE cable, then power cable.
>
> Best regards.

Linux will do this fine but it wears on the south bridge mainly and the
disk secondarily. Typically the disk is the sturdier of the two.
Assuming you unmounted it first, your may get anywhere from 20 to 300+
successful removals depending on the sb chip ie how much abuse it can
endure. Then you start getting disk errors that are initially recovered
but eventually hang your box. The south bridge ide channel and possibly
the disk too, will be hosed.


>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>

-
-----------------------------------------------------------------
John Heil
South Coast Software
Custom systems software for UNIX and IBM MVS mainframes
1-714-774-6952
[email protected]
http://www.sc-software.com
-----------------------------------------------------------------

2002-01-23 22:02:08

by Wakko Warner

[permalink] [raw]
Subject: Re: hot IDE change

> This question is more about hardware, but is also related to Linux.
> If I have a harddisk, plugged into the motherboard (IDE cable and power),
> can I turn it off, plugging out first power cable, then IDE cable.
> Can it harm harddisk or motherboard?
> If I can do it, then will Linux detect it back, if I make this
> operation back: i.e. plug IDE cable, then power cable.

I've read what everyone else has said about this. The one guy talking about
the pins and power has some good points. For me, I've always yanked the ide
cable before the power and made sure the drive was powered and spinning
before applying the ide cable. I have a machine at work dedicated for this
kind of thing.

anyway, from the linux side, as others have said, make sure it's unmounted.
On my dedicated box at work, it's nfs mounted and the ide driver is a
module. I'm always sure to remove the modules before removing the disk.

When compiled in, it's trickier. the source to hdparm has a script in the
contrib directory that allows you to turn off and back on an ide controller.
It won't do that if the disk is currently in use. You have to do this
before it will find another drive (ideally, turning off that channel,
swapping drive, turning back on) I've used this on my laptop that has a
hotswap cdrom.

--
Lab tests show that use of micro$oft causes cancer in lab animals

2002-01-24 09:22:50

by Allan Sandfeld

[permalink] [raw]
Subject: Re: hot IDE change

On Wednesday 23 January 2002 23:07, Wakko Warner wrote:
> > This question is more about hardware, but is also related to Linux.
> > If I have a harddisk, plugged into the motherboard (IDE cable and power),
> > can I turn it off, plugging out first power cable, then IDE cable.
> > Can it harm harddisk or motherboard?
> > If I can do it, then will Linux detect it back, if I make this
> > operation back: i.e. plug IDE cable, then power cable.
>
> I've read what everyone else has said about this. The one guy talking
> about the pins and power has some good points. For me, I've always yanked
> the ide cable before the power and made sure the drive was powered and
> spinning before applying the ide cable. I have a machine at work dedicated
> for this kind of thing.
>
> anyway, from the linux side, as others have said, make sure it's unmounted.
> On my dedicated box at work, it's nfs mounted and the ide driver is a
> module. I'm always sure to remove the modules before removing the disk.
>
> When compiled in, it's trickier. the source to hdparm has a script in the
> contrib directory that allows you to turn off and back on an ide
> controller. It won't do that if the disk is currently in use. You have to
> do this before it will find another drive (ideally, turning off that
> channel, swapping drive, turning back on) I've used this on my laptop that
> has a hotswap cdrom.

Maybe ask it to spin down before cutting the power will be even better?
Also the cable issues are not a problem if you have a controller meant for
hotplugging (IDE RAID-controllers)

-Allan