[[ SATA box の設定 (公開)]] 2008.10 現在 flex に接続している SATA HDD Box の設定方法を記録。 2008.10.25 by R. Saito #contents ** 機種名 [#x211a969] - Century Corp. ドライブドア、SATA ボックス レイド - HDD 1TB x 4 - http://www.century.co.jp/ ** PCIe interface カードに対する driver の作製。 [#ja71c73c] - Silicon Image 社から driver のソースをダウンロード -- ダウンロードしたドライバは既にFLEXにある。 /home/skel/driver/sil3132/si3132r5_RHEL43_32bit_v1087_driver_and_GUI.tar.gz -- [[Silicon Image 社:http://www.siliconimage.com]]のウェブページへ行く。 -- Supportをクリックし、次のようにメニューを選択して行く。 Step 1 : Sil3132 - PCI Express (1x) to 2 Port SATA300 Step 2 : Driver Step 3 : Linux 32-bit Goを押すと Support Search Results Product: SiI3132 - PCI Express (1x) to 2 Port SATA300 Category: Driver O/S: Linux 32-bit から始まるウェブページがあらわれる。ページ内から最新のドライバを探し出し 取得する。2008年10月25日における最新の[[32bitのCentOS用のドライバ:http://www.siliconimage.com/docs/si3132r5_RHEL43_32bit_v1087_driver_and_GUI.tar.gz]]は SiI 3132 32-bit Red Hat Enterprise Linux 4.0 Update 3 SATARAID5 Management Utility & Driver for 32bit AMD and 32bit EMT64T Version : 1.0.8.7 Date : 11/19/2006 - ドライバの作成とインストール -- ファイルを展開する tar zxf si3132r5_RHEL43_32bit_v1087_driver_and_GUI.tar.gz cd driver -- ドライバを取り出す cat modules.cgz | gunzip | cpio -ivH crc -- FLEX用にSMP(CPUが複数個あるコンピューター)カーネル用のドライバを選ぶ。 cd 2.6.9-34.ELsmp cp /lib/modules/`uname -r`/kernel/drivers/scsi si3132r5.ko cd /lib/modules/`uname -r`/kernel/drivers/scsi ** Linux Kernel に driver module の組み込み [#rb704c54] - 全ての作業は、flex を落とすことなくできる。 - uname -a で現在の Kernel のバージョンがわかる。 - バージョンに該当する場所に移動 cd /lib/modules/2.6.9-67.0.7.ELsmp/kernel/drivers/scsi - module の表示 lsmod - module の消去は rmmod コマンドを用いる。 - もしsata_sil24というドライバが組み込まれていたら、これからインストールするドライバと競合するので削除する rmmod sata_sil24 - module の追加は insmod si3132r5.ko - 再起動したときに自動でmoduleが読み込まれるように/etc/modprobe.confを変更する - modprobe.confに次を追加する。scsi_hostadapter1という名前がmodprobe.confの中で重複していないように注意する。重複していたら末尾の数字の番号を変える。 alias scsi_hostadapter1 sata_sil24 <- あったら削除 alias scsi_hostadapter1 si3132r5 <- 追加 - 再起動時にドライバが読み込まれないときは上記の作業を再びおこなう。 ** 電源を入れ、device の認識の確認。 [#vcd44c0d] - 電源を入れると、デバイスを認識したメッセージがつく。 - このメッセージの中に、/dev/sde にするという内容があるので注意。 - また SATA box の4つのLEDが点灯する。 - このデバイスは SCSI として認識。 flex48:scsi% cat /proc/scsi/scsi Attached devices: Host: scsi0 Channel: 00 Id: 00 Lun: 00 Vendor: ATA Model: HDT722525DLA380 Rev: V44O Type: Direct-Access ANSI SCSI revision: 05 Host: scsi1 Channel: 00 Id: 00 Lun: 00 Vendor: ATA Model: HDT722525DLA380 Rev: V44O Type: Direct-Access ANSI SCSI revision: 05 Host: scsi4 Channel: 00 Id: 00 Lun: 00 Vendor: ATA Model: HDT722525DLA380 Rev: V44O Type: Direct-Access ANSI SCSI revision: 05 Host: scsi5 Channel: 00 Id: 00 Lun: 00 Vendor: ATA Model: HDT722525DLA380 Rev: V44O Type: Direct-Access ANSI SCSI revision: 05 Host: scsi8 Channel: 01 Id: 31 Lun: 00 Vendor: SI Model: Pseudo Device Rev: 0000 Type: Processor ANSI SCSI revision: 05 Host: scsi8 Channel: 01 Id: 00 Lun: 00 Vendor: WDC WD10 Model: EACS-00D6B0 Rev: 01.0 Type: Direct-Access ANSI SCSI revision: 02 Host: scsi8 Channel: 01 Id: 01 Lun: 00 Vendor: WDC WD10 Model: EACS-00D6B0 Rev: 01.0 Type: Direct-Access ANSI SCSI revision: 02 Host: scsi8 Channel: 01 Id: 02 Lun: 00 Vendor: WDC WD10 Model: EACS-00D6B0 Rev: 01.0 Type: Direct-Access ANSI SCSI revision: 02 Host: scsi8 Channel: 01 Id: 03 Lun: 00 Vendor: WDC WD10 Model: EACS-00D6B0 Rev: 01.0 Type: Direct-Access ANSI SCSI revision: 02 - WDC と記されているものが該当。 - /dev/sde, /dev/sdf, /dev/sdg, /dev/sgh が対応。 ** Partition の作製 [#b713d988] - fdisk コマンドで、全て Linux のfile system を作る。 [root@flex scsi]# tcsh [rsaito@flex scsi]$ setenv LANG C [rsaito@flex scsi]$ fdisk /dev/sdf Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel Building a new DOS disklabel. Changes will remain in memory only, until you decide to write them. After that, of course, the previous content won't be recoverable. - これは、まだ何もpartition が設定されていないことを意味するのでOK。 The number of cylinders for this disk is set to 121601. 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) - n で新しいパーティションを作る。p primary 1 番目 最初から 最後まで Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 1 First cylinder (1-121601, default 1): Using default value 1 Last cylinder or +size or +sizeM or +sizeK (1-121601, default 121601): Using default value 121601 - m は、ただコマンドのリストを表示。 Command (m for help): m Command action a toggle a bootable flag b edit bsd disklabel c toggle the dos compatibility flag d delete a partition l list known partition types m print this menu n add a new partition o create a new empty DOS partition table p print the partition table q quit without saving changes s create a new empty Sun disklabel t change a partition's system id u change display/entry units v verify the partition table w write table to disk and exit x extra functionality (experts only) - p: 現在作った partition を表示 Command (m for help): p Disk /dev/sdf: 1000.2 GB, 1000204886016 bytes 255 heads, 63 sectors/track, 121601 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sdf1 1 121601 976760001 83 Linux - w: これを実際にHDDに書き込む。 Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks. - これで無事終了。次は フォーマット。 ** Partition のフォーマット [#z10b3b70] - mke2fs コマンドを用いる。-j は、ext3 タイプのフォーマットを意味する。 [rsaito@flex scsi]$ mke2fs -j /dev/sdf mke2fs 1.35 (28-Feb-2004) /dev/sdf is entire device, not just one partition! Proceed anyway? (y,n) y Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) 122109952 inodes, 244190646 blocks 12209532 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=247463936 7453 block groups 32768 blocks per group, 32768 fragments per group 16384 inodes per group Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 102400000, 214990848 - inode table への書き込みに数分時間がかかる。 Writing inode tables: 3783/7453 - 最後にsuperblock に filesystem の情報の書き込みが行われる。1分。 Writing inode tables: done Creating journal (8192 blocks): done Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 29 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override. - 最後にこのfile system をマウントできるかどうか確認。 ** file system のマウント [#e4b46e31] - /mnt にマウントポイント(マウントする場所)を mkdir で作る。 [rsaito@flex scsi]$ cd /mnt [rsaito@flex /mnt]$ ls cdrom fd home home2 root rsaito-old samba sata1 www [rsaito@flex /mnt]$ mkdir sata2 [rsaito@flex /mnt]$ mount /dev/sdf /mnt/sata2 [rsaito@flex /mnt]$ df Filesystem 1K-blocks Used Available Use% Mounted on /dev/mapper/VG-LVroot 20642428 6770492 12823488 35% / /dev/md0 101018 77539 18263 81% /boot none 2037136 0 2037136 0% /dev/shm /dev/mapper/VG-LVrsaito 30963708 12565892 16824952 43% /rsaito /dev/mapper/VG-LVhome 216745980 201390404 4345528 98% /home /dev/mapper/VG-LVwww 20642428 5947524 13646328 31% /www 172.17.4.129:/pmphdd1 480719072 161512480 294787392 36% /pmphdd /dev/mapper/VG-LVsamba 20642428 11212352 8381500 58% /samba 172.17.4.134:/home1 236347936 201413376 22928784 90% /misc/home1 /dev/sdf 961434656 110656 912485872 1% /mnt/sata2 - /mnt/sata2 にマウントできている。 - アンマウントもできることも確認 [rsaito@flex /mnt]$ umount /mnt/sata2 [rsaito@flex /mnt]$ df Filesystem 1K-blocks Used Available Use% Mounted on /dev/mapper/VG-LVroot 20642428 6770492 12823488 35% / /dev/md0 101018 77539 18263 81% /boot none 2037136 0 2037136 0% /dev/shm /dev/mapper/VG-LVrsaito 30963708 12565892 16824952 43% /rsaito /dev/mapper/VG-LVhome 216745980 201390404 4345528 98% /home /dev/mapper/VG-LVwww 20642428 5947524 13646328 31% /www 172.17.4.129:/pmphdd1 480719072 161512480 294787392 36% /pmphdd /dev/mapper/VG-LVsamba 20642428 11212352 8381500 58% /samba 172.17.4.134:/home1 236347936 201413376 22928784 90% /misc/home1 - 確認。この作業を /dev/sde, /dev/sdf, /dev/sdg, /dev/sdh の4つで行う。 ** 今後の方針 [#b5f502e4] *** tube の /home1 など、ファイルサーバーをこの SATA BOX にまとめる。 [#h9a645a5] - そのために、ネットワークの設定など(192.168.1.0 を Flex に追加?)確認。 - /home2 の2008.8現在の場所 FLEXからmountで見ると 172.17.4.129:/pmphdd1 on /pmphdd type nfs (rw,addr=172.17.4.129) となっているHDDです。 *** RAID の設定を考える。RAIDの勉強が必要。安全性を重視。 [#z591f80a]