純正 HDD にハックキット+ハック de 録!!(2)ハックキットのインストール

HS-DHGL

HS-DGL に LS-GL ハックキット をインストールする。
基本的には、 LS-GL/HS-DHGL ハックキットインストールの手順。

ただし、 LS-GL で fsck の問題を見つけたので、 ext3 ではなく xfs でフォーマットしてみる

標準ファームの起動

上記 No.2 の HDD を HS-DHGL に S-ATA で接続して起動する。

ログイン

HS-DHGL の標準ファームに root でログインする。
念のため、パスワードを変更しておくと良い
BUFFALO INC. LinkStation series HS-DHGL(JINMU)
HS-DHGL276 login: root
root@HS-DHGL276:~# passwd root
Changing password for root
Enter the new password (minimum of 5, maximum of 20 characters)
Please use a combination of upper and lower case letters and numbers.
Enter new password:(新しいパスワード)
Re-enter new password:(もう一度新しいパスワード)
Password changed.
root@HS-DHGL276:~#

LS-GL ハックキットのファイルの転送

root@HS-DHGL276:~# mkdir -p /mnt/disk1/share/debian
root@HS-DHGL276:~# cd !$
cd /mnt/disk1/share/debian
root@HS-DHGL276:/mnt/disk1/share/debian#
ハックキットは HD-HGLAN に置いてあるので、ftp する
root@HS-DHGL276:/mnt/disk1/share/debian# ftp giga.yamasita.jp
Connected to giga.yamasita.jp.
220 ProFTPD 1.2.10 Server (ProFTPD Default Installation) [192.168.1.32]
500 AUTH not understood
500 AUTH not understood
KERBEROS_V4 rejected as an authentication type
Name (giga.yamasita.jp:root): yasunari
331 Password required for yasunari.
Password:
230 User yasunari logged in.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> cd HackKit-1.00
250 CWD command successful
ftp> ls
200 PORT command successful
150 Opening ASCII mode data connection for file list
-rwxrw-r--   1 yasunari yamasita     6338 Dec 20 03:20 LS-GL_hackkit_1.00.sh
-rwxrw-r--   1 yasunari yamasita 47490838 Jan  8 14:10 LS-GL_hackkit_1.00.tar.gz
226 Transfer complete.
ftp> bin
200 Type set to I
ftp> hash
Hash mark printing on (1024 bytes/hash mark).
ftp> prompt
Interactive mode off.
ftp> mget *
local: LS-GL_hackkit_1.00.sh remote: LS-GL_hackkit_1.00.sh
200 PORT command successful
150 Opening BINARY mode data connection for LS-GL_hackkit_1.00.sh (6338 bytes)
######
226 Transfer complete.
6338 bytes received in 0.00072 seconds (8.6e+03 Kbytes/s)
local: LS-GL_hackkit_1.00.tar.gz remote: LS-GL_hackkit_1.00.tar.gz
200 PORT command successful
150 Opening BINARY mode data connection for LS-GL_hackkit_1.00.tar.gz (47490838 bytes)
####################################################################
	:
	:
######
226 Transfer complete.
47490838 bytes received in 8.9 seconds (5.2e+03 Kbytes/s)
ftp> bye
221 Goodbye.
root@HS-DHGL276:/mnt/disk1/share/debian# ls -l
-rw-r--r--    1 root     root         6338 Feb 25 10:20 LS-GL_hackkit_1.00.sh
-rw-r--r--    1 root     root     47490838 Feb 25 10:20 LS-GL_hackkit_1.00.tar.gz
root@HS-DHGL276:/mnt/disk1/share/debian#

カスタマイズ

LS-GL_hackkit_1.00.sh を修正する。
今回は、IP アドレスとホスト名、それに xfs への変更を行った。
root@HS-DHGL276:/mnt/disk1/share/debian# mv LS-GL_hackkit_1.00.sh LS-GL_hackkit_1.00.sh.orig
root@HS-DHGL276:/mnt/disk1/share/debian# cp LS-GL_hackkit_1.00.sh.orig LS-GL_hackkit_1.00.sh
root@HS-DHGL276:/mnt/disk1/share/debian# vi LS-GL_hackkit_1.00.sh
	:
	:
