Mount all mountable partitions of a removable disk with diskutil

Solution 1:

Though I can't verify this, I think the problem is related to the nodev flag of the partitions. In theory the nodev flag doesn't allow a non-root user to create a device node like /dev/disk2s5. So you have to prepend sudo to remount the mountable partitions of the disk.

The following should work:

  • Create mount points: mkdir mnt1 and mkdir mnt2
  • Mount the partitions

    sudo mount -t msdos /dev/disk2s1 ~/mnt1 
    #and respectively for the 2nd partition
    sudo mount -t msdos /dev/disk2s5 ~/mnt2
    

Rechecked with a real thumb drive:

Simply use:

sudo diskutil mountDisk /dev/disk2

instead of diskutil mountDisk /dev/disk2

Solution 2:

Basically, the diskutil command does not like partitions with the id of 0C and, therefore, will not mount them.

Here is the test I preformed.

  1. Using Yosemite OS X 10.10.5, I partitioned a 4 GB flash drive using a MBR scheme to have 5 equal sized FAT formatted partitions. This function is no longer permitted under El Capitan.
  2. Removed flash drive, inserted flash drive, unmounted disk using diskutil, and mounted disk using diskutil. Everything works fine. No problems.
  3. Boot to El Capitan OS X 10.11.4.
  4. Removed flash drive, inserted flash drive, unmounted disk using diskutil, and mounted disk using diskutil. Everything works fine. No problems.

One difference I did note. Your fdisk output shows the id for the FAT formatted partitions as 0C. Yosemite created these partitions, on my Mac, using the id of 0B. I used the fdisk command to change the id of the first partition to 0C. Now when I unmount and mount the flash drive using the diskutil command, the first partition does not mount. The remaining 4 do.

Ironically, if I use the command

diskutil mount /dev/disk1s1

the first partition, on the flash drive, mounts. (On my computer, I am not using core storage, therefore, the flash drive is disk1.)