How To: Run SpinRite on a UEFI-only machine (Part 4B of 5 - MacOS as base OS)

  • Be sure to checkout “Tips & Tricks”
    Dear Guest Visitor → Once you register and log-in please checkout the “Tips & Tricks” page for some very handy tips!

    /Steve.
  • BootAble – FreeDOS boot testing freeware

    To obtain direct, low-level access to a system's mass storage drives, SpinRite runs under a GRC-customized version of FreeDOS which has been modified to add compatibility with all file systems. In order to run SpinRite it must first be possible to boot FreeDOS.

    GRC's “BootAble” freeware allows anyone to easily create BIOS-bootable media in order to workout and confirm the details of getting a machine to boot FreeDOS through a BIOS. Once the means of doing that has been determined, the media created by SpinRite can be booted and run in the same way.

    The participants here, who have taken the time to share their knowledge and experience, their successes and some frustrations with booting their computers into FreeDOS, have created a valuable knowledgebase which will benefit everyone who follows.

    You may click on the image to the right to obtain your own copy of BootAble. Then use the knowledge and experience documented here to boot your computer(s) into FreeDOS. And please do not hesitate to ask questions – nowhere else can better answers be found.

    (You may permanently close this reminder with the 'X' in the upper right.)

Scott

Well-known member
Sep 18, 2020
168
43
This How To article is in multiple parts:
  1. Introduction
  2. Using Windows to Go as the base OS for your bootable VirtualBox system
  3. Using Kubuntu Linux as the base OS for your bootable VirtualBox system
  4. Using MacOS as the base OS for your bootable VirtualBox system
    1. Part 4A - Setting up the MacOS drive, Installing VirtualBox, Running VirtualBox as "root"
    2. Part 4B - Creating a SpinRite Virtual Machine, Mapping the Host drives to the SR Virtual Machine, Steps to take when using your MacOS drive on a new Target Machine (this article)
  5. Downloading or Creating your VM and moving files in and out of the virtual drive

C. Setting up the base SpinRite Virtual Machine​

  1. You could do either of the following:
    1. Part 5A - Download a pre-built Virtual Machine instead of creating your own, or
    2. Part 5B - Creating your own Virtual Machine
  2. Using the pre-built Virtual Machine does not require access to a Windows PC but does entail some command line work
  3. Once you've completed one of those processes, come back here to configure access to the target system drives

D. Configuring access to target system drives​

  1. Reference: https://docs.oracle.com/en/virtualization/virtualbox/7.0/user/AdvancedTopics.html#rawdisk
  2. You’ll need the device names of the physical drives on the system
  3. Open a Terminal session
  4. Run the command:
    1. diskutil list
  5. This will show all the disks on the system; look for the devices noted as (internal, physical), AS WELL AS any "synthesized" drives which contain partitions from the internal disks
  6. Note the name(s) of the disk(s), AND the partitions which are under the main drive device for both physical and synthesized disks. You’ll unmount the partitions the drives to prevent concurrent access, then map the disk name(s) to virtual drive(s) using the VBoxManage command.
  7. Run the command:
    1. df -h
  8. This will show you the mounted partitions, and you must unmount them.
    1. EXAMPLE:
      1. You have a physical disk0, and a synthesized disk1. The output of df -h shows that /dev/disk1s4 and /dev/disk1s1 are mounted. You would then run two unmount commands:
        1. diskutil unmount /dev/disk1s1
        2. diskutil unmount /dev/disk1s4
      2. You should then unmount the physical and synthesized disks
        1. diskutil unmountDisk /dev/disk1
        2. diskutil unmountDisk /dev/disk0
  9. Now you can proceed with creating the .VMDK file(s) to access the physical drives
  10. cd ~/'VirtualBox VMs'
    1. Now, for each drive you’ll create a special .VMDK file that VirtualBox will use to access the real drive. For example, if the first drive you want to use, as noted from the diskutil listcommand, is /dev/disk0:
    2. sudo VBoxManage createmedium disk --filename DISK0.vmdk --format=VMDK --variant RawDisk --property RawDrive=/dev/disk0
  11. For each drive on the system, you’ll want to give a unique filename, and obviously adjust the RawDrive parameter to refer to the correct Physical Drive
  12. When you’ve created the needed .vmdk file(s), stay at the command prompt
  13. Now start VirtualBox with the sudo command as noted above
    1. sudo virtualbox
  14. Go to Settings, then Storage
  15. Decide whether to attach your virtual drives to either the IDE controller or the AHCI controller
    1. IDE Controller (listed as PIIX4 in the VM Settings)
      1. Pros:
        1. Faster operation (SpinRite native IDE driver works)
      2. Cons:
        1. Can only add up to 3 drives, as IDE only supports 4 total
        2. Logs will not be written until after the SpinRite session ends
    2. AHCI Controller
      1. Pros:
        1. Can have up to 30 drives (ports 0 to 29)
        2. Can log during operation
      2. Cons:
        1. Drives are seen as BIOS attached; SpinRite native AHCI doesn't work for some reason
        2. BIOS access may be an order of magnitude slower than IDE (or the same speed, you need to test and see!!)
  16. Attach the drives
    1. From the selected controller, add a Hard Disk
    2. The Medium Selector screen should be aware of the vmdk files you made, highlight one and select Choose
  17. Repeat as necessary to add all your vmdk files
    1. NOTE: The Host drive does NOT have be an actual AHCI connected SATA drive; access is just by block address
      1. NOTE: If you get an error attaching the .VMDK files, or an error on starting, make sure that the drives and partitions are still unmounted. Use the diskutil and df -hcommands as noted above to be sure.
  18. Now start your Virtual Machine session
    1. At the C:\> prompt start spinrite
    2. C:\>spinrite
  19. After the memory check, SpinRite should enumerate the boot virtual drive, as well as all of the VMDKs you’ve attached
  20. And that’s it!! Perform whatever SpinRite operations you want on the attached drive

How do I use this disk on another Mac?​

  1. Make sure this other Mac is capable of running the MacOS version that you have on your external drive
    1. Check at: https://everymac.com/ or other reliable source
  2. For most Macs, starting with the Option key held down will bring up the Boot Picker screen and you can select the External Drive
  3. Start VirtualBox (again, from the terminal with sudo as noted above)
  4. Go into Settings for the Virtual Machine and REMOVE the prior VMDK files from the AHCI controller
  5. Exit VirtualBox
    1. You should now CLOSE and DELETE any prior VMDK files referring to drives from a different system.
    2. You’ll use the VboxManage closemedium command for this:
      1. Reference: https://docs.oracle.com/en/virtualization/virtualbox/7.0/user/vboxmanage.html#vboxmanage-closemedium
    3. From the Terminal window
      1. Change to the VirtualBox VMs directory
        1. cd ~/'VirtualBox VMs'
      2. do an ls command to see the .VMDK files
        1. ls
      3. Use VBox Manage to delete any prior VMDK files.
        1. sudo VBoxManage closemedium DISK0.vmdk --delete
  6. The vmdk files will be deleted, AND removed from VirtualBox’s registry of known drives
  7. You can now add the drives from the new system you are testing per the instructions above
 
Last edited:
@Scott Thanks for the write up. Successfully, ran Spinrite 6.1 RC 3 on one-of-the-last of the Intel MacBook Pros. It worked great, I chose the IDE controller method.

I appreciate you taking the time to post this.
 
@Scott Thanks for the write up. Successfully, ran Spinrite 6.1 RC 3 on one-of-the-last of the Intel MacBook Pros. It worked great, I chose the IDE controller method.

I appreciate you taking the time to post this.
Glad to hear it!