※ギガビットLAN対応 160GB 外付けハードディスク

1.使用した機器

(1)LANDISK IOデータ HDL-GX160R
  ムラウチドットコムで税送料込みで10,348円にて購入。(2007/12/14)
(2)500GB SATA 3.5HDD
  HITACHI 
HDT725050VLA360
  クレバリー店頭でだいぶ前に購入。(購入時期忘れた)
(3)eSATA HDDケース
  Century 裸族の一戸建て 
CRIS35EU2。(最近購入)

2.外付けeSATA HDD(500GB)へのミラーリング

ここでは、HDL-GX160Rのミラーリング機能を使用した。
(1)eSATA HDDケース(500GB内蔵)をHDL-GX160RにeSATA接続した後PowerOnで起動して、
  http://landisk/ でWeb接続し、「管理者用設定ページを開く」から
  「詳細メニュー」→「ディスク」→「ミラーリング」で
  「内蔵HDDからeSATA HDD1へミラーリング開始」ボタンによりミラーリング実施
(2)ミラーリング完了後、同メニューにて「ミラーディスクの保管」ボタンを実施して
  自動シャットダウン後、外付けeSATA HDDを切り離す。

HDL-GX160RのHDDを取り出し、500GBのHDDといっしょにパソコンに接続し、
knoppixのCDかDVDを使ってブートして、たとえば、HDL-GX160Rから取り出した原本HDDが
/dev/sdaと認識されている場合、
dd if=/dev/sda of=/dev/sdb bs=1024k
(HDL-GX160Rから取り出した原本HDDが/dev/sdbで認識の場合は元を消してしまうので注意!)
でもよい。

3.500GBのHDDに換装する

(1)換装

   取り出したものは原本HDDとして大事に保管。

(2)LANDISKが無事ブートすることを確認する。

4.telnetを使用できるようにして、自分用のユーザを追加

(1)以下HPを参考に作業を実施した。ほぼ、そのまんま実行してうまくいきました。

http://www.tuins.ac.jp/~takao/mt/archives/2007_01/19_0026.html
※自分のはファームのバージョンが1.12だったので、1.12→1.13にアップするようなパッケージに化かしました。
※メモ:書き込み可で再マウント:"mount -o remount -w /" はよく使用する。

(2)先のHP内の下のほうに記述がある

「rc.localファイルのHDLモデル名HDL-GXRでhtmextが設定されていないとブラウザからアクセスできなくなる。」の件について実施。

5.ディスクの再構成

ミラーリング先の500GB HDDは160GB用にパーティションが切られているいるため、500GB用に再作成します。

<作成した自分のユーザでログインして、スーパーユーザになる>

landisk.VoIP-ADAPTOR login: hase
Password:
warning: cannot change to home directory
Linux landisk 2.6.12.6-arm1 #1 Mon Mar 5 10:28:02 JST 2007 armv5tejl GNU/Linux

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.
hase@landisk:/$ su -
Password:

<sambaの停止>

landisk:~# cd /etc
landisk:/etc# cd init.d
landisk:/etc/init.d# ./samba stop
Stopping Samba daemons: nmbd smbd.

<再作成するファイルシステムデータのバックアップ>

landisk:/etc/init.d# df -k
Filesystem 1K
rootfs 396608 278260 114253 71% /
/dev/root 396608 278260 114253 71% /
/dev/shm 63264 4092 59172 7% /mnt/ram0
tmpfs 63264 0 63264 0% /dev/shm
/dev/md1 202208 21784 178340 11% /boot
/dev/md5 202175 5244 194844 3% /mnt/hda5
/dev/md6 152451708 32844 150870040 1% /mnt/hda6
landisk:/etc/init.d# cd /mnt/hda5
landisk:/mnt/hda5# tar czvf /tmp/hda5.tgz .
landisk:/mnt/hda5# cd /mnt/hda6
landisk:/mnt/hda6# tar czvf /tmp/hda6.tgz .

<念のため自分のFTPサーバにアップ※/tmpはRAMDISKのため>

