クラッシュ

Debian HS-DHGL

ここのところ、悪いこと続き。

HDD 異常

ビデオサーバ兼ホームディレクトリサーバにしている HS-DHGL の HDD、 SAMSUNG HD103UJ が ERROR を出すようになった。
Nov 12 17:30:14 sil kernel: SAL (ERROR)  UDMA Read failed on UNC at sector 19 08 52 b5
Nov 12 17:30:14 sil kernel: SAL (ERROR)  0 1 0 :Scsi command completed. pScb c42a8d40, ScsiStatus 2 completionStatus MV_SCSI_COMPLETION_ATA_FAILED
Nov 12 17:30:14 sil kernel: SAL (ERROR) CDB:28 0 19 8 52 b4 0 0 8 0
Nov 12 17:30:14 sil kernel: SAL (ERROR) Sense Data:f0 0 3 19 8 52 b5 5 0 0 0 0 0
Nov 12 17:30:14 sil kernel: SAL (ERROR)  ATA Drive Registers:
Nov 12 17:30:14 sil kernel: SAL (ERROR)                Error : 0040
Nov 12 17:30:14 sil kernel: SAL (ERROR)          SectorCount : 0000
Nov 12 17:30:14 sil kernel: SAL (ERROR)              LBA Low : 19b5
Nov 12 17:30:14 sil kernel: SAL (ERROR)              LBA Mid : 0052
Nov 12 17:30:14 sil kernel: SAL (ERROR)             LBA High : 0008
Nov 12 17:30:14 sil kernel: SAL (ERROR)               Device : 0040
Nov 12 17:30:14 sil kernel: SAL (ERROR)               Status : 0051
Nov 12 17:30:14 sil kernel: Linux IAL (ERROR)  [0 1] device error occured
Nov 12 17:30:14 sil kernel: Linux IAL (ERROR) : retry command host=1, bus=1 SCpnt = c143f060
Nov 12 17:30:15 sil kernel: Core Driver (ERROR) 0 1: Edma Error Reg 0x84
Nov 12 17:30:15 sil kernel: Core Driver (ERROR) 0 1: Edma Self disabled due to device error without completion
Nov 12 17:30:15 sil kernel: Core Driver (ERROR) 0 1 0: _getHostTagByDeviceTag, command entry found, host tag = 0x01,  deviceTag(0x01)
Nov 12 17:30:15 sil kernel: Core Driver (ERROR) 0 1: Handle failed command,host tag 0x01, error cause 0x84 (eStatus Tag 0x01)
Nov 12 17:30:15 sil kernel: SAL (ERROR) COMPLETION ERROR , adapter =0, channel=1, flags=84
Nov 12 17:30:15 sil kernel: SAL (ERROR)  Failed command Cdb: 28 00 19 08 52 b4 00 00 08 00
Nov 12 17:30:15 sil kernel: SAL (ERROR) UDMA READ command failed
Nov 12 17:30:15 sil kernel: SAL (ERROR)  UDMA Read failed on UNC at sector 19 08 52 b5
Nov 12 17:30:15 sil kernel: SAL (ERROR)  0 1 0 :Scsi command completed. pScb c42a8d40, ScsiStatus 2 completionStatus MV_SCSI_COMPLETION_ATA_FAILED
Nov 12 17:30:15 sil kernel: SAL (ERROR) CDB:28 0 19 8 52 b4 0 0 8 0
Nov 12 17:30:15 sil kernel: SAL (ERROR) Sense Data:f0 0 3 19 8 52 b5 5 0 0 0 0 0
Nov 12 17:30:15 sil kernel: SAL (ERROR)  ATA Drive Registers:
Nov 12 17:30:15 sil kernel: SAL (ERROR)                Error : 0040
Nov 12 17:30:15 sil kernel: SAL (ERROR)          SectorCount : 0000
Nov 12 17:30:15 sil kernel: SAL (ERROR)              LBA Low : 19b5
Nov 12 17:30:15 sil kernel: SAL (ERROR)              LBA Mid : 0052
Nov 12 17:30:15 sil kernel: SAL (ERROR)             LBA High : 0008
Nov 12 17:30:15 sil kernel: SAL (ERROR)               Device : 0040
Nov 12 17:30:15 sil kernel: SAL (ERROR)               Status : 0051
Nov 12 17:30:15 sil kernel: Linux IAL (ERROR)  [0 1] device error occured
Nov 12 17:30:15 sil kernel: sd 1:0:0:0: SCSI error: return code = 0x8000002
Nov 12 17:30:15 sil kernel: sda: Current: sense key=0x3
Nov 12 17:30:15 sil kernel:    ASC=0x0 ASCQ=0x0
Nov 12 17:30:15 sil kernel: Info fld=0x190852b5
Nov 12 17:30:15 sil kernel: end_request: I/O error, dev sda, sector 419975860

