I have a 4GB USB flash drive, which used to work fine. Recently, though, my mother had a problem with her HP winXP laptop. She tried to re-install XP using a Dell recovery disk, which would not recognize her laptop's HDD and tried to install onto my USB drive, which was plugged in at the time. She has a new laptop now, but my drive doesn't work: Ubuntu will not recognize it, and Windows only recognizes it but can't mount or partition it. What should I do?
First open a terminal with Alt-Ctl-T.
Enter the command:
and make a list of which devices are in use.
Enter the following command to keep an eye on the syslog (log of what is happening on your system from the operating system point of view).
tail -f /var/log/syslog
Now plug in and remove the flash drive. Make sure of what device it is, and that it's not one of the ones you saw mounted above. It may be something like /dev/sdc. Also see if you see the same device with a number after it, e.g. /dev/sdc1. If you see that your flash drive is being seen by your system.
Assuming it is not you can format the drive. If /dev/sdm was the drive your flash drive becomes, plug it in once again and enter:
sudo fdisk /dev/sdm
Now you can partition the device and format those partitions as you desire.
If nothing is noted on /var/log/syslog as you plug in the drive and unplug it, it is, indeed, unusable with Ubuntu.
I keep on coming across USB drives that can not be mounted or the partition table re-configured. These are commercially formatted devices that worked fine out of the box but fail completely after adjustments are made to the partition table. In many cases they work with Windows, but cannot be mounted or successfully formatted under Linux. I come across this most often when trying to make a LiveUSB boot device and the Ubuntu startup disk creator fails with a cryptic error message.
The solution is to forcefully remove the partition table by writing zeros to the device. This can be achieved using dd with the following:
dd if=/dev/zero of=/dev/sdx bs=512 count=1
Where the USB drive in question is /dev/sdx Do not run this on any drive containing data because it will effectively wipe it - you need to be 100% sure that you are operating on the correct device.
Once the partition table has been removed in this way you can make the partition table and partition the device using any program such as Disk Utility, fdisk, cfdisk etc. Note that "make the partition table" is an extra step that will need to be done before the device can be partitioned, and the correct format for this will be "msdos". You can then make ext2/4 or any other type of partition.
I can recommend Disk Utility as a program that is easy to use, and cfdisk is a quality Linux utility that is menu driven.