Contribute
Register

Hard Drive corruption when ejecting another OS drive inside High Sierra

Joined
May 31, 2014
Messages
97
Motherboard
Gigabyte x99 ud4
CPU
i7-5820K
Graphics
GTX 1080 Ti
Mac
  1. iMac
Mobile Phone
  1. Android
OK, so I have A hackintosh running High Sierra On my X99. I also have another internal drive/ssd running windows 10.
In hackintosh my Win10 drive shows up as another drive, so yesterday I ejected it in High sierra just to save it running basicaly and to not click on it by accident. Thought it would be fine to eject this as Im not running the Operating system.
However, when I came to restart the system and load win10, a scan popped up saying it was fixing a corrupt system and began repairing itself before booting successfully into win10.
Has anyone else experienced this? Is it not possible to eject other drives in High Sierra without corrupting them?
 
Assuming this is an internal drive, i.e. connected to a motherboard SATA port or PCIe M.2 connector/adapter card, you should never eject it from within macOS.

Unless, it is mounted in an IcyDock enclosure (or similar HDD/SSD enclosure) and you want to physically remove the Windows 10 drive while macOS is still running.
 
Thanks. Yes, I thought it would be OK to just have it power down and eject, but obviously it doesn't work the same as ejecting an external drive or like when windows powers down an internal drive.
 
Just came across a post on a pc site that said sata drives are hot swappable and as long as the drive is ejected it can be removed while the pc is still active and not corrupt the data.
Which makes me wonder why it doesn't work in hackintosh?
Maybe it only applies to hdd? Not ssd's?
I did notice the other mechanical drives seemed to have no problem. I could hear them all power down and non of the sata drives except for the ssd reported a problem.
Maybe ssd's don't power down the same?
 
First you need to remember that macOS doesn’t work the same as Windows.
What works in Windows isn’t necessarily going to work in macOS

Internal drives should never be ejected/hot swapped in macOS.

Ejecting external drives is fine.
 
Just came across a post on a pc site that said sata drives are hot swappable and as long as the drive is ejected it can be removed while the pc is still active and not corrupt the data.
Which makes me wonder why it doesn't work in hackintosh?
Maybe it only applies to hdd? Not ssd's?
I did notice the other mechanical drives seemed to have no problem. I could hear them all power down and non of the sata drives except for the ssd reported a problem.
Maybe ssd's don't power down the same?
In my experience there's no problem with electing and disconnecting internal connection SATA drives on macOS.

The problem is that reconnecting the drive doesn't work because the OS doesn't (hand-waving) handle an event that gets the SATA driver to reattach. (I'm begging the question.)

Modern mainboards may provide an option to enable hot swap on internal SATA ports, but unless the OS is expecting the capability...?

At the next level down here are some factors to consider:

The SATA device connectors are designed so that signaling transitions are electrically orderly.

The device designers have certainly thought about spontaneous power transitions for the device internal logic. But devices are constantly evolving. 10–12 years ago consumer SATA SSDs (e.g. OCZ) were known to be missing key integrity circuitry so a spontaneous power loss was a risk to internal state beyond the scope of the file system journal.

In the big picture, we should keep our thinking open to the distinction of design intentions, versus using a device in manner beyond its design scope that just so happens to work. For example, internal SATA hot disconnect might work 99999 out of 100000 times and so seem practical for the rest of your life. But when the practice is sampled by thousands of users, someone is guaranteed to go wrong; 1 out of 100000 looks like bad odds in an installed base of tens of millions. We can imagine that the system implementors might minimize risk quite well, but it just doesn't work because the design didn't account for it. Therefore eSATA.

What this means for your question:

Devices tend to tolerate spontaneous power cycles.

In the worst case of a user's no-eject disconnection, the event is logically the same as spontaneous power failure. Should be safe.

For journaled file systems, the journal ensures file system state integrity: partial transactions are abandoned according to the journal. Should be safe.
Of course data for incomplete transactions is lost.

FAT32 volumes are not journaled, but may be operate more synchronously and atomically so cleanup at restart is very reliable.

Given macOS APFS system containers that are not currently running (e.g., mounting a second system drive) multiple volumes within the system container are implied by a mount. So a proper eject should consider the whole container. My belief is that unless there are macOS bugs, passive macOS system containers should not be any more risky with user eject than an orderly shutdown.

I've never seen a glitch with HFS+ Journaled internal SATA disconnection.

But how will you get the system to reattach?
 
Interesting. I didn't have a problem re-connecting/mounting the drives as in disk utility they were there but greyed out and just clicked mount disk and they were back.
I had done this a few times on the hackintosh with other drives that were running windows ntfs file system. The mechanical hdd didn't seem to have a problem being ejected under mac, but on booting back into my windows 10 drive on a Samsung evo 850 2tb, it was not happy with being ejected in mac previously and went into a repair as it said some of the files were corrupted. Eek!!
 
Using Paragon's 'NTFS for Mac' might get you around this issue. As it allows you to mount and unmount NTFS drives in macOS.


This is paid for software, but available as a trial so you can see if it is helpful or not.
 
In my experience there's no problem with electing and disconnecting internal connection SATA drives on macOS.

The problem is that reconnecting the drive doesn't work because the OS doesn't (hand-waving) handle an event that gets the SATA driver to reattach. (I'm begging the question.)

Modern mainboards may provide an option to enable hot swap on internal SATA ports, but unless the OS is expecting the capability...?

At the next level down here are some factors to consider:

The SATA device connectors are designed so that signaling transitions are electrically orderly.

The device designers have certainly thought about spontaneous power transitions for the device internal logic. But devices are constantly evolving. 10–12 years ago consumer SATA SSDs (e.g. OCZ) were known to be missing key integrity circuitry so a spontaneous power loss was a risk to internal state beyond the scope of the file system journal.

In the big picture, we should keep our thinking open to the distinction of design intentions, versus using a device in manner beyond its design scope that just so happens to work. For example, internal SATA hot disconnect might work 99999 out of 100000 times and so seem practical for the rest of your life. But when the practice is sampled by thousands of users, someone is guaranteed to go wrong; 1 out of 100000 looks like bad odds in an installed base of tens of millions. We can imagine that the system implementors might minimize risk quite well, but it just doesn't work because the design didn't account for it. Therefore eSATA.

What this means for your question:

Devices tend to tolerate spontaneous power cycles.

In the worst case of a user's no-eject disconnection, the event is logically the same as spontaneous power failure. Should be safe.

For journaled file systems, the journal ensures file system state integrity: partial transactions are abandoned according to the journal. Should be safe.
Of course data for incomplete transactions is lost.

FAT32 volumes are not journaled, but may be operate more synchronously and atomically so cleanup at restart is very reliable.

Given macOS APFS system containers that are not currently running (e.g., mounting a second system drive) multiple volumes within the system container are implied by a mount. So a proper eject should consider the whole container. My belief is that unless there are macOS bugs, passive macOS system containers should not be any more risky with user eject than an orderly shutdown.

I've never seen a glitch with HFS+ Journaled internal SATA disconnection.

But how will you get the system to reattach?

There's another aspect that might well be included in this discussion ...

There is a big difference between "ejecting" and "unmounting".

Unmounting is still electrically connected. Often used by the system to repair volumes that have to be isolated to fix.
 
That's a good point.
 
Back
Top