Mac – How does OSX assign disk numbers

hard drivemac pro

I have four drives inside my Mac Pro.

  • Bay 1: /dev/disk1s3
  • Bay 2: /dev/disk0s2
  • Bay 3: /dev/disk2s2 (also, my boot drive)
  • Bay 4: /dev/disk3s2 and /dev/disk3s3

How are the disk numbers assigned? If I swap Bay 2 and Bay 1, will the disks in those drives swap disk numbers (so I have /dev/disk1s2 in Bay 1, and /dev/disk0s3 in Bay 2)? Also, does it make any difference that the boot drive is in Bay 3 and/or that it isn't /dev/disk0s2?

Best Answer

Drive numbers are assigned by the OS on a first come, first serve basis. The numbering scheme is as follows (with a capital N being a number):

diskN - always refers to a primary drive (i.e. the entire drive)

diskNs1 - always EFI

diskNs2 - First actual volume on the drive

diskNs3 - Second volume on drive, if there is one...this can go on for as many volumes as you have.

You can get some of the information about drives and volumes with the GUI version of diskutil by opening diskutil, clicking on the drive or volume, and then right-clicking on the item and then selecting "Information" from the dialog.

Another way is to open up a terminal window and type "diskutil list" and it will provide you with a list of all the drives, their partitions sizes and names (don't type it with quotes, though). If you want specific info about a drive or volume type "diskutil info " for example:

diskutil info disk0 OR diskutil info disk0s3

The utility will provide detailed information about each. I personally find using the Terminal.app a little easier because I can pipe the output to a file if I need to instead of cutting and pasting and it shows the relations of the volumes to the partitions a bit more clearly (IMHO).

I wouldn't think that swapping the drives around in the bays would make any difference. On my development systems I can swap around firewire drives, take one offline, take the other offline, bring the first back up, and even though they get different drive IDs, if one is set as bootable it will remain bootable. Mac's use UUIDs to tag the drives which remain unique to the drive regardless of their disk assignment.

The firmware for a Mac Pro might allow a user to provision specific bays to be bootable.