> For the complete documentation index, see [llms.txt](https://help.iodd.kr/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.iodd.kr/bootable-virtual-drive/virtual-drive-vhd/make-virtual-drive-for-silicon-mac.md).

# Make Virtual Drive for Silicon Mac

Guide for creating a virtual drive file on Apple Silicon Macs without using the Windows-only VHD Tool.

Since the Windows-based VHD Tool cannot be used directly on Apple Silicon Macs (M1, M2, M3, etc.), you can create a compatible virtual drive file using the macOS Terminal.

### Recommended Resources

For more details on dummy file creation, refer to the following technical guides:

* [Creating Large Dummy Files via macOS Terminal](https://code2care.org/2015/create-a-large-dummy-file-using-mac-os-x-terminal-command)
* [mkfile Command Reference (SS64)](https://ss64.com/osx/mkfile.html)

***

### Step-by-Step Creation Guide

You can create a dummy file using the `mkfile` command. The file extension must be set to **.DSK** to be recognized by the IODD as a virtual drive.

{% hint style="info" %}
**Command Syntax** Open the Terminal and use the following command structure: `$ mkfile [Size] [Path/Filename.DSK]`
{% endhint %}

#### Usage Examples:

* **Create a 10GB Virtual Drive:**

```bash
        $ mkfile 10G ~/VirtualHDD.DSK
```

```
*(Creates a 10GB virtual drive file named "VirtualHDD.DSK")*
```

* **Create a 100GB Virtual Drive:**

```bash
        $ mkfile 100G ~/ST400VD.DSK
```

```
*(Creates a 100GB virtual drive file named "ST400VD.DSK")*
```

***

### How to Prevent File Fragmentation (Critical for IODD)

The IODD hardware requires virtual drive files (DSK, ISO, VHD) to be stored in **physically contiguous space** (unfragmented). macOS does not have a built-in defrag utility, so follow these methods to ensure compatibility:

{% hint style="info" %}
**Method 1: Create Directly on the IODD Drive (Recommended)** To prevent fragmentation from the start, execute the `mkfile` command directly onto the IODD drive's path.

```bash
    # Example: Creating directly on the IODD volume
    $ mkfile 20G /Volumes/Your_IODD_Name/NewDisk.DSK
```

{% endhint %}

{% hint style="warning" %}
**Method 2: Ensure Sufficient Free Space** Before creating a file, ensure the IODD has much more free space than the file size you intend to create. This allows the file system to allocate a single contiguous block of data more easily.
{% endhint %}

{% hint style="danger" %}
**How to Fix "Defrag!" Errors on macOS** If the IODD displays a "Defrag!" error, macOS does not provide a tool to fix this in place. You must:

1. Copy the fragmented `.DSK` file to your Mac's desktop.
2. Delete the file from the IODD and **Empty the Trash**.
3. Copy the file back to the IODD.

If the error persists, the most effective solution is to **backup all data, format the IODD, and copy all files back** at once.
{% endhint %}

{% hint style="warning" %}
**Avoid Sparse Files** Do not use the `dd` command with `seek` to create files, as this creates "sparse files" that are highly likely to be fragmented and unrecognizable by the IODD hardware. Always use `mkfile`.
{% endhint %}
