debian 化(18)2台目の HDD の追加

LS-WSGL/R1

起動時の faild がなくなったので、2台目の HDD を追加する。
これで起動時のエラーは全部なくなるはず。
2台目の HDD は標準ファームでも使った MAXTOR の 6Y160M0。

LS-GL でフォーマット

LS-WSGL + debian でフォーマットしようとしたら USB HDD を認識しなかったので、 取り急ぎ LS-GL + ハックキットでフォーマットする。

USB で接続

MAXTOR 6Y160M0 を USB で接続する。
ude:~# tail -f /var/log/messages
	:
	:

Oct  2 21:56:36 ude kernel: usb 2-1: new high speed USB device using ehci_platform and address 2
Oct  2 21:56:37 ude kernel: usb 2-1: configuration #1 chosen from 1 choice
Oct  2 21:56:37 ude kernel: scsi2 : SCSI emulation for USB Mass Storage devices
Oct  2 21:56:42 ude kernel:   Vendor: Maxtor 6  Model: J6QE              Rev: 11W0
Oct  2 21:56:42 ude kernel:   Type:   Direct-Access                      ANSI SCSI revision: 02
Oct  2 21:56:42 ude kernel: SCSI device sdb: 320173056 512-byte hdwr sectors (163929 MB)
Oct  2 21:56:42 ude kernel: sdb: Write Protect is off
Oct  2 21:56:42 ude kernel: SCSI device sdb: 320173056 512-byte hdwr sectors (163929 MB)
Oct  2 21:56:42 ude kernel: sdb: Write Protect is off
Oct  2 21:56:42 ude kernel:  sdb: sdb1 sdb2 sdb4 < sdb5 sdb6 >
Oct  2 21:56:42 ude kernel: sd 2:0:0:0: Attached scsi disk sdb
Oct  2 21:56:42 ude kernel: sd 2:0:0:0: Attached scsi generic sg1 type 0

フォーマット

sdb1, sdb2, sdb5 をそれぞれフォーマットする。

sdb1 は ext3 に。

