In a Mac OS X 10.7.5 (Lion) system with two internal SATA drives, the internal drives are connected via a Highpoint Rocketraid controller and are configured without any RAID thus operating in legacy mode.
Both locally attached SATA hard disk drives are not mounted after the Mac is powered up after a power failure/interruption (unclean shutdown). On the next clean reboot the two local volumes are mounted.
When the drive/volume has no read/write activity, then the volume fails to mount. In case there is no I/O activity on the drive/volume then the drive/volume will mount.
Both local volumes are identical:
$ diskutil info disk2s1
Device Identifier: disk2s1
Device Node: /dev/disk2s1
Part of Whole: disk2
Device / Media Name: Untitled 1
Volume Name: A
Escaped with Unicode: A
Mounted: Yes
Mount Point: /Volumes/A
Escaped with Unicode: /Volumes/A
File System Personality: HFS+
Type (Bundle): hfs
Name (User Visible): Mac OS Extended
Owners: Enabled
Partition Type: Apple_HFS
OS Can Be Installed: No
Media Type: Generic
Protocol: SCSI
SMART Status: Not Supported
Volume UUID: 45D248ED-29E3-3344-8B62-4E43499568CE
Total Size: 3.0 TB (3000592979456 Bytes) (exactly 5860533163 512-Byte-Blocks)
Volume Free Space: 3.0 TB (2997719433216 Bytes) (exactly 5854920768 512-Byte-Blocks)
Device Block Size: 512 Bytes
Read-Only Media: No
Read-Only Volume: No
Ejectable: Yes
Whole: No
Internal: No
Partial log:
Jul 12 10:32:48 nl3 kernel[0]: jnl: disk3s2: replay_journal: from: 4367872 to: 5375488 (joffset 0x1c3000)
Jul 12 10:32:48 nl3 kernel[0]: jnl: disk3s2: journal replay done.
Jul 12 10:32:49 nl3 kernel[0]: hfs: Removed 0 orphaned / unlinked files and 329 directories
Jul 12 15:26:15 nl3 kernel[0]: disk3s2: device/channel is not attached.
Jul 12 15:26:15 nl3 kernel[0]: /Volumes/Time Machine] [FSLogMsgID 381179371] [FSLogMsgOrder Last]
Jul 12 15:26:15 nl3 kernel[0]: disk3s2: device/channel is not attached.
Jul 12 15:26:15: --- last message repeated 10 times ---
Jul 12 15:26:15 nl3 kernel[0]: jnl: disk3s2: do_jnl_io: strategy err 0x6
Jul 12 15:26:15 nl3 kernel[0]: jnl: disk3s2: write_journal_header: error writing the journal header!
Jul 12 15:26:15 nl3 kernel[0]: disk3s2: device/channel is not attached.
Jul 12 15:26:15: --- last message repeated 48 times ---
Jul 12 15:26:15 nl3 kernel[0]: 2309.inProgress/.Backup.363792189.590451.log] [FSLogMsgID 662186116] [FSLogMsgOrder Last]
Jul 12 15:26:15 nl3 kernel[0]: disk3s2: device/channel is not attached.
Jul 12 15:26:16: --- last message repeated 76 times ---
Jul 12 15:26:16 nl3 kernel[0]: 0451.log] [FSLogMsgID 860380055] [FSLogMsgOrder Last]
Jul 12 15:26:16 nl3 kernel[0]: disk3s2: device/channel is not attached.
Jul 12 15:26:20: --- last message repeated 56 times ---
Jul 12 15:26:20 nl3 kernel[0]: disk3s2: media is not present.
Jul 12 15:26:20: --- last message repeated 7 times ---
Jul 12 15:26:20 nl3 kernel[0]: jnl: disk3s2: close: journal 0x602ed30, is invalid. aborting outstanding transactions
Jul 12 15:29:00 nl3 kernel[0]: jnl: disk3s2: replay_journal: from: 4588544 to: 4118528 (joffset 0x1d9000)
Jul 12 15:29:01 nl3 kernel[0]: jnl: disk3s2: journal replay done.
Jul 12 15:47:16 nl3 kernel[0]: jnl: disk3s2: do_jnl_io: strategy err 0xdisk3s2: device/channel is not attached.
Jul 12 15:47:16 nl3 kernel[0]: 6
Jul 12 15:47:16 nl3 kernel[0]: jnl: disk3s2: write_journal_header: error writing the journal header!
Jul 12 15:47:16 nl3 kernel[0]: disk3s2: device/channel is not attached.
Jul 12 15:47:24: --- last message repeated 15 times ---
Jul 12 15:47:24 nl3 kernel[0]: disk3s2: media is not present.
Jul 12 15:47:24: --- last message repeated 18 times ---
Jul 12 15:47:24 nl3 kernel[0]: jnl: disk3s2: close: journal 0x602ed30, is invalid. aborting outstanding transactions
/dev/rdisk3s2: fsck_hfs run at Thu Jul 12 15:55:59 2012
/dev/rdisk3s2: ** /dev/rdisk3s2 (NO WRITE)
/dev/rdisk3s2: Executing fsck_hfs (version diskdev_cmds-540.1~25).
QUICKCHECK ONLY; FILESYSTEM DIRTY
/dev/rdisk3s2: fsck_hfs run at Thu Jul 12 15:55:59 2012
/dev/rdisk3s2: ** /dev/rdisk3s2
/dev/rdisk3s2: Executing fsck_hfs (version diskdev_cmds-540.1~25).
/dev/rdisk3s1: fsck_hfs run at Thu Jul 12 16:01:55 2012
/dev/rdisk3s1: ** /dev/rdisk3s1 (NO WRITE)
/dev/rdisk3s1: Executing fsck_hfs (version diskdev_cmds-540.1~25).
QUICKCHECK ONLY; FILESYSTEM CLEAN
And both drives have an identical GUID partitioning schema and HFS+ file system:
$ diskutil list
/dev/disk0
#: TYPE NAME SIZE IDENTIFIER
...
/dev/disk1
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *3.0 TB disk1
1: Apple_HFS J 3.0 TB disk1s1
/dev/disk2
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *3.0 TB disk2
1: Apple_HFS A 3.0 TB disk2s1
How to automatically mount these hard drives automatically after an unclean shutdown?
Best Answer
Boot script
The best thing I can come up with, is a script that will run at boot, and will check whether each Apple_HFS TYPE of volume (disk*s*) is mounted. When the volume isn't mounted, try to repair and mount the volume.
Script commands explained
List local HFS volumes
The
diskutil list
command is used to retrieve all local volumes that contain an Apple HFS file system. For example:Is volume mounted?
The
df -lnh
command is used to check whether that volume is mounted. When the volume is not mounted, the command returns no (empty) output. And when the volume is mounted, the output is like:Step by step installation
Create bash script (version #2)
Paste this text into the editor and save it.
Set the permissions of the script for root access only
Make the script readable and executable for all users
Make the script admin writeable and executable
Test run the script
Create a .plist file for launchd to run on boot
And paste this text into the editor window.
Change launchd plist permissions
Load the plist into launchd
Confirm that the plist is loaded
If the plist name appears, like:
it’s installed.
Stop running script on boot
To remove the .plist, in other words stop the script from being run at boot, type the following:
All in one line - copy and paste - installation