複数 USB ドライブの検証


先日複数の USB ドライブに アクセスするとハングアップしたりファイルが破損することを経験した。
もう少し検証する。

ディスクの用意

大容量だと mkfs するのも fsck するのも時間がかかるので、 FUJITSU MPD3064AT という 6.5GB の HDD を2つ用意し、 GW3.5KH-U2 にセットし、fdisk, mkfs した。

fsck

fsck して、問題ないことを確認
[root@hage /mnt]# fsck -f -y /dev/sda1
fsck 1.29 (24-Sep-2002)
e2fsck 1.29 (24-Sep-2002)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/sda1: 11/787968 files (0.0% non-contiguous), 32943/1572864 blocks
[root@hage /mnt]# fsck -f -y /dev/sdb1
fsck 1.29 (24-Sep-2002)
e2fsck 1.29 (24-Sep-2002)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/sdb1: 11/787968 files (0.0% non-contiguous), 32943/1572864 blocks
[root@hage /mnt]#

sda1 に書き込み

マウントして sda1 にのみ書き込んでみた。
[root@hage /mnt]# mount /dev/sda1 /mnt/sda1
[root@hage /mnt]# mount /dev/sdb1 /mnt/sdb1
[root@hage /mnt]# df
ファイルシステム    1k-ブロック   使用中      空き 使用% マウント場所
/dev/hda1              2071384    489680   1476480  25% /
/dev/hda3              7534776    348456   6803572   5% /mnt
/dev/sda1              6192512     32828   5845068   1% /mnt/sda1
/dev/sdb1              6192512     32828   5845068   1% /mnt/sdb1
[root@hage /mnt]# (cd /; tar cf - usr)|(cd /mnt/sda1; tar xvf -)
usr/
usr/doc/
usr/doc/setup-2.5.7/
usr/doc/setup-2.5.7/uidgid
usr/doc/glibc-2.2.4/
	:
	:
usr/libexec/filters/lpf
usr/libexec/filters/pclbanner
usr/libexec/filters/psbanner
[root@hage /mnt]#
umount して fsck してみる
[root@hage /mnt]# umount /mnt/sda1
[root@hage /mnt]# fsck -f -y /dev/sda1
fsck 1.29 (24-Sep-2002)
e2fsck 1.29 (24-Sep-2002)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 3A: Optimizing directories
Optimizing directories:  49570 263014 312248 525622 623878 722420
Pass 4: Checking reference counts
Pass 5: Checking group summary information

/dev/sda1: ***** FILE SYSTEM WAS MODIFIED *****
/dev/sda1: 18514/787968 files (0.1% non-contiguous), 102147/1572864 blocks
[root@hage /mnt]#
"Optimizing directories" は出ているものの、問題なし

sdb1 に書き込み

同様に、sdb1 にも書き込んでみる
[root@hage /mnt]# mount /dev/sda1 /mnt/sda1
[root@hage /mnt]# df
ファイルシステム    1k-ブロック   使用中      空き 使用% マウント場所
/dev/hda1              2071384    489680   1476480  25% /
/dev/hda3              7534776    348456   6803572   5% /mnt
/dev/sdb1              6192512     32828   5845068   1% /mnt/sdb1
/dev/sda1              6192512    309644   5568252   6% /mnt/sda1
[root@hage /mnt]# (cd /; tar cf - usr)|(cd /mnt/sdb1; tar xvf -)
usr/
usr/doc/
usr/doc/setup-2.5.7/
usr/doc/setup-2.5.7/uidgid
usr/doc/glibc-2.2.4/
	:
	:
usr/libexec/filters/lpf
usr/libexec/filters/pclbanner
usr/libexec/filters/psbanner
[root@hage /mnt]#
こちらも umount して fsck で確認
[root@hage /mnt]# fsck -f -y /dev/sdb1
fsck 1.29 (24-Sep-2002)
e2fsck 1.29 (24-Sep-2002)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 3A: Optimizing directories
Optimizing directories:  49570 263014 312248 525622 623878 722420
Pass 4: Checking reference counts
Pass 5: Checking group summary information

/dev/sdb1: ***** FILE SYSTEM WAS MODIFIED *****
/dev/sdb1: 18514/787968 files (0.1% non-contiguous), 102147/1572864 blocks
[root@hage /mnt]#
今のところ、問題なし。

sda1 から sdb1 へファイルコピー