ude:~# mkfs.ext3 -j /dev/sdb1
mke2fs 1.40-WIP (14-Nov-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
125696 inodes, 251007 blocks
12550 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=260046848
8 block groups
32768 blocks per group, 32768 fragments per group
15712 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376

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

This filesystem will be automatically checked every 28 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
ude:~#
sdb2 は、ext3 にフォーマットしてから xfs に。
ude:~# mkfs.ext3 -j /dev/sdb2
mke2fs 1.40-WIP (14-Nov-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
626496 inodes, 1251061 blocks
62553 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=1283457024
39 block groups
32768 blocks per group, 32768 fragments per group
16064 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736

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

This filesystem will be automatically checked every 21 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
ude:~# mkfs.xfs !$
mkfs.xfs /dev/sdb2
mkfs.xfs: /dev/sdb2 appears to contain an existing filesystem (ext3).
mkfs.xfs: Use the -f option to force overwrite.
ude:~# mkfs.xfs -f /dev/sdb2
meta-data=/dev/sdb2              isize=256    agcount=8, agsize=156382 blks
         =                       sectsz=512   attr=0
data     =                       bsize=4096   blocks=1251056, imaxpct=25
         =                       sunit=0      swidth=0 blks, unwritten=1
naming   =version 2              bsize=4096
log      =internal log           bsize=4096   blocks=2560, version=1
         =                       sectsz=512   sunit=0 blks
realtime =none                   extsz=65536  blocks=0, rtextents=0
ude:~#
/dev/sdb5 は swap に。
ude:~# mkswap /dev/sdb5
Setting up swapspace version 1, size = 1028120 kB
no label, UUID=f8b914cf-c964-4cd1-909a-bf293159d6ff
ude:~#
no label って何?

LS-WSGL に接続

LS-WSGL の SATA1 に接続。
起動する。
標準ファームの機能で、ミラーリングされるはず。。。。
Debian GNU/Linux 4.0 mini ttyS0

mini login: root
Password:
Last login: Thu Nov  1 01:15:12 2007 on ttyS0
Linux mini 2.6.16.16-arm1 #316 Tue Jul 22 16:22:33 JST 2008 armv5tejl

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
mini:~# cat /proc/mdstat
Personalities : [raid0] [raid1]
md1 : active raid1 sda2[1]
      5004160 blocks [2/1] [_U]

md10 : active raid1 sda5[0]
      1003904 blocks [2/1] [U_]

md0 : active raid1 sda1[1]
      1003904 blocks [2/1] [_U]

unused devices: <none>
mini:~#
ミラーリングされている様子がない。

仕方がないので、手でミラーリング。
まずは、md0

mini:~# mdadm -E /dev/sda1
/dev/sda1:
          Magic : a92b4efc
        Version : 00.90.00
           UUID : adbe578f:b86ab25a:09937ff0:e2de4343
  Creation Time : Thu Jun 19 16:33:50 2008
     Raid Level : raid1
    Device Size : 1003904 (980.54 MiB 1028.00 MB)
     Array Size : 1003904 (980.54 MiB 1028.00 MB)
   Raid Devices : 2
  Total Devices : 1
Preferred Minor : 0

    Update Time : Thu Nov  1 01:56:57 2007
          State : clean
 Active Devices : 1
Working Devices : 1
 Failed Devices : 0
  Spare Devices : 0
       Checksum : 8b583b37 - correct
         Events : 0.1709


      Number   Major   Minor   RaidDevice State
this     1       8        1        1      active sync   /dev/sda1

   0     0       0        0        0      removed
   1     1       8        1        1      active sync   /dev/sda1
mini:~# mdadm -a /dev/md0 /dev/sdb1
md: bind<sdb1>
RAID1 conf printout:
 --- wd:1 rd:2
 disk 0, wo:1, o:1, dev:sdb1
 disk 1, wo:0, o:1, dev:sda1
md: syncing RAID array md0
md: minimum _guaranteed_ reconstruction speed: 1000 KB/sec/disc.
md: using maximum available idle IO bandwidth (but not more than 50000 KB/sec) for reconstruction.
md: using 128k window, over a total of 1003904 blocks.
mdadm: added /dev/sdb1
mini:~# cat /proc/mdstat
Personalities : [raid0] [raid1]
md1 : active raid1 sda2[1]
      5004160 blocks [2/1] [_U]

md10 : active raid1 sda5[0]
      1003904 blocks [2/1] [U_]

md0 : active raid1 sdb1[2] sda1[1]
      1003904 blocks [2/1] [_U]
      [======>..............]  recovery = 33.6% (338048/1003904) finish=0.2min speed=48458K/sec

unused devices: <none>
mini:~# md: md0: sync done.
RAID1 conf printout:
 --- wd:2 rd:2
 disk 0, wo:0, o:1, dev:sdb1
 disk 1, wo:0, o:1, dev:sda1

mini:~# cat /proc/mdstat
Personalities : [raid0] [raid1]
md1 : active raid1 sda2[1]
      5004160 blocks [2/1] [_U]

md10 : active raid1 sda5[0]
      1003904 blocks [2/1] [U_]

md0 : active raid1 sdb1[0] sda1[1]
      1003904 blocks [2/2] [UU]

unused devices: <none>
mini:~# mdadm -E /dev/sda1
/dev/sda1:
          Magic : a92b4efc
        Version : 00.90.00
           UUID : adbe578f:b86ab25a:09937ff0:e2de4343
  Creation Time : Thu Jun 19 16:33:50 2008
     Raid Level : raid1
    Device Size : 1003904 (980.54 MiB 1028.00 MB)
     Array Size : 1003904 (980.54 MiB 1028.00 MB)
   Raid Devices : 2
  Total Devices : 2
Preferred Minor : 0

    Update Time : Thu Nov  1 01:59:13 2007
          State : clean
 Active Devices : 2
Working Devices : 2
 Failed Devices : 0
  Spare Devices : 0
       Checksum : 8b583bdb - correct
         Events : 0.1710


      Number   Major   Minor   RaidDevice State
this     1       8        1        1      active sync   /dev/sda1

   0     0       8       17        0      active sync   /dev/sdb1
   1     1       8        1        1      active sync   /dev/sda1
mini:~#
続いて、md1
mini:~# mdadm -E /dev/sdb2
mdadm: No md superblock detected on /dev/sdb2.
mini:~# mdadm -a /dev/md1 /dev/sdb2
md: bind<sdb2>
RAID1 conf printout:
 --- wd:1 rd:2
 disk 0, wo:1, o:1, dev:sdb2
 disk 1, wo:0, o:1, dev:sda2
md: syncing RAID array md1
md: minimum _guaranteed_ reconstruction speed: 1000 KB/sec/disc.
md: using maximum available idle IO bandwidth (but not more than 50000 KB/sec) for reconstruction.
md: using 128k window, over a total of 5004160 blocks.
mdadm: added /dev/sdb2
mini:~# mdadm -E /dev/sda2
/dev/sda2:
          Magic : a92b4efc
        Version : 00.90.00
           UUID : db218435:100e25e7:d2ba170f:d67ec206
  Creation Time : Thu Jun 19 16:33:51 2008
     Raid Level : raid1
    Device Size : 5004160 (4.77 GiB 5.12 GB)
     Array Size : 5004160 (4.77 GiB 5.12 GB)
   Raid Devices : 2
  Total Devices : 2
Preferred Minor : 1

    Update Time : Thu Nov  1 02:02:09 2007
          State : clean
 Active Devices : 1
Working Devices : 2
 Failed Devices : 0
  Spare Devices : 1
       Checksum : cd639f01 - correct
         Events : 0.22489


      Number   Major   Minor   RaidDevice State
this     1       8        2        1      active sync   /dev/sda2

   0     0       0        0        0      removed
   1     1       8        2        1      active sync   /dev/sda2
   2     2       8       18        2      spare   /dev/sdb2
mini:~# cat /proc/mdstat
Personalities : [raid0] [raid1]
md1 : active raid1 sdb2[2] sda2[1]
      5004160 blocks [2/1] [_U]
      [===>.................]  recovery = 19.4% (974848/5004160) finish=1.3min speed=48801K/sec

md10 : active raid1 sda5[0]
      1003904 blocks [2/1] [U_]

md0 : active raid1 sdb1[0] sda1[1]
      1003904 blocks [2/2] [UU]

unused devices: <none>
mini:~# cat /proc/mdstat
Personalities : [raid0] [raid1]
md1 : active raid1 sdb2[2] sda2[1]
      5004160 blocks [2/1] [_U]
      [===================>.]  recovery = 99.0% (4957312/5004160) finish=0.0min speed=48413K/sec

md10 : active raid1 sda5[0]
      1003904 blocks [2/1] [U_]

md0 : active raid1 sdb1[0] sda1[1]
      1003904 blocks [2/2] [UU]

unused devices: <none>
mini:~# md: md1: sync done.
RAID1 conf printout:
 --- wd:2 rd:2
 disk 0, wo:0, o:1, dev:sdb2
 disk 1, wo:0, o:1, dev:sda2

mini:~# cat /proc/mdstat
Personalities : [raid0] [raid1]
md1 : active raid1 sdb2[0] sda2[1]
      5004160 blocks [2/2] [UU]

md10 : active raid1 sda5[0]
      1003904 blocks [2/1] [U_]

md0 : active raid1 sdb1[0] sda1[1]
      1003904 blocks [2/2] [UU]

unused devices: <none>
mini:~# mdadm -E /dev/sda2
/dev/sda2:
          Magic : a92b4efc
        Version : 00.90.00
           UUID : db218435:100e25e7:d2ba170f:d67ec206
  Creation Time : Thu Jun 19 16:33:51 2008
     Raid Level : raid1
    Device Size : 5004160 (4.77 GiB 5.12 GB)
     Array Size : 5004160 (4.77 GiB 5.12 GB)
   Raid Devices : 2
  Total Devices : 2
Preferred Minor : 1

    Update Time : Thu Nov  1 02:03:44 2007
          State : clean
 Active Devices : 2
Working Devices : 2
 Failed Devices : 0
  Spare Devices : 0
       Checksum : cd639f70 - correct
         Events : 0.22500


      Number   Major   Minor   RaidDevice State
this     1       8        2        1      active sync   /dev/sda2

   0     0       8       18        0      active sync   /dev/sdb2
   1     1       8        2        1      active sync   /dev/sda2
mini:~#
md10 も
mini:~# mdadm -E /dev/sda5
/dev/sda5:
          Magic : a92b4efc
        Version : 00.90.00
           UUID : 5ff62718:4b361669:2597d6c1:28cfaec3
  Creation Time : Thu Nov  1 00:42:25 2007
     Raid Level : raid1
    Device Size : 1003904 (980.54 MiB 1028.00 MB)
     Array Size : 1003904 (980.54 MiB 1028.00 MB)
   Raid Devices : 2
  Total Devices : 1
Preferred Minor : 10

    Update Time : Thu Nov  1 03:13:47 2007
          State : clean
 Active Devices : 1
Working Devices : 1
 Failed Devices : 1
  Spare Devices : 0
       Checksum : 311fcc6a - correct
         Events : 0.7


      Number   Major   Minor   RaidDevice State
this     0       8        5        0      active sync   /dev/sda5

   0     0       8        5        0      active sync   /dev/sda5
   1     1       0        0        1      faulty removed
mini:~# mdadm -a /dev/md10 /dev/sdb5
md: bind<sdb5>
RAID1 conf printout:
 --- wd:1 rd:2
 disk 0, wo:0, o:1, dev:sda5
 disk 1, wo:1, o:1, dev:sdb5
md: syncing RAID array md10
md: minimum _guaranteed_ reconstruction speed: 1000 KB/sec/disc.
md: using maximum available idle IO bandwidth (but not more than 50000 KB/sec) for reconstruction.
md: using 128k window, over a total of 1003904 blocks.
mdadm: added /dev/sdb5
mini:~# md: md10: sync done.
RAID1 conf printout:
 --- wd:2 rd:2
 disk 0, wo:0, o:1, dev:sda5
 disk 1, wo:0, o:1, dev:sdb5

mini:~# mdadm -E /dev/sda5
/dev/sda5:
          Magic : a92b4efc
        Version : 00.90.00
           UUID : 5ff62718:4b361669:2597d6c1:28cfaec3
  Creation Time : Thu Nov  1 00:42:25 2007
     Raid Level : raid1
    Device Size : 1003904 (980.54 MiB 1028.00 MB)
     Array Size : 1003904 (980.54 MiB 1028.00 MB)
   Raid Devices : 2
  Total Devices : 2
Preferred Minor : 10

    Update Time : Thu Nov  1 02:05:07 2007
          State : clean
 Active Devices : 2
Working Devices : 2
 Failed Devices : 0
  Spare Devices : 0
       Checksum : 311fbc70 - correct
         Events : 0.8


      Number   Major   Minor   RaidDevice State
this     0       8        5        0      active sync   /dev/sda5

   0     0       8        5        0      active sync   /dev/sda5
   1     1       8       21        1      active sync   /dev/sdb5
mini:~#
これで、全部 RAID1 になった。

再起動

再起動で、RAID1 のまま立ち上がってくれれば OK.
Debian GNU/Linux 4.0 mini ttyS0

mini login: root
Password:
Last login: Thu Nov  1 01:57:11 2007 on ttyS0
Linux mini 2.6.16.16-arm1 #316 Tue Jul 22 16:22:33 JST 2008 armv5tejl

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
mini:~# cat /proc/mdstat
Personalities : [raid0] [raid1]
md1 : active raid1 sdb2[0] sda2[1]
      5004160 blocks [2/2] [UU]

md10 : active raid1 sda5[0] sdb5[1]
      1003904 blocks [2/2] [UU]

md0 : active raid1 sdb1[0] sda1[1]
      1003904 blocks [2/2] [UU]

unused devices: <none>
mini:~#
できた。

でも、どうして標準ファームは自動的にリビルドしてくれなかった??
initrd の /linuxrc を削りすぎた???


LS-WSGL debian 化の残課題まとめ

1.debian がまともに動くようにする

1)起動時のエラーつぶし
(1)md0 の起動時マウント
・ネットワークの設定
・パッケージリストのアップデート
・mdadm のインストール
2)標準ファームによる RAID 化(md0, md1, md10)
3)電源スイッチによる電源OFF実現
4)LED の点滅解除
5)パッケージのアップデート
6)swap の有効化
7)標準ファームのジェイル化
8)カーネルモジュールのロード

2.手順化、ハックキット化

1)シリアルコンソールを使わないインストール方法の検討
2)インストーラ作成


LinkStation Mini
LS-WSGL
楽天市場
Amazon
Yahoo!ショッピング
Livedoor デパート
Sofmap
TSUKUMO ネットショップ
ムラウチドットコム
ヤマダ電機WEB
パソQ


ファームウェア アップデータ Ver.1.20 のインストール
ハックの記録
LinkStation/玄箱 をハックしよう

設定が復元できていない

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