Restore flashdrive to original state diskutility I have pen drive which has two partitions with almost no storage in each. The full size of the things is 8GB as you can see in the image below. 


The problem is diskutility commands eraseDrive and eraseVolume both take as arguments the device NAME and IDENTIFIER and as you can see in the image above, the different partitions do not have a NAME.

My goal is to have a single partition with the full 8GB. Any suggestions?
The command to erase a drive to one (visible) partition is:

diskutil eraseDisk FileSystem newVolumeName PartitionScheme diskIdentifier


Valid file systems are e.g. JHFS+ or MS-DOS. To get an almost complete list of file systems enter: diskutil listFilesystems. If the volume name contains spaces use quotation marks. Some file systems don't accept volume names with spaces. Valid partition schemes are APM, MBR and GPT. Some file systems require a particular partition scheme (e.g. APFS doesn't work with APM or MBR) Use the proper disk identifier by checking the output of diskutil list.

So

diskutil eraseDisk JHFS+ "FLASH 8GB" GPT disk2


would be a working command.

Some partition schemes will create more than one slice even if you chose to create one main volume only: 


GPT: invisible EFI partition with 100-300 MiB
APM: invisible Apple_partition_map with some KiB