landisk:/tmp# ftp www6.plala.or.jp
Connected to www6.plala.or.jp.
220 ProFTPD 1.2.6 Server (WWW6 Server) [www6.plala.or.jp]
Name (www6.plala.or.jp:root): hasep
331 Password required for hasep.
Password:
230 User hasep logged in.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> put hda5.tgz
local: hda5.tgz remote: hda5.tgz
200 PORT command successful
150 Opening BINARY mode data connection for hda5.tgz
226 Transfer complete.
479848 bytes sent in 0.90 secs (521.3 kB/s)
ftp> put hda6.tgz
local: hda6.tgz remote: hda6.tgz
200 PORT command successful
150 Opening BINARY mode data connection for hda6.tgz
226 Transfer complete.
230 bytes sent in 0.00 secs (1688.8 kB/s)
ftp> dir
200 PORT command successful
150 Opening ASCII mode data connection for file list
-rw-r--r-- 1 hasep www6_users 479848 Dec 30 16:07 hda5.tgz
-rw-r--r-- 1 hasep www6_users 230 Dec 30 16:08 hda6.tgz
226 Transfer complete.
ftp> quit
221 Goodbye.

<ファイルシステムのアンマウント>

landisk:/mnt/hda6# cd /tmp
landisk:/tmp# umount /mnt/hda6
landisk:/tmp# umount /mnt/hda5
landisk:/tmp# df -k
Filesystem 1K
rootfs 396608 278260 114253 71% /
/dev/root 396608 278260 114253 71% /
/dev/shm 63264 4576 58688 8% /mnt/ram0
tmpfs 63264 0 63264 0% /dev/shm
/dev/md1 202208 21784 178340 11% /boot

<パーティションの再作成(拡張)>

sda5は拡張パーティションにあるのでいったん消去する必要がある。
拡張パーティションを拡張して作成後、同じサイズで再作成する。
sda6は可能な限り拡張するように拡張パーティションサイズを作成する。

landisk:/tmp# fdisk /dev/sda

The number of cylinders for this disk is set to 60801.
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): p

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 144 530145 82 Linux swap / Solaris
/dev/sda4 145 19452 155091510 5 Extended
/dev/sda5 145 170 208844+ 83 Linux
/dev/sda6 171 19452 154882664+ 83 Linux

Command (m for help): d
Partition number (1-6): 6

Command (m for help): d
Partition number (1-5): 5

Command (m for help): d
Partition number (1-5): 4

Command (m for help): p

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 144 530145 82 Linux swap / Solaris

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

Command (m for help): p

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 144 530145 82 Linux swap / Solaris
/dev/sda4 145 60706 486464265 5 Extended

Command (m for help): n
First cylinder (145-60706, default 145):
Using default value 145
Last cylinder or +size or +sizeM or +sizeK (145-60706, default 60706): 170

Command (m for help): p

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 144 530145 82 Linux swap / Solaris
/dev/sda4 145 60706 486464265 5 Extended
/dev/sda5 145 170 208813+ 83 Linux

Command (m for help): n
First cylinder (171-60706, default 171): 171
Last cylinder or +size or +sizeM or +sizeK (171-60706, default 60706): 60706

Command (m for help): p

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 144 530145 82 Linux swap / Solaris
/dev/sda4 145 60706 486464265 5 Extended
/dev/sda5 145 170 208813+ 83 Linux
/dev/sda6 171 60706 486255388+ 83 Linux

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

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16:
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.

--以下ログが残っていないのでコマンドのみ記述--

<RAIDの停止(本当はアンマウント直後に実施)>

mdadm --stop /dev/md5
mdadm --stop /dev/md6

<ext3でフォーマット>

mke2fs -t ext3 /dev/sda5
mke2fs -t ext3 /dev/sda6

<RAIDの作成>

mdadm --create /dev/md5 --level=raid1 --raid-devices=2 missing /dev/sda5
mdadm --create /dev/md6 --level=raid1 --raid-devices=2 missing /dev/sda6

cat /proc/mdstat
で追加されたことを確認

<RAIDのフォーマット>

mke2fs -j -m1 /dev/md5
mke2fs -j -m1 /dev/md6

<マウント実施>

mount /mnt/hda5
mount /mnt/hda6

<バックアップから戻す>

cd /mnt/hda5
tar xzvf /tmp/hda5.tgz
cd /mnt/hda5
tar xzvf /tmp/hda6.tgz

<リブート>

shutdown -r now