新しい HDD の導入

仕方がないので、京都駅南のショップで、 Western Digital の 1.5TB HDD WD15EADS を買ってきた。
1.5TB HDD が1万円弱。安くなったもんだ

USB で接続

HS-DHGL は、エラーを出し続けながらも動いてはいるので、 HS-DHGL に USB で接続
sil:~# tail -f /var/log/messages
	:
	:
Nov 12 19:35:01 sil kernel: usb 1-1: new high speed USB device using ehci_platform and address 2
Nov 12 19:35:01 sil kernel: usb 1-1: configuration #1 chosen from 1 choice
Nov 12 19:35:01 sil kernel: scsi2 : SCSI emulation for USB Mass Storage devices
Nov 12 19:35:06 sil kernel:  Vendor: ViPowER   Model: VP-89118(SD1)     Rev: 2.10
Nov 12 19:35:06 sil kernel:  Type:   Direct-Access                      ANSI SCSI revision: 04
Nov 12 19:35:06 sil kernel: SCSI device sdb: 2930277168 512-byte hdwr sectors (1500302 MB)
Nov 12 19:35:06 sil kernel: sdb: Write Protect is off
Nov 12 19:35:06 sil kernel: SCSI device sdb: 2930277168 512-byte hdwr sectors (1500302 MB)
Nov 12 19:35:06 sil kernel: sdb: Write Protect is off
Nov 12 19:35:06 sil kernel: sdb: unknown partition table
Nov 12 19:35:06 sil kernel: sd 2:0:0:0: Attached scsi disk sdb
Nov 12 19:35:06 sil kernel: sd 2:0:0:0: Attached scsi generic sg1 type 0

パーティションを切っていく

今動いている 1T の HDD のパーティションは、、、
sil:~# fdisk -l /dev/sda

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1          25      200781   83  Linux
/dev/sda2              26         524     4008217+  83  Linux
/dev/sda3             525         556      257040   82  Linux swap / Solaris
/dev/sda4             557      121601   972293962+  83  Linux
sil:~#
同じように切っていく
sil:~# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0xff693b21.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.


The number of cylinders for this disk is set to 182401.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): 
なんか invalid だが、w で修正されるというので、w

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
sil:~#
やり直し
sil:~# fdisk /dev/sdb

The number of cylinders for this disk is set to 182401.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-182401, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-182401, default 182401): 25

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (26-182401, default 26):
Using default value 26
Last cylinder or +size or +sizeM or +sizeK (26-182401, default 182401): 524

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 3
First cylinder (525-182401, default 525):
Using default value 525
Last cylinder or +size or +sizeM or +sizeK (525-182401, default 182401): 556

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Selected partition 4
First cylinder (557-182401, default 557):
Using default value 557
Last cylinder or +size or +sizeM or +sizeK (557-182401, default 182401):
Using default value 182401

Command (m for help): t
Partition number (1-4): 3
Hex code (type L to list codes): 82
Changed system type of partition 3 to 82 (Linux swap / Solaris)

Command (m for help): p

Disk /dev/sdb: 1500.3 GB, 1500301910016 bytes
255 heads, 63 sectors/track, 182401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xff693b21

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1          25      200781   83  Linux
/dev/sdb2              26         524     4008217+  83  Linux
/dev/sdb3             525         556      257040   82  Linux swap / Solaris
/dev/sdb4             557      182401  1460669962+  83  Linux

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
sil:~#