root@HS-DHGL276:/mnt/disk1/share/debian# diff -c LS-GL_hackkit_1.00.sh.orig LS-GL_hackkit_1.00.sh
*** LS-GL_hackkit_1.00.sh.orig  Sun Feb 25 10:20:25 2007
--- LS-GL_hackkit_1.00.sh       Sat Mar  3 15:11:42 2007
***************
*** 1,12 ****
  #! /bin/sh -x

! ADDRESS=192.168.1.38
  NETWORK=192.168.1.0
  NETMASK=255.255.255.0
  BROADCAST=192.168.1.255
  GATEWAY=192.168.1.1
  NAMESERVER=192.168.1.2
! HOSTNAME=hackkit

  MOUNTPOINT=/mnt/debinst
  WORK=/mnt/disk1/share/debian
--- 1,12 ----
  #! /bin/sh -x

! ADDRESS=192.168.1.39
  NETWORK=192.168.1.0
  NETMASK=255.255.255.0
  BROADCAST=192.168.1.255
  GATEWAY=192.168.1.1
  NAMESERVER=192.168.1.2
! HOSTNAME=sil

  MOUNTPOINT=/mnt/debinst
  WORK=/mnt/disk1/share/debian
***************
*** 18,26 ****

  format_disk() {
        mke2fs -j /dev/sdb1 || exit
!       mke2fs -j /dev/sdb2 || exit
        mkswap /dev/sdb3 || exit
!       mke2fs -j /dev/sdb4 || exit
  }

  #---------------------------------------------------------
--- 18,26 ----

  format_disk() {
        mke2fs -j /dev/sdb1 || exit
!       mkfs.xfs -f /dev/sdb2 || exit
        mkswap /dev/sdb3 || exit
!       mkfs.xfs -f /dev/sdb4 || exit
  }

  #---------------------------------------------------------
***************
*** 31,37 ****
        then
                mkdir $MOUNTPOINT || exit
        fi
!       mount /dev/sdb2 $MOUNTPOINT || exit
  }
  #---------------------------------------------------------
  # extract hackkit archive
--- 31,37 ----
        then
                mkdir $MOUNTPOINT || exit
        fi
!       mount -t xfs /dev/sdb2 $MOUNTPOINT || exit
  }
  #---------------------------------------------------------
  # extract hackkit archive
root@HS-DHGL276:/mnt/disk1/share/debian#

HDD の接続

上記 No.3 の HDD を USB で接続する
/var/log/messages に下のようなログが残る。
Feb 25 09:27:55 HS-DHGL276 kernel: usb 2-1: new high speed USB device using ehci_platform and address 2
Feb 25 09:27:56 HS-DHGL276 kernel: scsi2 : SCSI emulation for USB Mass Storage devices
Feb 25 09:28:01 HS-DHGL276 kernel:   Vendor: ST332062  Model:         9QF0NVQ5  Rev: D
Feb 25 09:28:01 HS-DHGL276 kernel:   Type:   Direct-Access                      ANSI SCSI revision: 02
Feb 25 09:28:01 HS-DHGL276 kernel: SCSI device sdb: 625142448 512-byte hdwr sectors (320073 MB)
Feb 25 09:28:01 HS-DHGL276 kernel: sdb: assuming drive cache: write through
Feb 25 09:28:01 HS-DHGL276 kernel: SCSI device sdb: 625142448 512-byte hdwr sectors (320073 MB)
Feb 25 09:28:01 HS-DHGL276 kernel: sdb: assuming drive cache: write through
Feb 25 09:28:01 HS-DHGL276 kernel:  sdb: sdb1 sdb2 sdb4 < sdb5 sdb6 >
Feb 25 09:28:01 HS-DHGL276 kernel: Attached scsi disk sdb at scsi2, channel 0, id 0, lun 0
Feb 25 09:28:01 HS-DHGL276 kernel: Attached scsi generic sg1 at scsi2, channel 0, id 0, lun 0,  type 0
Feb 25 09:28:02 HS-DHGL276 kernel: kjournald starting.  Commit interval 5 seconds
Feb 25 09:28:02 HS-DHGL276 kernel: EXT3 FS on sdb1, internal journal
Feb 25 09:28:02 HS-DHGL276 kernel: EXT3-fs: mounted filesystem with ordered data mode.

