vymeny HDD

Petr Konecny pekon na decibel.fi.muni.cz
Úterý Únor 23 23:28:17 CET 1999


Zdravím,

 :: mam suplik a HDD, chci ho vymenovat a nechcu restartovat pocitac, jak na
 :: to? Napadlo mne asi toto.
 :: Koupim prodluzku na napajeni supliku a pridelam na ni vypinac vsech
 :: ctyrech dratu. Vypnu napajeni supliku, zasunu suplik, zapnu napajeni
 :: a disk se rozjede

 k: Funguje to temer bez problemu - prosim dalsi dotazy na toto tema smerujete
 k: na pekon na fi.muni.cz - tim jej donutite, aby to zdokumentoval a udelal z
 k: toho nejaky
 k: pouzitelny balik :-)

No tak když je o to takový zájem, tak jsem vyrobil popis toho jak ten
hot-swap IDE disk realizuju. Je to anglicky, protože jsou i jedinci v
cizině, kteří o to mají zájem. Zatím tam nemám licenci, ale pracuju na
tom :-)

BTW: když něco napíšu v cizině, vztahuje se na to český autorský zákon ?

 k: muzete
 k: se dostat do nemalych problemu ktere by mohly skoncit reformatem celeho
 k: disku a vim proc to rikam :-)

Případně jeho vyhozením spolu s dalším diskem a základní deskou :-)

						Petr

p.s.: jo, ještě URL: http://www.fi.muni.cz/~pekon/hotide-0.1.tgz

--
Your mouse has moved. Windows has to reboot for changes to take effect.

------------- další část ---------------
		How to make (almost) hot swap IDE drive
		---------------------------------------

Legal stuff: Information in this file comes from my personal
experience. It may or may not work on your system. Moreover by using the
method described here you decrease expected lifetime of your disk and
you decrease MTBF of your system. You may increase uptime though :-)

I am not responsible for any damage it may cause. You have been warned.

-------------------------------------------------------------------------
I will describe my personal experience with removing and inserting of
IDE drives while the system (Linux) is up. First the description of my
setup:

1. HD is inserted in a removable box. This box has one big SCSI-like
connector in the back.

2. The box inside the computer is connected as the only device to the
cable of second IDE channel.

3. The drive is setup as slave although master or single should work
too. At least under Linux.

4. I have hdparm utility and my HD supports sleep mode.

5. Kernel has "Support for removable IDE interfaces (PCMCIA)" -
CONFIG_BLK_DEV_IDE_PCMCIA=y

Recent 2.{1,2} kernels meet the last condition by default. You can check
if it is supported by 'egrep "T ide_(un)?register$" System.map'. Of
course System.map should match to your kernel.

My implementation requires that you have support for modules in your
kernel. Though I belive that it is possible to do it in some other, more
complicated way. However if you do not have support for modules you are
on your own, I cannot help you.

-----------------------------------------------------------------------
Steps to remove HD:

1. Make sure that no partition from the HD you want to remove is in use.
I use command "grep '^/dev/hd[cd][0-9]*' /proc/mounts". If you do not
use second IDE channel or you do not have /proc filesystem you need to
change it.

2. Tell the hard drive to turn off (sleep) : hdparm -Y /dev/hdd
   (or whatever IDE channel you use)

3. Tell Linux that you do not need to use the IDE channel with the
harddrive to be removed. This is done via call to ide_unregister
function with number of channel as its argument (ide0,ide1).  Beware,
this is _not_ system call, thus we need modules.

4. Check if Linux understood, hint: grep "ide1$" /proc/devices

5. Remove the harddrive. Do it carefully, first unlock the lock then
wait couple of seconds then remove the box.

---------------------------------------------------------------------
Steps to insert HD:

-1. Tell Linux that you do not need to use the IDE channel with the
harddrive to be inserted. See step 3 of removing.

0. See step 4 of removing.

If you are inserting the drive immediatelly after removing it, you can
skip these steps of course.

1. Insert the harddrive. Do it carefully, slowly insert then wait couple
of seconds and finally lock the box.

2. Tell Linux that you need to use the IDE channel. This is done via
call to ide_register with proper arguments (ioport,2nd ioport,irq). In
my case it is (0x170,0x376,15). Now the Linux should detect the drive
and write some messages to log(s). See /var/log/messages or dmesg.

3. Check if the disk was properly detected. I do it by
"hdparm -i /dev/hdd". This should write some meaningful information
about the disk. If it writes something weird _REMOVE_ the drive (starting
by step 2) and try it again. DO NOT try to mount the drive if it writes
garbage.

-----------------------------------------------------------------------
I have written two simple kernel modules that fit to my setting. You
will probably need to modify some numbers in them.  I have also a script
that does some basic checks and automatizes the operation.

I would like to Zdenek Kabelac <kabi na fi.muni.cz>, who kindly followed
my IRC instructions and juggled with harddrives and reset buttons,
while I was sitting here in my office about 6743 kilometers away.

Petr Konecny <pekon na fi.muni.cz>


Další informace o konferenci Linux