LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   USB mini hard drive - mounting and access problems (https://www.linuxquestions.org/questions/linux-hardware-18/usb-mini-hard-drive-mounting-and-access-problems-843830/)

Steve W 11-12-2010 02:52 AM

USB mini hard drive - mounting and access problems
 
A few years ago I bought a small 8GB Maxell USB external hard drive. It's about the size of a packet of Tic Tacs. I've got it formatted into two partitions - one is FAT16 and the other FAT32. I've got a small amount of Windows files in the FAT16 partition and some backup files from my Linux system in the other. However, I want to reformat the whole drive into one partition and start again.

I am having trouble accessing the files some of the time, hence my decision to reformat.

However, I thought I would reformat into one partition using GParted, but whenever I try and unmount both partitions, it starts trying to search the partitions of that device, and that's all it does. It's like it has "hung" in some way.

I assume there is a way to wipe/reformat the drive using the shell; but when I Google this, the instructions all seem to be about formatting a new drive. Surely I should be able to accomplish this in GParted? Even if the drive is slightly corrupted (which could be one reason?)

Thank you for any advice you can give.

stress_junkie 11-12-2010 05:59 AM

If the controller circuit inside the device is failing then it may not be possible to repartition it. Use the system logs to see if Linux shows any errors when you plug the device into the computer.
Code:

dmesg
If you see errors associated with the device then you probably should copy the files off of the device and then discard the device. You may want to use shred on the two partitions before you discard the device. Shred will overwrite the files with random numbers.

GrapefruiTgirl 11-12-2010 06:08 AM

Not disagreeing with stress_junkie, but I would like to also point the OP to this other thread:
http://www.linuxquestions.org/questi...gnized-835812/

In brief: if you're on a laptop (especially an older one), try the hard disk on a desktop machine or newer laptop, to rule out problems related to inadequate power supplied from the laptop's USB ports. I've got a USB HDD too, that works fine on my desktop, but is very hit-or-miss on the laptops we have here, usually not working. OP in that other thread experienced same thing.

Anyhow, if the contents are important, probably very good idea to do what you can to get the data off onto another device ASAP, especially if this has never happened before. Act now - investigate more later.

btncix 11-12-2010 06:26 AM

You can try to delete the two partitions and create one whole one from command line using cfdisk as root user. Make sure your external hard drive is not mounted.

# cfdisk /dev/sdX (X = a, b, etc.)

or try fdisk if cfdisk does not work
# fdisk /dev/sdX

jefro 11-12-2010 06:51 PM

Might look at fdisk -l too or even just mount command.

Steve W 11-13-2010 03:29 AM

Thank you all for your helpful replies. Using a combination of cfdisk and GParted, I have now successfully formatted the drive to just under 8Gb of FAT32 space, and copied some files onto it. It seems fine now.

I was using it as a backup drive anyway so there was no important data on there to lose. I don't know whether it was a combination of trying to use FAT16 on the smaller partition and FAT32 on the larger one that the system did not like. However it is all FAT32 now and working okay.

Thanks for the advice.

Steve


All times are GMT -5. The time now is 11:24 PM.