綾小路龍之介の素人思考

[linux] FD のエラーテスト

このフロッピーディスク使えるのかを判断する方法。

fdformat, dd if=/dev/zero, badblocks を使ったりしてエラーが出たらダメ。一般には badblocks で十分。まぁそもそもFDDがガーピーガーピーいってるのはダメな証拠だわ。

$ sudo fdformat /dev/fd0
Double-sided, 80 tracks, 18 sec/track. Total capacity 1440 kB
Formatting... done
Verifying... fdformat: read error: Input/output error
fdformat: problem reading cylinder 6, expected 18432, read -1
$ sudo dd if=/dev/zero of=/dev/fd0
dd: writing '/dev/fd0': Input/output error
217+0 records in
216+0 records out
110592 bytes (108.0KB) copied, 4.422614 seconds, 24.4KB/s
$ sudo badblocks -v -s -w -o badblocks_fd0.txt /dev/fd0
Checking for bad blocks in read-write mode
From block 0 to 1439
Testing with pattern 0xaa: done
Reading and comparing: done
Testing with pattern 0x55: done
Reading and comparing: done
Testing with pattern 0xff: done
Reading and comparing: done
Testing with pattern 0x00: done
Reading and comparing: done
Pass completed, 4 bad blocks found. (0/4/0 errors)
$ cat badblocks_fd0.txt
1436
1437
1438
1439

こんなエラーが出る場合も。

$ sudo fdformat /dev/fd0
fdformat: can't open '/dev/fd0': No such device or address
$ sudo dd if=/dev/zero of=/dev/fd0
dd: can't open '/dev/fd0': No such device or address
$ sudo badblocks -v -s -w -o badblocks_fd0.txt /dev/fd0
badblocks: No such device or address while trying to determine device size

正常終了は以下。

$ sudo dd if=/dev/zero of=/dev/fd0
dd: writing '/dev/fd0': No space left on device
2881+0 records in
2880+0 records out
1474560 bytes (1.4MB) copied, 96.588709 seconds, 14.9KB/s
$ sudo fdformat /dev/fd0
Double-sided, 80 tracks, 18 sec/track. Total capacity 1440 kB
Formatting... done
Verifying... done
$ badblocks -v -s -w -o badblocks_fd0.txt /dev/fd0
Checking for bad blocks in read-write mode
From block 0 to 1439
Testing with pattern 0xaa: done
Reading and comparing: done
Testing with pattern 0x55: done
Reading and comparing: done
Testing with pattern 0xff: done
Reading and comparing: done
Testing with pattern 0x00: done
Reading and comparing: done
Pass completed, 0 bad blocks found. (0/0/0 errors)
$ cat badblocks_fd0.txt

ソーシャルブックマーク

  1. はてなブックマーク
  2. Google Bookmarks
  3. del.icio.us

ChangeLog

  1. Posted: 2008-06-27T11:47:58+09:00
  2. Modified: 2008-06-27T11:47:58+09:00
  3. Generated: 2017-04-01T23:09:15+09:00