Analysis of the problem
Memory cards and USB pendrives have the same kind of hardware inside, so the same methods are relevant to both kinds of devices. The term 'drive' can refer to a USB pendrive as well as a memory card (and the memory card can be connected via a USB adapter or a built-in slot in the computer).
Confusion: There is some data in the drive, that makes the partitioning tool confused, to think that the drive does not work. In this case you can simply 'wipe' part of the drive (overwrite with zeros). It is usually enough to wipe the first megabyte, the megabyte at the head end of the drive.
The drive is read-only: I do not mean that there is a read-only file system, but that the drive is readable but not writable (like a CDROM or DVD). This might be caused by some help system or competing system, so it is worthwhile to try according to this list,
- On some pendrives and on many memory cards there is a small mechanical switch for write protection, that can toggle between read/write and read-only. You might have set it read-only without intention.
- Reboot the computer and try again to restore or wipe the first megabyte with mkusb.
- Disconnect other USB devices. Sometimes USB devices can disturb the function for each other.
- Try other USB ports, and/or other card adapters.
- Try another computer.
- Try another operating system (Windows, MacOS) in another computer.
- If you still cannot wipe the first megabyte of the drive, and the drive is read-only, it is probably 'gridlocked', and the next stage is that it will be completely 'bricked'. There is a limit, when you have to accept that the pendrive is damaged beyond repair, at least with tools available to normal users like you and me. See this link: Pendrive lifetime
The drive cannot be found: In order to use the tools for repair and partitioning, that are available to normal users like you and me, the drive must be recognized by the computer's system and listed for example by the command line tool lsusb
or lspci
. You get more details with the verbose option
lsusb -v
The drive must also be recognized as a mass storage device for example by the command line tool lsblk
. The two command lines
sudo lsblk -f
sudo lsblk -m
should list the drive in a way, so that you can identify it. The following command line is even better, because it lists also the model (which typically includes the brand name and/or model of a pendrive or a card adapter).
sudo lsblk -o model,name,size,fstype,label,mountpoint
(You can copy and paste from here to a terminal window in order to avoid typing errors.)
Looking at a persistent live drive /dev/sdd
and a cloned live-only drive /dev/sde
can produce the following output,
MODEL NAME SIZE FSTYPE LABEL MOUNTPOINT
...
Extreme sdd 14,6G
├─sdd1 4,5G ntfs usbdata /media/sudodus/usbdata
├─sdd2 1M
├─sdd3 244M vfat usbboot
├─sdd4 874M iso9660 Lubuntu 16.04.1 LTS amd64 /media/sudodus/Lubuntu 16.04.1 LTS amd64
└─sdd5 9,1G ext4 casper-rw /media/sudodus/casper-rw
Transcend 4GB sde 3,8G iso9660 Lubuntu 16.04.1 LTS i386
└─sde1 858M iso9660 Lubuntu 16.04.1 LTS i386
...
A memory card plugged into an internal slot may be recognized as /dev/mmcblk0
as illustrated by the following example, where an Intel NUC is booted from a microSD card in an adapter in the SD card slot,
MODEL NAME SIZE FSTYPE LABEL MOUNTPOINT
mmcblk0 29.7G
├─mmcblk0p1 300M vfat EFI /boot/efi
├─mmcblk0p2 1M
├─mmcblk0p3 6.5G ext4 root /
└─mmcblk0p4 512M swap [SWAP]
In this case, no model name is listed. You can probably be convinced, that you are 'looking at' the card anyway, but there are other tools, that can help you identify the card, parted
and lspci
,
sudo parted -ls
Model: SD SP32G (sd/mmc)
Disk /dev/mmcblk0: 31.9GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 1049kB 316MB 315MB fat32 boot, esp
2 316MB 317MB 1049kB bios_grub
3 317MB 7262MB 6946MB ext2 root
4 7262MB 7799MB 537MB linux-swap(v1)
lspci
...
00:1e.6 SD Host controller: Intel Corporation Sunrise Point-LP Secure Digital IO Controller (rev 21)
...
- Try according to the list in the previous paragraph, 'The drive is read-only: "On some pendrives ..."', if the drive is not found.
- If the drive is found and recognized as a mass storage device, there is hope that you will succeed according to the next chapter.
Let us hope that there is 'only' confusion
Try to restore the drive to a standard storage device
Install and use mkusb (mkusb-dus), which can format alias restore a drive to a standard storage device (with an MSDOS partition table and a partition with the FAT32 file system). These instructions are relevant for many kinds of drives (USB pendrives, memory cards, hard disk drives, HDD, solid state drives, SSD), but probably most often used for USB pendrives and memory cards.
If you run standard Ubuntu, you may need an extra instruction to get the repository Universe. (Kubuntu, Lubuntu ... Xubuntu have the repository Universe activated automatically.)
sudo add-apt-repository universe # only for standard Ubuntu
sudo add-apt-repository ppa:mkusb/ppa # and press Enter
sudo apt-get update
sudo apt-get install mkusb mkusb-nox usb-pack-efi
See these links with more detailed instructions,
mkusb version 12 alias mkusb-dus:

mkusb wipes the first megabyte as a first step of restoring it
Sometimes some data are 'tricking' the software to think that the drive does not work, even when it is good, and it is enough to wipe the first megabyte to get rid of those data. You may 'look at' the drive with a tool, that does not recognize or understand correctly the structure of the partition table or a system, for example
- if it was cloned from an iso file, or
- if there are traces from a RAID configuration on the drive.
So you can
- let mkusb restore the drive to a standard storage device (a convenient standard solution), or
- let mkusb wipe the first megabyte and after that use another tool, if you want another partition table and/or other file systems. gparted is a good tool, if you are running a graphical user interface (window manager or desktop environment).
What to do if mkusb fails
If mkusb fails, the drive is either not found by the system or read-only. In this case you should try according to the list in the paragraph 'The drive is read-only' (above).
sudo dd if=/dev/zero
as suggested in the answer from 'izx'? If thedd
command is successful then I would recommend you create an MBR (msdos
) partition table and a single FAT32 partition usinggparted
before retryingUNetbootin
. (I have experienced problems trying to use multiple partitions on a USB drive. While you are just trying to get this to work it is probably best to start with a very simple setup.)