Slashdot Mirror


Hot-Swapping IDE Drives?

Patman asks: "I've recently taken a new job where I'll need to be making drive images and such for quite a few IDE drives - say a few a day. I need the ability to 'hot-swap' IDE drives into a running Linux or Windows system. The systems that I'm using are fairly standard IBM desktop PCs, I've found references on Google to IDE->USB converter cables and IDE->USB converter boxes. Does anyone have experience with those? Some come with drivers for Windows - has anyone used them under Linux? Does the mass storage USB code deal with them accurately? Barring that, does anyone have any other ideas? External hot-swapping would be ideal, although an internal solution would be doable, too."

19 of 122 comments (clear)

  1. Delayed write bug in Win2k by ka9dgx · · Score: 4, Informative
    There seems to be a deep seated bug in Windows 2000 server when it comes to delayed writes and USB. The USB spec calls for a maximum transfer of 128k, but Win2k attempts a 512k trasfer after it's cached up a few writes, which results in "Delayed Write Failure", and lost files.

    I can't seem to find any fix, the driver software doesn't permit caching to be disabled in the advanced properties box, so it's rendered an otherwise fine 120 GB Western Digital drive as an expensive paper weight, at least as far as Windows is concerned.

    From what I've been able to read, it appears that Linux knows better, and respects the 128k per packet limit, and doesn't have this issue, but I've not confirmed that yet.

    It's a bitch to be doing a backup (using copy) of 45 Gb of photos, and lose a few along the way.

    --Mike--

    1. Re:Delayed write bug in Win2k by lindsayt · · Score: 2, Informative

      I could be wrong, but by my understanding is that there's no such thing as a "true 40gb usb drive(s)" - the actual drives being made today either have (S/P)ATA, SCSI or FC as their interface/communication spec, and even the "true" usb drives are just simply IDE drives in a usb enclosure.

      Of course, the units sold as USB drives are engineered for a specific drive to work with a specific enclosure so hopefully they'll avoid the issues you discuss through some other means (such as a proprietary driver that fixes it or something), but I am relatively certain that if you pop open any of the USB drives being sold (hence voiding your warranty) you'll find a regular old IDE drive inside, probably not even with a separate part number from the IDE drives sold bare.

      --
      I did not design this game/I did not name the stakes/I just happen to like apples/And I am not afraid of snakes-AniD
    2. Re:Delayed write bug in Win2k by fluor2 · · Score: 2, Informative

      I've hotswapped IDE-disks dozens of times.

      1. Run Sync.exe (i'm sure you'll find it at download.com or something)
      2. Remove/disable the device in Device Manager (right click My Computer, Manage).
      3. Now disconnect your drive.
      4. Connect a new IDE drive.
      5. Go search for new hardware and it pops up.

    3. Re:Delayed write bug in Win2k by vofka · · Score: 2, Informative

      I see similar problems here with a Western Digital 250GB Dual USB2.0/Firewire drive under Slackware 9.1 with the stock 2.4.23 kernel.

      The strangest thing I see is that the drive seems to disconnect from the USB bus, and then reconnects around 2 seconds later. I have still to work out if this is caused by a hardware problem with the drive, with the motherboard (an Abit AT7-MAX), or with the kernel.

      I also see timeouts, failed sector reads/writes, and other errors from the SCSI Subsystem. These only seem to happen after the drive does it's first USB Disconnect/Reconnect, and then only if the drive was mounted at the time... The drive can go for hours with no problem, or it can drop out after 30 minutes or so. It doesn't seem to make any difference whether there is data heading to/from the drive or not!

      When I get time, I'll be upgradeing the kernel to 2.4.24/25 to see if any of the USB / USB-Storage updates fix the problems. I would love to move to 2.6 to see if any of the changes there are of use, but I can't afford to put the 8-Disk 640GB RAID-0 array on the motherboard out of commission!

      If that doesn't fix it, I guess it will come down to hardware... A quick post to LKML probably wouldn't hurt though...

      --
      Disclaimer: I meant what I thought, not what I wrote! What? You can't read my Mind? Oh dear!
  2. FireWire by haunebu · · Score: 3, Informative

    Wouldn't FireWire be better, considering FireWire-IDE bridge enclosures are readily available and actual throughput is much faster usig the Oxford 911/922 chipsets?

    --

    Blue skies, Barthy Burgers, girls...

  3. Re:I tried that once.... by man_ls · · Score: 3, Informative

    I've hot-swapped (both add and remove) IDE interface drives in WinXP with no problem.

    My guess is you removed the data cable before removing the power.

    Procedure to Remove Fixed Hard Disks:
    1. Remove Power Cable from Drive
    2. Remove Data Cable from Drive
    3. Scan for Hardware Changes in Device Manager.

    No data loss will occur as long as no open file handles are present on the disk at the time of removal. Windows XP will detect and gracefully dismount/remove references to it. If there are open file handles, data in the write cache will be lost, and WinXP will freeze up for a few minutes while waiting for the IDE timeout.

    Procedure to Add a Fixed Disk:
    1. Connect Data Cable
    2. Connect Power Cable
    3. Scan for Hardware Changes in Device Manager

    Windows will read the drive signature and make it available under My Computer.

  4. Buffering Bug in Linux by Crutcher · · Score: 4, Informative

    Okay, I use a USB drive enclosure on Linux to do my backups, and it works pretty well.

    However, it took me a very long time to learn to set the 'sync' option in the mount options. USB writes much more slowly than a normal harddrive, and if sync isn't set, it is possible for the system to buffer all writes to the drive up to the point where it consumes most system memory, and the machine becomes unresponsive.

    Perhaps this is fixed in 2.6; but it doesn't really matter. You are doing backups, the backup isn't done until it's all on the disk, so setting the sync option just means that your writes "seem" to take longer, and your unmount at the end seems faster. Without sync, you pay for the buffering in the unmount, which will hang while it finishes syncing the disk.

    --

    -- Crutcher --
    #include <disclaimer.h>
    1. Re:Buffering Bug in Linux by Col.+Klink+(retired) · · Score: 2, Informative

      I believe this bug is fixed if 2.4 line. I'm using 2.4.24, but I think it's been around since 2.4.21 or earlier.

      You have to select "Code maturity level options" and say "y" to "Prompt for development and/or incomplete code/drivers". Then, under "SCSI support", say "y" to "Enable extra checks in new queueing code".

      CONFIG_EXPERIMENTAL=y
      CONFIG_SCSI_DEBUG_QUEUES= y

      --

      -- Don't Tase me, bro!

  5. Re:To what end? by Red+Pointy+Tail · · Score: 2, Informative

    Yeah, been using two of these 3ware cages (plus their Raid5 IDE controller) to RAID5 8 drives for months, quite a joy. You can pull out one of the drives mid-anything and watch the hot spare kick into gear.

    Their online tech support is quite good too, replies within 1 working day.

  6. Re:Firewire by rf600r · · Score: 2, Informative

    I'm here to second the FireWire proposal. Be sure you get a controller with an Oxford 9xx chipset and go to it. OtherWorld Computing has some great enclosures, decent prices and good customer service.

  7. Hot swap enclosure by Anonymous Coward · · Score: 2, Informative

    Can't you stop being a cheapskate and just buy a proper hotswap enclosure?

    If you can't afford that then a Firewire enclosure will be good enough for what you're trying to do. Make SURE to stop the device before unplugging it! You can buy Firewire dongle devices like the DriveDock from WiebeTECH as you'll be wanting to unplug and plug lots of drives.

  8. Re:I tried that once.... by jpop32 · · Score: 3, Informative

    If there are open file handles, data in the write cache will be lost, and WinXP will freeze up for a few minutes while waiting for the IDE timeout.

    IMHO, removing or disabling the drive from device manager should ensure you have no open files and flush the cache.

  9. Use IDE-Raid: 3Ware will do the job for you! by darkfox · · Score: 3, Informative

    Go to 3Ware

    It is really well supported in Linux (and been since a while) as well as in M$. It supports Hot-Swap and Hot-Spare...

    --
    Francis Provencher
    "What if the bird will
    1. Re:Use IDE-Raid: 3Ware will do the job for you! by RedDirt · · Score: 2, Informative

      I'd be curious about which card you have that is so bad. I've used 3Ware products for a while now and have had zero problems with the cards themselves. RedHat on a 3Ware card has periodically been problematic (early 7.x releases wouldn't boot because RedHat broke the module mapping in their installer - https://bugzilla.redhat.com/bugzilla/show_bug.cgi? id=26954) Not the fault of the card, but rather the installer. *shrug* I've since replaced that 6200 card with an 8506 (two-port parallel ATA to a four-port serial ATA) and it has continued to work flawlessly.

      If you do a search on RedHat's bugzilla on 3Ware https://bugzilla.redhat.com/bugzilla/buglist.cgi?s hort_desc_type=allwordssubstr&short_desc=3ware&ord er=Bug+Number+Ascending you'll see that most of the bugs relate to the installer and to their enterprise product. They seem to be testing their consumer-grade stuff with 3Ware more consistently now, but are dropping the ball with their enterprise stuff. A quick search on Google for issues with 3Ware and Debian didn't turn up much so a change in distro might be appropriate (just to spark off the obligatory flame war - hehe, just kidding).

      Since 3Ware has been very active in the development of their driver (moreso than ANY other manufacturer) I would be surprised to find any lingering problems that weren't the fault of the distribution.

      --
      James
  10. Windows XP has an option for Firewire. by Futurepower(R) · · Score: 5, Informative

    Windows XP has an option for not caching Firewire writes. You can then just remove and reconnect the drive without any other adjustment and without data loss. If you have audio on, there is a tone when the drive is connected or disconnected.

  11. FYI: As far as drivers go... by Ayanami+Rei · · Score: 2, Informative

    2000 Professional and Server are the exact same thing

    Forget drivers... the only difference is the productID when installing. The install CD contains the exact same files, and the service packs are exactly the same. Hell, they even use the same kernel binary.
    It just artificially limits the number of CPUs and RAM.

    So whatever is true for Professional will automatically be true for Server, and vice versa.

    You should really be looking at something centralized like Retrospect (which isn't too expensive, unlimited clients). Or DVD-Rs.

    And tapes can work great. You just have to figure out how to justify spending over $6000 to get an AIT-3 drive or something.

    --
    THIS THING CAN TURN ON A DIME, MACROSSZERO STYLE ALSO FUCK BETA, ~NYORON
  12. okay with identical drives by bobv-pillars-net · · Score: 2, Informative
    I've hot-swapped regular parallel-ATA drives in removable drive bay enclosures with no problem.
    1. Unmount the partition
    2. Unlock the drive cartridge (this powers down the drive)
    3. Remove the old cartridge and insert the new one
    4. Lock the drive cartridge
    5. Mount the partition

    But since this method doesn't force a bios scan, it hangs if the drives have different disc/cyl/head geometries, or different partition sizes.

    --
    The Web is like Usenet, but
    the elephants are untrained.
  13. Re:I tried that once.... by schapman · · Score: 5, Informative

    theres a reason not to do this... If you look at SATA, one of the reasons its safe to hot-swap is that on the power connector, the pins are different lengths. This way, when u connect/disconnect, you wont have shorts happening. I think its the ground connector on the power cable that connects first, disconnects last... Old school PATA devices dont have this, so every time you connect/disconnect while running... you have the risk of shorting and blowing your drive/MB

    --
    Wouldnt you like to be a pepper too?
  14. Comment removed by account_deleted · · Score: 2, Informative

    Comment removed based on user account deletion