Getting an error when formatting a thumb drive Inside of Terminal.app, I'm trying to format a thumb drive and I'm getting the following "error":


  does not appear to be a whole disk


The line I typed in was the following:

sudo diskutil partitionDisk /dev/disk1s2 GPT JHFS+ HighSierra R


What might I be typing in wrong? Why is it stating this?
You're asking it to partition a whole disk - it wipes existing volumes, and creates the ones you specify.

But, you're giving it /dev/disk1s2, which is itself a partition.

If you're trying to reformat the whole drive, you should be using /dev/disk1

Also, typically, people use eraseDisk to wipe and reformat it - 


  diskutil eraseDisk Usage:  diskutil eraseDisk format name
  [APM[Format]|MBR[Format]|GPT[Format]]
          MountPoint|DiskIdentifier|DeviceNode (Re)-partition a whole disk (create a new partition map). This completely erases any existing
  data on the given whole disk; all volumes on this disk will be
  destroyed. Format is the specific file system name you want to erase
  it as (HFS+, etc.). Name is the (new) volume name (subject to file
  system naming restrictions), or can be specified as %noformat% to skip
  initialization (newfs). You cannot erase the boot disk. Ownership of
  the affected disk is required. Example: diskutil eraseDisk JHFS+
  UntitledUFS disk3