Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm currently running a

sudo mkfs.msdos -c -F 32 /dev/sdg1

How long would it take, approximately? This is an USB 2.0 disk of 250GB. The lower limit is of course 2 * 250GB / 480 Mbit/s ~ 8400s (it must write and read the whole disk) but I fear it could be slower than that.

Does anybody have a first hand experience?

Just to make this message more googlable, let me type fast and slow: how fast it will be? how slow?

share|improve this question
add comment

3 Answers

up vote 1 down vote accepted

Sounds like it worked for you, but for ther record....

Block checking can take an incredibly long time if you have actual bad blocks that cause I/O errors; depending on the driver, the error and what it uses to recover. SSDs should be faster and presumably less likely to have errors, but errors could still make it many times the best-case scenario.

I'd suggest using dmesg to see if it is having problems if it seems overly slow.

BTW, why do you think it must write to the whole disk? I don't see from the mkfs.vfat(1) man page where it does a destructive test, the badblocks(1) program does a read-only test by default.

And FWIW, I've had mkfs -c take 24+ hours (IIRC) on a SCSI disk that was ~4GB.

share|improve this answer
add comment

It took not much more than the lower limit. Unfortunately I didn't stopwatched it, but more or less that was it.

share|improve this answer
add comment

Thanks for the tips! I'd like to contribute with my experiences from troubleshooting my friend's unbootable Ubuntu PC. I booted the PC with Xubuntu on USB media. After using command e2fsck the hard disk partition could be mounted, and the files could be retrieved from the hard disk (and my friend got happy:).

Hard disk failure error messages could be seen in kernel ring buffer (and can be printed with dmesg command):

[78748.550250] ata1.00: status: { DRDY ERR }
[78748.550253] ata1.00: error: { UNC }
[78748.572323] ata1.00: configured for UDMA/100
[78748.572341] ata1: EH complete
[78753.326771] ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
[78753.326777] ata1.00: BMDMA stat 0x25
[78753.326782] ata1.00: failed command: READ DMA
[78753.326790] ata1.00: cmd c8/00:08:48:0b:44/00:00:00:00:00/e4 tag 0 dma 4096 in
[78753.326792]          res 51/40:08:48:0b:44/40:00:04:00:00/e4 Emask 0x9 (media error)

When I tried to install Xubuntu on the PC, the installation stopped because of these media errors. I used Gparted to partition the hard disk and mke2fs command to make ext4 file system excluding bad blocks.

ubuntu@ubuntu:~$ sudo mke2fs -c -t ext4 /dev/sda1
...
...
...
Checking for bad blocks (read-only test):  18.07% done, 2:54:19 elapsed
 18.20% done, 8:14:58 elapsed
 18.20% done, 8:22:01 elapsed
^[[B20% done, 8:35:08 elapsed

Block checking is so slow I thought execution was stucked. It nearly stopped around 18% and it seemed it will never reach the end. But dmesg showed that block is stepped and that block checking is proceeding. If the blocks are ok, block checking is faster and the whole execution took ca 24 hours. Hard disk size is 40 GB.

share|improve this answer
    
You're braver than me---when I start having bad blocks, I replace the disk. –  Kazark Nov 10 '12 at 1:57
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.