Announcement

Collapse
No announcement yet.

Proper way to plug/unplug an eSATA hard disk?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #11
    @justsumdood:

    that was the exact same way I did it - up until NOW


    with kernel 3.3 rc3 & rc4 (afaik it worked with 3.2)

    I only get the following:

    [ 2093.960134] ata8: exception Emask 0x10 SAct 0x0 SErr 0x990000 action 0xe frozen
    [ 2093.960139] ata8: irq_stat 0x00400000, PHY RDY changed
    [ 2093.960144] ata8: SError: { PHYRdyChg 10B8B Dispar LinkSeq }
    [ 2093.960151] ata8: hard resetting link
    [ 2094.681797] ata8: SATA link down (SStatus 0 SControl 300)
    [ 2099.673242] ata8: hard resetting link
    [ 2099.977646] ata8: SATA link down (SStatus 0 SControl 300)
    [ 2099.977660] ata8: limiting SATA link speed to 1.5 Gbps
    [ 2104.969034] ata8: hard resetting link
    [ 2105.273515] ata8: SATA link down (SStatus 0 SControl 310)
    [ 2105.273528] ata8.00: disabled
    [ 2105.273544] ata8: EH complete
    [ 2105.273553] ata8.00: detaching (SCSI 7:0:0:0)
    [ 2105.274064] sd 7:0:0:0: [sde] Synchronizing SCSI cache
    [ 2105.274094] sd 7:0:0:0: [sde] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
    [ 2105.274100] sd 7:0:0:0: [sde] Stopping disk
    [ 2105.274108] sd 7:0:0:0: [sde] START_STOP FAILED
    [ 2105.274111] sd 7:0:0:0: [sde] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK


    that means when after that I plug in another harddrive and power it up - it won't be recognized

    the controller is the (in)famous Jmicron 36x (dunno 368 or 363, something)


    the same happens when stopping via sdparm and remounting read-only (sdparm -C stop -r /dev/foo )


    any idea how to get it recognize the new disk ?
    Last edited by kernelOfTruth; 22 February 2012, 11:02 AM.

    Comment


    • #12
      Verify with
      Code:
      # lspci -k
      that ahci is the driver in use for your SATA chipset, and not pata_jmicron or worse. Only ahci will give you hotplug function.

      Comment


      • #13
        Originally posted by An(noymous)droid View Post
        What then do you do on the software side before unplugging? Is it a simple "umount /dev/sd"[drive letter]?
        I'd say the safest way would be to first issue a umount to the (e)SATA device you want to remove...this will ensure all data has been written to the device and the inodes are updated so the device has a "clean" filesystem. Once that's done you can then power off the device and unplug it.

        This should be applicable to USB sticks as well but as there's no need to power them off you can unplug after unmounting them.

        Comment


        • #14
          Part of the specs

          Part of the specs for USB and SATA is hot-plugging, however it is very prudent to unmount a (any) file-system before powering it down or removing it.

          Comment


          • #15
            Originally posted by chithanh View Post
            Verify with
            Code:
            # lspci -k
            that ahci is the driver in use for your SATA chipset, and not pata_jmicron or worse. Only ahci will give you hotplug function.
            thanks !

            I'm pretty sure that the pata port isn't connected:

            03:00.0 SATA controller: JMicron Technology Corp. JMB362/JMB363 Serial ATA Controller (rev 03)
            Subsystem: Acer Incorporated [ALI] Device 036b
            Kernel driver in use: ahci
            03:00.1 IDE interface: JMicron Technology Corp. JMB362/JMB363 Serial ATA Controller (rev 03)
            Subsystem: Acer Incorporated [ALI] Device 036b
            Kernel driver in use: pata_jmicron
            but it probably won't hurt to remove the driver all-together from the kernel

            afaik it's set to ahci in bios - but I'll check again later that it's really the case

            (strangely it actually has to be ahci since it worked before)

            dmesg | grep AHCI
            [ 0.759598] ahci 0000:00:1f.2: AHCI 0001.0300 32 slots 6 ports 3 Gbps 0x3f impl SATA mode
            [ 0.782563] ahci 0000:03:00.0: AHCI 0001.0000 32 slots 2 ports 3 Gbps 0x3 impl SATA mode






            Originally posted by DeepDayze View Post
            I'd say the safest way would be to first issue a umount to the (e)SATA device you want to remove...this will ensure all data has been written to the device and the inodes are updated so the device has a "clean" filesystem. Once that's done you can then power off the device and unplug it.

            This should be applicable to USB sticks as well but as there's no need to power them off you can unplug after unmounting them.
            I wouldn't rely on solely un-mounting

            todays harddrives have huge caches after all


            my procedure usually goes:

            sync && sdparm -C sync /dev/foo

            then I unmount and issue the same again


            * after that it can be stopped & remounted via sdparm

            or sent to standby

            * via hdparm -Y /dev/foo

            Comment


            • #16
              eSata is basically SATA with implemented hot-plug interface at ends of the data and power wires. This is same as with normal hot-swap hdd drive bays.
              This is one of two technical requirements. Other requirement is that your chipset supports it too. Once that is done, it becomes easy.


              Disable disk write cache and profit from ability to survive sudden removal; or keep disk write cache enabled and benefit from performance - but be absolutely sure to never remove the drive without unmounting. Your choice.

              Then - just umount and remove. Done.

              I would recommend full ext4 jornaling on such drives. You can disable barrier option if you disable write cache. You can also disable barrier if your drive is attached to RAID controller with permanent cache.

              The only reason FS journaling is disabled on flash media is due to additional wear-off.

              Originally posted by An(noymous)droid View Post
              What I've read thus far says it should be power down first before pulling off wire.
              This is the reason why part of SATA upgrade form IDE was modified power connector. You noticed that it has much more lanes than old molex, yet needs exactly the same 4 wires from molex? This is due to SATA power cable to implementing physical powerdown/powerup hotswapping.
              This is the only difference between Molex and SATA power connectors.

              But data cable should implement that too hardware-side. As well as controller.
              Last edited by crazycheese; 22 February 2012, 04:32 PM.

              Comment


              • #17
                Originally posted by RealNC View Post
                eSATA is always hotpluggable.
                Not true. But eSATA controllers without hotplug are rare nowadays. Most motherboards of today also support hotplug when connecting an eSATA bracket to an onboard SATA port.
                Originally posted by chithanh View Post
                Only ahci will give you hotplug function.
                Also not true.
                Here is a page about the features supported by SATA controllers: https://ata.wiki.kernel.org/articles...ures_8af2.html
                Your AMD and JMicron SATA controllers both support AHCI hotplug according to that page. But there are also controllers listed using another driver than AHCI with hotplug support. Nearly every controller has hotplug, apart from some old, rare or embedded ones.
                That JMicron chip is indeed confusing: it has a SATA and a PATA part. The one with ahci driver is SATA and the one with pata_jmicron is PATA.

                About hot unplug. If you use Gnome you can right-click the drive in Nautilus > Safely remove. After that, just disconnect the data & power cables. That might probably work better.

                You have two SATA controllers in your computer, one in the AMD chipset and a JMicron chip. Perhaps you can somehow connect the disk to the other controller?
                Last edited by AlbertP; 22 February 2012, 04:55 PM.

                Comment


                • #18
                  Study this link

                  Comment


                  • #19
                    Please study this

                    Comment


                    • #20
                      A little out of date

                      Considering that UUID is used now.

                      Comment

                      Working...
                      X