sda1 は読み出し、sdb1 は書き込みとなる。
[root@hage /mnt]# mount /dev/sdb1 /mnt/sdb1
[root@hage /mnt]# df
ファイルシステム    1k-ブロック   使用中      空き 使用% マウント場所
/dev/hda1              2071384    489684   1476476  25% /
/dev/hda3              7534776    348456   6803572   5% /mnt
/dev/sda1              6192512    309644   5568252   6% /mnt/sda1
/dev/sdb1              6192512    309644   5568252   6% /mnt/sdb1
[root@hage /mnt]# mkdir /mnt/sdb1/x
[root@hage /mnt]# (cd /mnt/sda1/; tar cf - usr)|(cd /mnt/sdb1/x/;tar xvf -)
usr/
usr/doc/
usr/doc/setup-2.5.7/
usr/doc/setup-2.5.7/uidgid
usr/doc/glibc-2.2.4/
	:
	:
usr/libexec/filters/lpf
usr/libexec/filters/pclbanner
usr/libexec/filters/psbanner
[root@hage /mnt]# umount /mnt/sda1
[root@hage /mnt]# fsck -f -y /dev/sda1
fsck 1.29 (24-Sep-2002)
e2fsck 1.29 (24-Sep-2002)
Pass 1: Checking inodes, blocks, and sizes
Duplicate blocks found... invoking duplicate block passes.
Pass 1B: Rescan for duplicate/bad blocks
Duplicate/bad block(s) in inode 49281: 98956
Duplicate/bad block(s) in inode 49282: 98957
Duplicate/bad block(s) in inode 49283: 98958
Duplicate/bad block(s) in inode 49284: 98959 98960 98961 98962 98963 98964
Duplicate/bad block(s) in inode 49285: 98956
Duplicate/bad block(s) in inode 49286: 98957
Duplicate/bad block(s) in inode 49287: 98958
Duplicate/bad block(s) in inode 49288: 98959 98960 98961 98962 98963 98964
Duplicate/bad block(s) in inode 131491: 267389 267390 267391 267392 267393 267394 267395 267396 267397 267398 267399 267400
267401 267402 267403 267404 267405 267406 267407 267408 267409 267410 267411 267412 267413
Duplicate/bad block(s) in inode 131495: 267389 267390 267391 267392 267393 267394 267395 267396 267397 267398 267399 267400
267401 267402 267403 267404 267405 267406 267407 267408 267409 267410 267411 267412 267413
Duplicate/bad block(s) in inode 147841: 295589
Duplicate/bad block(s) in inode 147842: 295590
Duplicate/bad block(s) in inode 147843: 295591
Duplicate/bad block(s) in inode 147844: 295592 295593 295594
Duplicate/bad block(s) in inode 147845: 295589
Duplicate/bad block(s) in inode 147846: 295590
Duplicate/bad block(s) in inode 147847: 295591
Duplicate/bad block(s) in inode 147848: 295592 295593 295594
Duplicate/bad block(s) in inode 147937: 295883
Duplicate/bad block(s) in inode 147938: 295884 295885
Duplicate/bad block(s) in inode 147939: 295886
Duplicate/bad block(s) in inode 147940: 295887
Duplicate/bad block(s) in inode 147941: 295883
Duplicate/bad block(s) in inode 147942: 295884 295885
Duplicate/bad block(s) in inode 147943: 295886
Duplicate/bad block(s) in inode 147944: 295887
(s) in inode 246369: 492646 492647 492648
Duplicate/bad block(s) in inode 246370: 492649 492650 492651 492652
Duplicate/bad block(s) in inode 246371: 492653 492654 492655 492656
Duplicate/bad block(s) in inode 246372: 492657 492658 492659 492660
Duplicate/bad block(s) in inode 246373: 492646 492647 492648
Duplicate/bad block(s) in inode 246374: 492649 492650 492651 492652
Duplicate/bad block(s) in inode 246375: 492653 492654 492655 492656
Duplicate/bad block(s) in inode 246376: 492657 492658 492659 492660
Duplicate/bad block(s) in inode 509089: 1017235 1017236 1017237 1017238 1017239
Duplicate/bad block(s) in inode 509090: 1017240 1017241 1017242 1017243 1017244
Duplicate/bad block(s) in inode 509091: 1017245 1017246 1017247 1017248 1017249
Duplicate/bad block(s) in inode 509092: 1017250
Duplicate/bad block(s) in inode 509093: 1017235 1017236 1017237 1017238 1017239
Duplicate/bad block(s) in inode 509094: 1017240 1017241 1017242 1017243 1017244
Duplicate/bad block(s) in inode 509095: 1017245 1017246 1017247 1017248 1017249
Duplicate/bad block(s) in inode 509096: 1017250
Pass 1D: Reconciling duplicate blocks
(There are 42 inodes containing duplicate/bad blocks.)