フォーマット

それぞれフォーマット
sil:~# mke2fs -j -I 128 /dev/sdb1
mke2fs 1.41.3 (12-Oct-2008)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
50200 inodes, 200780 blocks
10039 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=67371008
25 block groups
8192 blocks per group, 8192 fragments per group
2008 inodes per group
Superblock backups stored on blocks:
        8193, 24577, 40961, 57345, 73729

Writing inode tables: done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 26 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
sil:~# mkfs.xfs -f /dev/sdb2
meta-data=/dev/sdb2              isize=256    agcount=4, agsize=250514 blks
         =                       sectsz=512   attr=2
data     =                       bsize=4096   blocks=1002054, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096
log      =internal log           bsize=4096   blocks=2560, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=0
realtime =none                   extsz=4096   blocks=0, rtextents=0
sil:~# mkswap /dev/sdb3
Setting up swapspace version 1, size = 263204 kB
no label, UUID=b851db57-4769-4383-af5b-bc24573ec25e
sil:~# mkfs.xfs -f /dev/sdb4
meta-data=/dev/sdb4              isize=256    agcount=4, agsize=91291873 blks
         =                       sectsz=512   attr=2
data     =                       bsize=4096   blocks=365167490, imaxpct=5
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096
log      =internal log           bsize=4096   blocks=32768, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=0
realtime =none                   extsz=4096   blocks=0, rtextents=0
sil:~#

まずは ビデオの救出

システムはバックアップがあるので、録画したビデオを納めている /mnt を 救出する。
sil:~# mkdir /tmp/mnt
sil:~# mount /dev/sdb4  /tmp/mnt/
sil:~# ls /tmp/mnt/
sil:~# ls /mnt
Backup  Music  Video  buffalo  wk
sil:~# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda2              3997976    378792   3619184  10% /
tmpfs                    63052         0     63052   0% /lib/init/rw
tmpfs                    63052         0     63052   0% /dev/shm
/dev/root.old            13303     11362      1941  86% /initrd
/dev/sda1               194443     10534    173870   6% /boot
/dev/sda4            972162888 730540724 241622164  76% /mnt
/dev/sdb4            1460538888        80 1460538808   1% /tmp/mnt
sil:~# (cd /mnt; tar cf - . )|(cd /tmp/mnt; tar xvf -)
./
./buffalo/
./buffalo/bin/
./buffalo/bin/bash
./buffalo/bin/bash2
	:
Unknown error 990
エラーが発生。

この先記録なし

ここから先、試行錯誤しすぎて記録なし。
途中で近畿最北端にも行ったし(意味不明)

結局 HS-DHGL だけでは新しい HDD が構築できず、
まぁ、エラーの出ている HDD で動いている OS では まともに動かなくても仕方がない。

LS-XHL+ハックキットに USB で HDD を接続、
上記フォーマットまでを実行、
バックアップからシステムを戻して、
できあがった HDD を HS-DHGL にセットして起動
エラーが発生している HDD を HS-DHGL に USB で接続
ビデオを救出している。いまここ

sil:~# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda2              3997976    369476   3628500  10% /
tmpfs                    63052         0     63052   0% /lib/init/rw
tmpfs                    63052         0     63052   0% /dev/shm
/dev/root.old            13303     11362      1941  86% /initrd
/dev/sda1               194442     12070    172333   7% /boot
/dev/sda4            1460538888 382001348 1078537540  27% /mnt
/dev/sdb4            972162888 713339928 258822960  74% /tmp/mnt
sil:~#
sdb4 の中身を sda4 にコピーするので、 あと 300GB 程コピーが必要


HS-DHGL
バッファローダイレクト
楽天市場
Yahoo!ショッピング
ValuMore!
ムラウチドットコム


ミス
ハックの記録
LinkStation/玄箱 をハックしよう

今でも bash はパイプでハングアップ?

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