HDL4-G hack(1)

自宅のSMB鯖として買ったHDL4-G2.0(2TBモデル)がある。
中身はarmベースのLinuxで少々hackすればtelnet接続可能になるようである。
とりあえずデバイス構成などをメモ。

cassowary:~# mount
rootfs on / type rootfs (rw)
/dev/root on / type ext3 (ro,noatime,nodiratime)
/dev/shm on /mnt/ram0 type tmpfs (rw)
proc on /proc type proc (rw,nodiratime,nosuid,noexec)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw)
tmpfs on /dev/shm type tmpfs (rw)
usbfs on /proc/bus/usb type usbfs (rw)
/dev/md1 on /boot type ext2 (rw)
/dev/md5 on /mnt/hda5 type ext3 (rw,sync)
/dev/md13 on /mnt/sataraid1 type xfs (rw)
cassowary:~# cat /etc/fstab 
proc                            /proc           proc    defaults,nosuid,noexec  0 0
/dev/md1                        /boot           ext2    defaults,rw     0 0
/dev/md2                        /               ext3    defaults,rw     1 1
/dev/sda3                       swap            swap    defaults        0 0
/dev/sdb3                       swap            swap    defaults        0 0
/dev/sdc3                       swap            swap    defaults        0 0
/dev/sdd3                       swap            swap    defaults        0 0
/dev/sde3                       swap            swap    defaults        0 0
/dev/sdf3                       swap            swap    defaults        0 0
/dev/md5                        /mnt/hda5       ext3    defaults,rw,sync        0 0
cassowary:~# 

swapは6台分記載されているが、存在しているのは4台。

/dev/md1, /dev/md2, /dev/md5は各々/dev/sd?1, /dev/sd?2, /dev/sd?5のraid1のようだ。

cassowary:~# mdadm --detail /dev/md1
/dev/md1:
        Version : 00.90.03
  Creation Time : Mon Mar 17 11:40:13 2008
     Raid Level : raid1
     Array Size : 208768 (203.91 MiB 213.78 MB)
    Device Size : 208768 (203.91 MiB 213.78 MB)
   Raid Devices : 6
  Total Devices : 4
Preferred Minor : 1
    Persistence : Superblock is persistent

    Update Time : Sat Apr 18 10:10:04 2009
          State : clean, degraded
 Active Devices : 4
Working Devices : 4
 Failed Devices : 0
  Spare Devices : 0

           UUID : 秘密
         Events : 0.1565

    Number   Major   Minor   RaidDevice State
       0       8        1        0      active sync   /dev/sda1
       1       8       17        1      active sync   /dev/sdb1
       2       8       33        2      active sync   /dev/sdc1
       3       8       49        3      active sync   /dev/sdd1
       4       0        0        4      removed
       5       0        0        5      removed
cassowary:~# 

/bootは/dev/sd?1のミラーで構成されているから、ブートローダは生きている
ディスクの第一パーティションにあるext2ファイルシステムからカーネルイメージと
初期RAM diskを読み込んでブートという手順になるのであろう。

パーティションテーブルはこんな具合

cassowary:~# fdisk -l /dev/sda1

Disk /dev/sda1: 213 MB, 213857280 bytes
255 heads, 63 sectors/track, 26 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sda1 doesn't contain a valid partition table
cassowary:~# fdisk -l /dev/sda 

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               2          27      208845   83  Linux
/dev/sda2              28          78      409657+  83  Linux
/dev/sda3              79         210     1060290   82  Linux swap / Solaris
/dev/sda4             211       60788   486592785    5  Extended
/dev/sda5             211         276      530144+  83  Linux
/dev/sda6             277       60788   486062639+  83  Linux
cassowary:~# 

実際のデータは/dev/sd?6 にあるようだ。

cassowary:~# mdadm --detail /dev/md13
/dev/md13:
        Version : 00.90.03
  Creation Time : Mon Mar 17 14:03:06 2008
     Raid Level : raid1
     Array Size : 1458187520 (1390.64 GiB 1493.18 GB)
    Device Size : 1458187520 (1390.64 GiB 1493.18 GB)
   Raid Devices : 2
  Total Devices : 1
Preferred Minor : 13
    Persistence : Superblock is persistent

    Update Time : Sat Apr 18 06:25:58 2009
          State : clean, degraded
 Active Devices : 1
Working Devices : 1
 Failed Devices : 0
  Spare Devices : 0

           UUID : 秘密
         Events : 0.400647

    Number   Major   Minor   RaidDevice State
       0       9       10        0      active sync   /dev/md10
       1       0        0        1      removed
cassowary:~# mdadm --detail /dev/md10
/dev/md10:
        Version : 00.90.03
  Creation Time : Mon Mar 17 14:03:06 2008
     Raid Level : raid5
     Array Size : 1458187584 (1390.64 GiB 1493.18 GB)
    Device Size : 486062528 (463.55 GiB 497.73 GB)
   Raid Devices : 4
  Total Devices : 4
Preferred Minor : 10
    Persistence : Superblock is persistent

    Update Time : Sat Apr 18 06:25:58 2009
          State : clean
 Active Devices : 4
Working Devices : 4
 Failed Devices : 0
  Spare Devices : 0

         Layout : left-symmetric
     Chunk Size : 64K

           UUID : 秘密
         Events : 0.901993

    Number   Major   Minor   RaidDevice State
       0       8        6        0      active sync   /dev/sda6
       1       8       22        1      active sync   /dev/sdb6
       2       8       38        2      active sync   /dev/sdc6
       3       8       54        3      active sync   /dev/sdd6
cassowary:~# 

RAID5の上にRAID1を重ねてあるのはミラーでのバックアップ用途のためかもしれない。