8/23/2021

How To Use Diskpart To Set Up A Usb Stick For Mac Os X

80

If a Mac is having some issues a bootable USB of the OS can serve as an emergency disk. It is better than OS X Recovery as you don’t have to download the 5GB installer data, first, to reinstall the OS or installer disk for Macs that does not support OS X Recovery. Download Mac OS X El Capitan; The Second operation that you’re going to do is open up the disk utility on Mac OS then erase your USB flash drive for Mac OS X El Capitan. Once you open up the “Disk Utility“, then erase the USB as the given screenshot. How to Format a Disk to HFS Without a Mac. Hierarchical File System Plus, also known as Mac OS Extended, is the primary file system format used in Mac computers. Windows, on the other hand, runs. Insert the flash drive in a USB port on the Mac. Restart the Mac and immediately hold down the option key. When the Startup Manager icons appears, choose the external drive icon labeled EFI Boot. When prompted, I choose the default startup option.

Mar 29, 2020 First, connect the USB flash drive to your PC and then run Diskpart. In order to run diskpart, press Windows button+R and type diskpart then hit the enter.

Dear Reader,

you probably noticed that this is a rather silly title for a posting. You could argue also, that creating a blog with the sole purpose of explaining how to create a bootable usb flash drive under mac os x is rather silly, too. W E L L Y O U S U R E L Y W O U L D N ‘ T I F Y O U W A S T E D T H R E E F * * * I N G D A Y S T R Y I N G T O F I G U R E O U T H O W ! ! !

Anyway, so really how to create a bootable USB stick now, under Mac OS X ? I shall describe one way to do this, for the example of a NetBSD installation. But first some

0. Preliminaries

What happens when you start a typical PC, is that the BIOS will – after having gone through some testing/self-check stuff we don’t care about – try to start the OS. It will look for existing bootable drives, which are e.g. hard drives, floppy disks, CDs and well USB flash drives. If there is more than one bootable drive, it will choose the one with the highest priority. If this is a hard drive, it will expect that the first 512 bytes of this disk constitute a valid MBR = Master Boot Record (cf. http://en.wikipedia.org/wiki/Master_Boot_Record ), and will start executing the boot manager code in this MBR. This boot manager will usually try to boot from the partition, which is flagged as bootable. The bootable partition’s analog of the MBR is the VBR = Volume Boot Record, whose format will depend on the filesystem type of that partition. The MBR boot code will then give control to the executable code in the VBR, which will then start the OS.

If you are booting from a floppy, there are no partitions, just one volume. Hence there is no MBR, and the BIOS will directly try to execute the VBR boot loader. For CDs the situation is different, but basically the same. How a BIOS boots from a CD is specified in the “El Torito”-Standard.

USB flash drives are treated like normal hard drives, so we have to have MBR and VBR.

1. Creating a NetBSD installation disc on a USB flash drive

If you insert a USB flash drive into your Mac, the OS will associate to it a device file /dev/disk<n>, where n is some natural number. The easiest way to find out which device file it assigns to, is to type

mount

in command line, while the stick is mounted (i.e. appears under /Volumes/). For sake of concreteness let’s assume it is bound to /dev/disk2. The next thing you have to do, is set up the MBR and create suitable partitions on your stick. There are at least two ways to do this under Mac OS X. The first way is to use the Mac OS X Disk Utility. Since this tool is rather user-friendly and self-explaining, I won’t describe it here. Instead I will to describe setting up your stick with “fdisk”. Before you start, make sure that you don’t have any volumes of your stick mounted using

Use

diskutil umountDisk /dev/disk2

This should unmount all the volumes on your flash drive. Next type e.g.

fdisk -a dos -c 1024 -h 255 -s 63 -b 512 -i /dev/disk2

Diskpart

This will overwrite any MBR present (-i) and create a single FAT partition (-a dos) on your drive. It will use some default boot strapping. If you want to use your own MBR boot loader, you have to specify an MBR template for fdisk to use via “-f /path-to-a-mbr-template-file”). If you choose to do so, you will have to append the “-f /path-to….” to every fdisk command below. The option “-c 1024 -h 255 -s 63” specifies the “BIOS geometry” fdisk should use. Note that the numbers given in the above example don’t matter actually. We have to give these options to fdisk, because we have also given “-b 512”, whichs sets the sector size to 512 bytes per sector (fdisk man says “block size”, but it’s really sector size). This is a crucial point. If you leave out “-b 512”, our stick will not be bootable.

Now to mark the partition as bootable, we have to use fdisk in interactive mode. But before we do this, we do

diskutil umountDisk /dev/disk2

again to make sure Mac OS X didn’t re-mount it meanwhile (which it usually does, everytime you mess around with your drive). Then type

fdisk -e /dev/disk2

and then

flag 1

This will flag the partition number 1 as bootable. However, for our purposes the file system type is not the right. To install the NetBSD boot image, we need to have a partition of type “NetBSD” = 0xa9 = 169. There do

edit 1

a9

[enter]

How To Use Diskpart To Set Up A Usb Stick For Mac Os X 10 12 Download

[enter]

[enter]

How to use diskpart to set up a usb stick for mac os x 10 10 5

quit Gameboy advance gba roms.

The MBR part of the USB stick is now correctly set up, and we can copy the boot image onto partition 1. Download a suitable boot image. If you’re planning to install NetBSD on a x86 machine for instance, this would be “/NetBSD-<version>/i386/installation/floppy/boot-big.fs”, on your favourite ftp-server. Now do

diskutil umountDisk /dev/disk2

dd if=/whereever-you-have-download-it-to/boot-big.fs of=/dev/disk2s1

How To Use Diskpart To Set Up A Usb Stick For Mac Os X 10 10 5

Use

Note that it’s really “disk2s1” and not “disk2”. You don’t want to overwrite your MBR, but rather your boot volume and your VBR. At this point, you should have created a bootable USB installation stick (at least it worked for me). Really the important thing to note here is the “-b 512” option. Otherwise, it’s pretty straight forward.

How To Use Diskpart To Set Up A Usb Stick For Mac Os X 10 13 Download

References: