LS-GL: オリジナル HDD へ debian をインストール


LS-GL を買ったときについていた 160GB HDD は 標準ファームのまま温存していたが、 もうそろそろいいかなと debian をインストールすることにした。

実験用 HDD から標準ファームで boot

標準ファームをコピーした実験用 HDD を S-ATA に接続して boot する。
実験用 HDD の share\debian には LS-GL ハックキット
・LS-GL_hackkit_1.00.tar.gz
・LS-GL_hackkit_1.00.sh
が置いてある。

オリジナル HDD を USB で接続

オリジナルの HDD を USB で接続する
Jan 10 23:27:46 UDE kernel: usb 1-1: new high speed USB device using ehci_platform and address 2
Jan 10 23:27:47 UDE kernel: scsi2 : SCSI emulation for USB Mass Storage devices
Jan 10 23:27:52 UDE kernel:   Vendor: WDC WD16  Model:  WD-WCANM4151553  Rev: 2E02
Jan 10 23:27:52 UDE kernel:   Type:   Direct-Access                      ANSI SCSI revision: 02
Jan 10 23:27:52 UDE kernel: SCSI device sdb: 312581808 512-byte hdwr sectors (160042 MB)
Jan 10 23:27:52 UDE kernel: sdb: assuming drive cache: write through
Jan 10 23:27:52 UDE kernel: SCSI device sdb: 312581808 512-byte hdwr sectors (160042 MB)
Jan 10 23:27:52 UDE kernel: sdb: assuming drive cache: write through
Jan 10 23:27:52 UDE kernel:  sdb: sdb1 sdb2 sdb4 < sdb5 sdb6 >
Jan 10 23:27:52 UDE kernel: Attached scsi disk sdb at scsi2, channel 0, id 0, lun 0
Jan 10 23:27:52 UDE kernel: Attached scsi generic sg1 at scsi2, channel 0, id 0, lun 0,  type 0
Jan 10 23:27:53 UDE kernel: kjournald starting.  Commit interval 5 seconds
Jan 10 23:27:53 UDE kernel: EXT3 FS on sdb1, internal journal
Jan 10 23:27:53 UDE kernel: EXT3-fs: mounted filesystem with ordered data mode.
Jan 10 23:27:53 UDE nmbd[635]: [2007/01/10 23:27:53, 0] nmbd/nmbd.c:terminate(58)
Jan 10 23:27:53 UDE nmbd[635]:   Got SIGTERM: going down...
Jan 10 23:27:54 UDE kernel: NET: Registered protocol family 5
Jan 10 23:27:56 UDE kernel: NET: Unregistered protocol family 5
相変わらず samba の再起動がかかる。

umount

自動的にマウントされるので、umount する。
root@UDE:~# df
Filesystem           1k-blocks      Used Available Use% Mounted on
/dev/sda2               493212    172544    320668  35% /
/dev/ram1                15360        80     15280   1% /mnt/ram
/dev/ls_disk1_1         194443     68619    115785  37% /boot
/dev/ls_disk1_6        3363376    300860   3062516   9% /mnt/disk1
/dev/ls_usbdisk2_1      194443      4127    180277   2% /mnt/usbdisk2
root@UDE:~# umount /mnt/usbdisk2/
root@UDE:~# 

パーティションの設定

パーティションを切り直す
root@UDE:~# fdisk /dev/sdb

The number of cylinders for this disk is set to 19457.
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: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 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       19457   155589525    5  Extended
/dev/sdb5              88         104      136521   82  Linux swap
/dev/sdb6             105       19457   155452941   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-6): 2

Command (m for help): d
Selected partition 1

Command (m for help): p

Disk /dev/sdb: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System

Command (m for help):
パーティションを切る
Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-19457, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-19457, default 19457): +200M

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (26-19457, default 26):
Using default value 26
Last cylinder or +size or +sizeM or +sizeK (26-19457, default 19457): +2096M

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 3
First cylinder (282-19457, default 282):
Using default value 282
Last cylinder or +size or +sizeM or +sizeK (282-19457, default 19457): +256M

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

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: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 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         281     2056320   83  Linux
/dev/sdb3             282         313      257040   82  Linux swap
/dev/sdb4             314       19457   153774180   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: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.
root@UDE:~#

LS-GL ハックキットのインストール

ここからは半自動
root@UDE:~# cd /mnt/disk1/share/debian/
root@UDE:/mnt/disk1/share/debian# ls -l LS-GL_hackkit_1.00.*
-rw-r--r--    1 root     root         6338 Dec 20 03:20 LS-GL_hackkit_1.00.sh
-rw-r--r--    1 root     root     47490838 Jan  8 14:10 LS-GL_hackkit_1.00.tar.gz
root@UDE:/mnt/disk1/share/debian# head LS-GL_hackkit_1.00.sh
#! /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

root@UDE:/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:
        8193, 24577, 40961, 57345, 73729

Writing inode tables: done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 23 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
	:
	:
mounting hard drive     ..
mount: Unknown error 990
root@UDE:/mnt/disk1/share/debian#
と思ったら、エラー終了。
あれぇ??


LS-GL: tftp boot
ハックの記録
LinkStation/玄箱 をハックしよう

LS-GL: オリジナル HDD へ debian をインストール(2)

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