umount

最初のパーティションが自動マウントされるので umount する。
root@HS-DHGL276:~# df
Filesystem           1k-blocks      Used Available Use% Mounted on
/dev/sda2               484672    230356    254316  48% /
/dev/ram1                15360       100     15260   1% /mnt/ram
/dev/ls_disk1_1         190387     10216    170342   6% /boot
/dev/ls_disk1_6       19242992     47036  19195956   0% /mnt/disk1
/dev/ls_usbdisk2_1      194443     10244    174160   6% /mnt/usbdisk2
root@HS-DHGL276:~# umount /mnt/usbdisk2
umount: /mnt/usbdisk2: device is busy
umount: /mnt/usbdisk2: device is busy
このようにエラーになった場合は、 samba を止めると umount できるかも知れない
root@HS-DHGL276:~# /etc/init.d/smb.sh stop
Shutting down SMB services: killall: Could not kill pid '11820': No such process
killall: Could not kill pid '25494': No such process

Shutting down NMB services:
Shutting down WINBIND services: killall: winbindd: no process killed

Shutting down PAMSMBD services: killall: pamsmbd: no process killed

root@HS-DHGL276:~# umount /mnt/usbdisk2
root@HS-DHGL276:~# df
Filesystem           1k-blocks      Used Available Use% Mounted on
/dev/sda2               484672    230356    254316  48% /
/dev/ram1                15360       100     15260   1% /mnt/ram
/dev/ls_disk1_1         190387     10216    170342   6% /boot
/dev/ls_disk1_6       19242992     47036  19195956   0% /mnt/disk1
root@HS-DHGL276:~#
samba の挙動は怪しいが、umount は成功。

パーティションの設定

覚悟を決めて、 No.3 の HDD (HS-DH320GL を買ったときに納められていた S-ATA HDD)の パーティションを切る
root@HS-DHGL276:~# fdisk /dev/sdb

The number of cylinders for this disk is set to 38913.
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/sdb: 320.0 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1          25      200781   83  Linux
/dev/sdb2              26          87      498015   83  Linux
/dev/sdb4              88       38913   311869845    5  Extended
/dev/sdb5              88         104      136521   82  Linux swap
/dev/sdb6             105       38913   311733261   83  Linux

Command (m for help): 
パーティションを消す
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): d
Partition number (1-4): 2

Command (m for help): d
Selected partition 1

Command (m for help): p

Disk /dev/sdb: 320.0 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System

Command (m for help):
パーティションを切る。
まずは /boot 。サイズは 200MB
Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-38913, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-38913, default 38913): +200M

Command (m for help):
続いて / 。サイズは 2GB
Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (26-38913, default 26):
Using default value 26
Last cylinder or +size or +sizeM or +sizeK (26-38913, default 38913): +2048M

Command (m for help):
続いて swap 。サイズは 256MB
Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 3
First cylinder (276-38913, default 276):
Using default value 276
Last cylinder or +size or +sizeM or +sizeK (276-38913, default 38913): +256M

Command (m for help):
最後にデータ領域。残り全部
Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Selected partition 4
First cylinder (308-38913, default 308):
Using default value 308
Last cylinder or +size or +sizeM or +sizeK (308-38913, default 38913):
Using default value 38913

Command (m for help): 
確認
Command (m for help): p

Disk /dev/sdb: 320.0 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1          25      200781   83  Linux
/dev/sdb2              26         275     2008125   83  Linux
/dev/sdb3             276         307      257040   83  Linux
/dev/sdb4             308       38913   310102695   83  Linux

Command (m for help): 
sdb3 を swap にする
Command (m for help): t
Partition number (1-4): 3
Hex code (type L to list codes): 82
Changed system type of partition 3 to 82 (Linux swap)

Command (m for help): p

Disk /dev/sdb: 320.0 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1          25      200781   83  Linux
/dev/sdb2              26         275     2008125   83  Linux
/dev/sdb3             276         307      257040   82  Linux swap
/dev/sdb4             308       38913   310102695   83  Linux

