LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (http://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Can not mkfs an external USB drive (http://www.linuxquestions.org/questions/linux-hardware-18/can-not-mkfs-an-external-usb-drive-4175447350/)

maikelmeyers 01-26-2013 02:41 PM

Can not mkfs an external USB drive
 
2 Attachment(s)
Hi,

I have an external USB2.0 hard drive and I am unable to format it to ext4 or any other file system. The drive was preformated with NTFS, working perfectly under Windows.
If I try to format it with gparted to ext4, gparted tells me that everything was successfull, but shows the partitions file system still as "unallocated". Trying to mount the drive fails.
I tried nearly everything, using fdisk, cfdisk, parted, mkfs.ext4, nothing works.

So next I tried to format the drive under Windows to ext4 with "minitool". This was succesfull. I booted to Linux(Mint) again and plugged in the drive and it was mounted perfectly. But after unmounting and mounting again, the drive is again corrupt. After mounting again, not only the file system is corrupt, but also the partition table is always broken.

So I tried this several times with several Linux systems on different computers (Ubuntu, Mint, Raspian). Everythere the same. So I thought maybe the drive is defective (although working perfectly with NTFS under Windows) and bought a new one. A new complete external USB2.0 drive with housing and controller. And: still the same issue. I am running out of ideas and I found nothing helpful on googling :(

Does someone have an idea?

Here is what parted -l says (even after mkfs.ext4 /dev/sdb1):
Code:

Model:  Mass Storage Device (scsi)
Disk /dev/sdb: 500GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start  End    Size  Type    File system  Flags
 1      1049kB  500GB  500GB  primary

Please see also the screenshots of gparted

syg00 01-26-2013 04:08 PM

I tend to get free and loose with "dd" and /dev/zero in such circumstances - but let's see "fdisk -l" (root/sudo) first.

maikelmeyers 01-26-2013 05:22 PM

Quote:

Originally Posted by syg00 (Post 4878151)
I tend to get free and loose with "dd" and /dev/zero in such circumstances - but let's see "fdisk -l" (root/sudo) first.

No data to loose. Backups were made.

fdisk -l prints:

Code:

Disk /dev/sdb: 500.1 GB, 500107860992 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773166 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000b5ed2

  Device Boot      Start        End      Blocks  Id  System
/dev/sdb1            2048  976773119  488385536  83  Linux


syg00 01-26-2013 08:07 PM

Quote:

Originally Posted by maikelmeyers (Post 4878095)
A new complete external USB2.0 drive with housing and controller. And: still the same issue.

That's a worry.
See if you can actually write to the device from Linux
Code:

dd if=/dev/zero of=/dev/sdb1 count=100
(make sure there's no typo involved). I've found that sufficient usually, but you can also zero the device node itself - some of the partitioning tools seem to object to that these days. I think fdisk won't open the device so you can repartition it - it used to, but (I think) complains these days. Parted may be better.
I might test it later on an old disk.

maikelmeyers 01-27-2013 03:33 AM

I tried now to zero the complete device
Quote:

sudo dd if=/dev/zero of=/dev/sdb
but after that, still the same: after applying a new MSDOS partition table and trying to make a new primary partition with EXT4, ended up with the same result as before: "unknown file system". By the way, applying a ntfs partition works. I don't know whats wrong here. Both drives can be formatted correctly to NTFS or EXT4 under Windows, but using it with Linux after that destroys the partition table when unmounting. That's so weird. Everything works fine with my 16GB USB sticks. There is no such a problem :(

maikelmeyers 01-28-2013 12:32 AM

No ideas someone? :(

masterclassic 01-28-2013 02:29 PM

Did you think to check the SMART report for errors?
sudo smartctl -a /dev/sdb
for the /dev/sdb drive.

and, perhaps, you can try the latest GParted live (cd or usb).

maikelmeyers 01-30-2013 04:31 AM

Now I gave it a third try and ordered another new USB drive: http://www.amazon.de/gp/product/B008...ls_o00_s00_i00
This one works as expected. No such problems.
It seems that there is a Linux problem with some USB controllers, since the other 2 drives worked perfectly with windows.

Thanks for your efforts

masterclassic 01-31-2013 08:27 AM

Can you please give us the model of the other (non working) hard drives?
I never had a similar problem myself, unless with defective drives.
I think to some very old kernel too, that's why I suggested the latest GParted live, not just GParted from any Linux distribution.

maikelmeyers 02-01-2013 05:28 PM

Quote:

Did you think to check the SMART report for errors?
sudo smartctl -a /dev/sdb
for the /dev/sdb drive.
This is what smartctl says:

Code:

smartctl 5.43 2012-06-30 r3573 [x86_64-linux-3.5.0-17-generic] (local build)
Copyright (C) 2002-12 by Bruce Allen, http://smartmontools.sourceforge.net

Smartctl: Device Read Identity Failed: Unknown error

A mandatory SMART command failed: exiting. To continue, add one or more '-T permissive' options.

This drive is a Toshiba MK5055GSX build into a Sharkoon Quickstore Portable.
The other drive I sent back. It was this one: http://www.ebay.de/itm/310144875783?...84.m1439.l2649

Are there any commands to read out more information about the USB/SATA controller?


All times are GMT -5. The time now is 09:34 PM.