LANTANK:~# vi /etc/fstab
# /etc/fstab: static file system information.
#
#                
proc            /proc           proc    defaults        0       0
/dev/hda1       /               ext3    defaults,errors=remount-ro 0       1
/dev/hda2       none            swap    sw              0       0
#/dev/hda3       /share          ext3    defaults,errors=remount-ro 0       1
/dev/md0       /share          ext3    defaults,errors=remount-ro 0       1
LANTANK:~# vi /etc/raidtab
raiddev /dev/md0
        raid-level      1
        nr-raid-disks   2
        chunk-size      32
        persistent-superblock 1
        device          /dev/hda3
        raid-disk     0
        device          /dev/hdb1
        failed-disk       1
LANTANK:~# df -m
Filesystem           1M-ブロック    使用   使用可 使用% マウント位置
/dev/hda1                 1931       492      1341  27% /
/dev/md0                279629    237526     27899  90% /share
LANTANK:~# dd if=/dev/hda of=/share/others/hda.mbr bs=512 count=1
読み込んだブロック数は 1+0
書き込んだブロック数は 1+0
512 bytes transferred in 0.050343 seconds (10170 bytes/sec)
LANTANK:~# fdisk -l
Disk /dev/hda: 300.0 GB, 300090728448 bytes
255 heads, 63 sectors/track, 36483 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
   Device Boot    Start       End    Blocks   Id  System
/dev/hda1               1         250     2008093+  83  Linux
/dev/hda2             251         267      136552+  82  Linux swap
/dev/hda3             268       36483   290905020   fd  Linux raid autodetect
Disk /dev/hdb: 300.0 GB, 300090728448 bytes
255 heads, 63 sectors/track, 36483 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
   Device Boot    Start       End    Blocks   Id  System
LANTANK:~# fdisk /dev/hdb
The number of cylinders for this disk is set to 36483.
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-36483, default 1): 1
Last cylinder or +size or +sizeM or +sizeK (1-36483, default 36483): 250
Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (251-36483, default 251): 251
Last cylinder or +size or +sizeM or +sizeK (251-36483, default 36483): 267
Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 3
First cylinder (268-36483, default 268): 268
Last cylinder or +size or +sizeM or +sizeK (268-36483, default 36483): 36483
Command (m for help): t
Partition number (1-4): 1
Hex code (type L to list codes): 83
Command (m for help): t
Partition number (1-4): 2
Hex code (type L to list codes): 82
Changed system type of partition 2 to 82 (Linux swap)
Command (m for help): t
Partition number (1-4): 3
Hex code (type L to list codes): fd
Changed system type of partition 3 to fd (Linux raid autodetect)
Command (m for help): a
Partition number (1-4): 1
Command (m for help): p
Disk /dev/hdb: 300.0 GB, 300090728448 bytes
255 heads, 63 sectors/track, 36483 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
   Device Boot    Start       End    Blocks   Id  System
/dev/hdb1   *           1         250     2008093+  83  Linux
/dev/hdb2             251         267      136552+  82  Linux swap
/dev/hdb3             268       36483   290905020   fd  Linux raid autodetect
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
LANTANK:~# vi /etc/raidtab
raiddev /dev/md0
        raid-level      1
        nr-raid-disks   2
        chunk-size      32
        persistent-superblock 1
        device          /dev/hda3
        raid-disk     0
        device          /dev/hdb3
        failed-disk       1
LANTANK:~# cp /etc/lilo.cross /etc/lilo.hdb
LANTANK:~# vi /etc/lilo.hdb
linear
boot=/dev/hdb
disk=/dev/hdb
bios=0x80
timeout=3
default=snow_white
install=/boot/boot-sel.b-v214
image=/boot/zImage.HDLWU
        label=snow_white
        read-only
        append="mem=64M root=/dev/hda1 console=ttySC1,9600"
LANTANK:~# mkfs.ext3 /dev/hdb1
mke2fs 1.35 (28-Feb-2004)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
251392 inodes, 502023 blocks
25101 blocks (5.00%) reserved for the super user
First data block=0
16 block groups
32768 blocks per group, 32768 fragments per group
15712 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912
Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 38 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
LANTANK:~# mount /dev/hdb1 /mnt
LANTANK:~# rm -rf /mnt/*
LANTANK:~# cd /
LANTANK:/# cp -a bin boot cdrom dev etc floppy home initrd lib opt root sbin sys usr var mnt
LANTANK:/# cd mnt
LANTANK:/mnt# mkdir tmp proc mnt share
LANTANK:/mnt# lilo -r /mnt -C /etc/lilo.hdb
Added snow_white *
LANTANK:/mnt# vi /mnt/etc/fstab
# /etc/fstab: static file system information.
#
#                
proc            /proc           proc    defaults        0       0
/dev/hda1       /               ext3    defaults,errors=remount-ro 0       1
/dev/hda2       none            swap    sw              0       0
#/dev/hda3       /share          ext3    defaults,errors=remount-ro 0       1
#/dev/md0       /share          ext3    defaults,errors=remount-ro 0       1
HDD:Bのジャンパーをマスターに指し直して、HDD:Bのみ接続してbootする。
HDD:Bでboot okだからHDD2台つなごうとして、HDD:Bを取り外そうとしたらIDEケーブルのコネクターがもげた…orz
コネクタ自体は破損してないからハンダ付…しないしない(笑)
とりあえずHDD1台なら問題無く動いているから、まぁ良いけど。
でもHDDを余らせておいてもしょうがないし、そこらへんに置いとくとMy sonの玩具になって使えなくなりそうだしなぁ…。
もう一台白箱を買うか、ものは試しで玄箱を買うか、それともNAS仕様の他のHDDケースを買うか…。
[続きがあれば読む]
[記事を折りたたむ]