Command (m for help):
覚悟を決めて(笑)設定。
Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
root@HS-DHGL276:~#

インストール

ハックキットのインストーラを実行する
root@HS-DHGL276:~# cd /mnt/disk1/share/debian/
root@HS-DHGL276:/mnt/disk1/share/debian# sh LS-GL_hackkit_1.00.sh
formating hard drive    ..
mke2fs 1.27 (8-Mar-2002)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
50200 inodes, 200781 blocks
10039 blocks (5.00%) reserved for the super user
First data block=1
25 block groups
8192 blocks per group, 8192 fragments per group
2008 inodes per group
Superblock backups stored on blocks:
	:
	:
creating network_interfaces ...
creating resolv.conf ...
creating hosts ...
creating hostname ...
root@HS-DHGL276:/mnt/disk1/share/debian#

/etc/fstab の修正

LS-GL_hackkit_1.00.tar.gz には、 /dev/sda2, /dev/sda4 をext3 でマウントするように指定した /etc/fstab が 納めてある。
これを xfs でマウントするよう修正する。
root@HS-DHGL276:/mnt/disk1/share/debian# cd
root@HS-DHGL276:~# mount /dev/sdb2 /mnt/debinst
root@HS-DHGL276:~# cd /mnt/debinst/etc
root@HS-DHGL276:/mnt/debinst/etc# cp fstab /tmp
root@HS-DHGL276:/mnt/debinst/etc# vi fstab
	:
	:
root@HS-DHGL276:/mnt/debinst/etc# diff -c /tmp/fstab fstab
*** /tmp/fstab  Sat Mar  3 15:18:32 2007
--- fstab       Sat Mar  3 15:19:13 2007
***************
*** 1,9 ****
  # /etc/fstab: static file system information.
  #
  #                                      
! /dev/sda2     /               ext3    defaults,noatime,errors=remount-ro      0 0
  proc          /proc           proc    defaults                        0 0
  none          /dev/pts        devpts  gid=103,mode=0622                       0 0
  /dev/sda3     swap            swap    defaults                        0 0
  /dev/sda1     /boot           ext3    defaults,noatime                0 1
! /dev/sda4     /mnt            ext3    defaults,noatime                0 2
--- 1,9 ----
  # /etc/fstab: static file system information.
  #
  #                                      
! /dev/sda2     /               xfs     defaults,noatime,errors=remount-ro      0 0
  proc          /proc           proc    defaults                        0 0
  none          /dev/pts        devpts  gid=103,mode=0622                       0 0
  /dev/sda3     swap            swap    defaults                        0 0
  /dev/sda1     /boot           ext3    defaults,noatime                0 1
! /dev/sda4     /mnt            xfs     defaults,noatime                0 2
root@HS-DHGL276:/mnt/debinst/etc# cd
root@HS-DHGL276:~# umount /mnt/debinst
root@HS-DHGL276:~#

debian 化終了

ログアウトし、 電源ボタンを長押しして HS-DHGL をシャットダウンする。

最初の設定

LS-GL/HS-DHGL ハックキット最初の設定の手順。

debian 起動

No.3 の HDD を S-ATA で HS-DHGL に接続して起動する。

ログイン

telnet して guest でログインする
Debian GNU/Linux 3.1 sil
sil login: guest
Password: hack(画面には表示されない)
Linux sil 2.6.12.6-arm1 #79 Wed Oct 4 13:37:40 JST 2006 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.
No directory, logging in with HOME=/
guest@sil:/$

root になる

guest@sil:/$ su - root
Password: hack(画面には表示されない)
sil:~#

root のパスワード変更

sil:~# passwd root
Enter new UNIX password: (新しいパスワード)
Retype new UNIX password: (もう一度新しいパスワード)
passwd: password updated successfully
sil:~#

一般ユーザの作成

yasunari を作成する
sil:~# addgroup yamasita
Adding group `yamasita' (1000)...
Done.
sil:~# mkdir /home/yamasita
sil:~# adduser --home /home/yamasita/yasunari --ingroup yamasita yasunari
Adding user `yasunari'...
Adding new user `yasunari' (1001) with group `yamasita'.
Creating home directory `/home/yamasita/yasunari'.
Copying files from `/etc/skel'
Enter new UNIX password:(yasunari のパスワード)
Retype new UNIX password:(もう一度 yasunari のパスワード)
passwd: password updated successfully
Changing the user information for yasunari
Enter the new value, or press ENTER for the default
        Full Name []: Yasunari Yamashita
        Room Number []:
        Work Phone []:
        Home Phone []:
        Other []:
