How to repartition pendrive again?

Unfortunately it seems that you've just killed your pendrive while trying to install a normal* distro onto it. (See wikipedia on why this is a bad idea.)

If there is any chance of bringing your pendrive back to life, it would involve destroying current partitioning. You can try doing that using dd. dd if=/dev/zero of=/dev/sdc bs=4096 count=100 should be more than enough - but remember that it will destroy your current partitions, so make sure that you want it and that /dev/sdc is the pendrive. (You can use the function recognizing external disks I posted here.)

If you are desperate to retrieve the data from the pendrive, use the testdisk tool - it might be already on your install or at least in the repos. Run it like this: testdisk /dev/sdc and proceed to Analyse and then Restore. Read the manual in case of doubt.

*) By "normal" I mean a distribution that was designed to reside on a hard drive. You should not do so - it is risky since typical distributions do not care that much about the ammount of disk writes. But your situation might indicate you were actually lucky to face this failure during installation and not after some time of system usage (see also Caleb's comment).


I would suggest that your drive experienced some kind of hardware failure. The problem isn't the partitions, the problem was encountered when the drive decided to die on you. The original errors you saw during install were probably it failing to write because the disk failed to respond correctly to commands.

You can try putting it in a different machine with a different USB controller, maybe it will come to life. If you do it will probably show the partitions as they were but with corrupted data in the one you were installing to. Unfortunately once a flash drive starts to go bad it's probably a loosing battle.


Try the application Gparted. You can either install it in Linux or use it from a LiveCD - http://gparted.sourceforge.net/

BUT be careful. It is possible to partition your Hard Drive by mistake!