File /usr/lib/locale/ca_ES/LC_IDENTIFICATION (inode #49281, mod time Wed Dec  3 12:47:15 2003)
  has 1 duplicate block(s), shared with 1 file(s):
        /usr/lib/locale/eu_ES/LC_TELEPHONE (inode #49285, mod time Wed Dec  3 12:47:15 2003)
Clone duplicate/bad blocks? yes

File /usr/lib/locale/ca_ES/LC_MONETARY (inode #49282, mod time Wed Dec  3 12:47:15 2003)
  has 1 duplicate block(s), shared with 1 file(s):
        /usr/lib/locale/cs_CZ.utf8/LC_MESSAGES (inode #49286, mod time Wed Dec  3 12:47:15 2003)
Clone duplicate/bad blocks? yes

File /usr/lib/locale/ca_ES/LC_TIME (inode #49283, mod time Wed Dec  3 12:47:14 2003)
  has 1 duplicate block(s), shared with 1 file(s):
        /usr/lib/locale/cs_CZ.utf8/???/SYS_LC_MESSAGES (inode #49287, mod time Wed Dec  3 12:47:14 2003)
Clone duplicate/bad blocks? yes

File /usr/lib/locale/es_HN/LC_COLLATE (inode #49284, mod time Wed Dec  3 12:47:14 2003)
  has 6 duplicate block(s), shared with 1 file(s):
        /usr/lib/locale/cy_GB/LC_MESSAGES (inode #49288, mod time Wed Dec  3 12:47:14 2003)
Clone duplicate/bad blocks? yes

File /usr/lib/locale/eu_ES/LC_TELEPHONE (inode #49285, mod time Wed Dec  3 12:47:15 2003)
  has 1 duplicate block(s), shared with 1 file(s):
        /usr/lib/locale/ca_ES/LC_IDENTIFICATION (inode #49281, mod time Wed Dec  3 12:47:15 2003)
Duplicated blocks already reassigned or cloned.
	:
	:
File /usr/share/gnupg (inode #509096, mod time Sun Dec  7 04:33:18 2003)
  has 1 duplicate block(s), shared with 1 file(s):
        /usr/share/emacs (inode #509092, mod time Sun Dec  7 04:33:18 2003)
Duplicated blocks already reassigned or cloned.

/dev/sda1: e2fsck canceled.

/dev/sda1: ***** FILE SYSTEM WAS MODIFIED *****
[root@hage /mnt]# umount /mnt/sdb1
[root@hage /mnt]# fsck -f -y /dev/sdb1
fsck 1.29 (24-Sep-2002)
e2fsck 1.29 (24-Sep-2002)
Pass 1: Checking inodes, blocks, and sizes
Inode 16912, i_size is 109664, should be 634880.  Fix? yes

Inode 16912, i_blocks is 224, should be 344.  Fix? yes

Inode 33248, i_size is 61382, should be 585728.  Fix? yes

Inode 33248, i_blocks is 128, should be 152.  Fix? yes

Inode 33251, i_size is 73842, should be 602112.  Fix? yes

Inode 33251, i_blocks is 160, should be 216.  Fix? yes
	:
	:
Inode 739183, i_blocks is 808, should be 1512.  Fix? yes

Duplicate blocks found... invoking duplicate block passes.
Pass 1B: Rescan for duplicate/bad blocks
Duplicate/bad block(s) in inode 16912: 34525 34526 34527 34528 34529 34530 34531 34532 34533 34534 34535 34536 34537 34538 3
4539 34525 34526 34527 34528 34529 34530 34531 34532 34533 34534 34535 34536 34537 34538 34539
	:
	:
Inode bitmap differences:  +(65665--66980) -(69761--71076) -(595073--595491)
Fix? yes

Directories count wrong for group #33 (55, counted=54).
Fix? yes


/dev/sdb1: ***** FILE SYSTEM WAS MODIFIED *****
/dev/sdb1: 37018/787968 files (0.1% non-contiguous), 171732/1572864 blocks
[root@hage /mnt]#
複数のドライブに同時に書き込んだ場合にのみ異常が出ると思っていたのだが、 読み出しと書き込みとが同時でもダメのようだ。

あ〜ぁ




ハック de 録!!インストーラ
ハックの記録
LinkStation/玄箱 をハックしよう

玄箱/HG のカーネル入れ換え(2)

Copyright (C) 2005 Yasunari Yamashita. All Rights Reserved.
yasunari @ yamasita.jp 山下康成@京都府向日市