Is the information correct? [y/N] y
sil:~#
管理者なので、root グループにもいれておく
sil:~# adduser yasunari root
Adding user `yasunari' to group `root'...
Done.
sil:~#

guest の削除

ログアウトし、今度は yasunari でログイン、 root になって guest を削除する。
Debian GNU/Linux 3.1 sil
sil login: yasunari
Password:
Linux sil 2.6.12.6-arm1 #79 Wed Oct 4 13:37:40 JST 2006 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.
yasunari@sil:~$ su - root
Password:
sil:~# deluser guest
Removing user `guest'...
done.
sil:~#

いろいろな設定

その他いろいろな設定

apt-get upgrade

なにわともあれ、apt-get でアップデート
sil:~# apt-get update
	:
	:
Fetched 6054kB in 14s (431kB/s)
Reading Package Lists... Done
sil:~# apt-get upgrade
Reading Package Lists... Done
Building Dependency Tree... Done
The following packages will be upgraded:
  libc6 locales
2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 8096kB of archives.
After unpacking 131kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://ftp.jp.debian.org sarge/main locales 2.3.2.ds1-22sarge5 [4028kB]
Get:2 http://ftp.jp.debian.org sarge/main libc6 2.3.2.ds1-22sarge5 [4068kB]
Fetched 8096kB in 27s (293kB/s)
Preconfiguring packages ...
(Reading database ... 7619 files and directories currently installed.)
Preparing to replace locales 2.3.2.ds1-22sarge4 (using .../locales_2.3.2.ds1-22sarge5_all.deb) ...
Unpacking replacement locales ...
Preparing to replace libc6 2.3.2.ds1-22sarge4 (using .../libc6_2.3.2.ds1-22sarge5_arm.deb) ...
Unpacking replacement libc6 ...
Setting up libc6 (2.3.2.ds1-22sarge5) ...
Current default timezone: 'Asia/Tokyo'.
Local time is now:      Sun Feb 25 11:33:30 JST 2007.
Universal Time is now:  Sun Feb 25 02:33:30 UTC 2007.
Run 'tzconfig' if you wish to change it.

Setting up locales (2.3.2.ds1-22sarge5) ...
Generating locales...
  ja_JP.EUC-JP... done
  ja_JP.UTF-8... done
Generation complete.

sil:~#

less

sil:~# apt-get install less
	:

ftp

sil:~# apt-get install ftp
	:

ftpd

sil:~# apt-get install inetutils-ftpd
	:
sil:~# echo "ftp     stream  tcp     nowait  root    /usr/sbin/tcpd  ftpd" >> /etc/inetd.conf

ntp

sil:~# apt-get install ntp-server
	:
sil:~# vi /etc/ntp.conf
	:
sil:~# /etc/init.d/ntp-server restart
	:

ntpdate

sil:~# apt-get install ntpdate
	:

resolv.conf

sil:~# cat /etc/resolv.conf
nameserver 192.168.1.2
sil:~# echo search yamasita.jp >> /etc/resolv.conf
sil:~# echo domain yamasita.jp >> /etc/resolv.conf
sil:~# cat /etc/resolv.conf
nameserver 192.168.1.2
search yamasita.jp
domain yamasita.jp
sil:~# 

binutils

sil:~# apt-get install binutils
	:

開発環境

sil:~# apt-get install gcc make libc6-dev bzip2
	:

nkf

sil:~# apt-get install nkf
	:

file

sil:~# apt-get install file
	:
さあ、だいたい必要なものは揃ったかな。


HS-DH320GL
楽天市場
Yahoo!ショッピング
somap.com
TSUKUMO ネットショップ
ValuMore!
ムラウチドットコム
アット・ニフティストア icon
Joshin web icon


終了処理/termination
ハックの記録
LinkStation/玄箱 をハックしよう

U-boot Menu

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