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

  • SpinRite v6.1 Release #3
    Guest:
    The 3rd release of SpinRite v6.1 is published and may be obtained by all SpinRite v6.0 owners at the SpinRite v6.1 Pre-Release page. (SpinRite will shortly be officially updated to v6.1 so this page will be renamed.) The primary new feature, and the reason for this release, was the discovery of memory problems in some systems that were affecting SpinRite's operation. So SpinRite now incorporates a built-in test of the system's memory. For the full story, please see this page in the "Pre-Release Announcements & Feedback" forum.
    /Steve.
  • 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
63
22

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. Add an AHCI controller if there isn't one there already
  16. From that controller, add a Hard Disk
  17. The Medium Selector screen should be aware of the vmdk files you made, highlight one and select Choose
  18. 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
    2. 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.
  19. Now start your Virtual Machine session
    1. At the C:\> prompt start spinrite with forcebios switch
    2. C:\>spinrite forcebios
  20. After the memory check, SpinRite should enumerate the boot virtual drive, as well as all of the VMDKs you’ve attached
  21. 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: