標準ファーム入り HDD の作成

LS-LGL

LS-LGL の標準ファーム入り HDD を1から作ってみる。
作れることがわかれば、購入時についてきた HDD を壊しても怖くない。

使用する HDD

Seagete の 10GB IDE HDD ST310212 を使用する。

LS-GL に接続

ST310212 を USB でハックキット化した LS-GL に接続する。
Dec  8 21:06:35 ude kernel: usb 2-1: new high speed USB device using ehci_platform and address 2
Dec  8 21:06:35 ude kernel: usb 2-1: configuration #1 chosen from 1 choice
Dec  8 21:06:35 ude kernel: scsi2 : SCSI emulation for USB Mass Storage devices
Dec  8 21:06:40 ude kernel:   Vendor: ST310212  Model: A                 Rev: 0811
Dec  8 21:06:40 ude kernel:   Type:   Direct-Access                      ANSI SCSI revision: 00
Dec  8 21:06:40 ude kernel: SCSI device sdb: 20005650 512-byte hdwr sectors (10243 MB)
Dec  8 21:06:40 ude kernel: sdb: test WP failed, assume Write Enabled
Dec  8 21:06:40 ude kernel: SCSI device sdb: 20005650 512-byte hdwr sectors (10243 MB)
Dec  8 21:06:40 ude kernel: sdb: test WP failed, assume Write Enabled
Dec  8 21:06:40 ude kernel:  sdb: sdb1 sdb2 sdb4 < sdb5 sdb6 >
Dec  8 21:06:40 ude kernel: sd 2:0:0:0: Attached scsi disk sdb
Dec  8 21:06:40 ude kernel: sd 2:0:0:0: Attached scsi generic sg1 type 0
sdb と認識する。

LS-GL か HS-DHGL で使った形跡がある。

ude:~# mkdir /tmp/root
ude:~# mount /dev/sdb2 /tmp/root
ude:~# cat /tmp/root/etc/linkstation_release
VERSION=1.02
SUBVERSION=HDD 1.23
PRODUCTID=0x0000000A
BUILDDATE=2006/11/27 19:13:04
ude:~# umount /tmp/root
ude:~#
PRODUCTID=0x0000000A なので、HS-DHGL。

パーティションの削除

このパーティションをこのまま使っても良いが、 後からの再現が楽なように、パーティションを完全に削除する。
ude:~# fdisk /dev/sdb

The number of cylinders for this disk is set to 9768.
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: 10.2 GB, 10242892800 bytes
64 heads, 32 sectors/track, 9768 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1         192      196592   83  Linux
/dev/sdb2             193         670      489472   83  Linux
/dev/sdb4             671        9768     9316352    5  Extended
/dev/sdb5             671         793      125936   82  Linux swap / Solaris
/dev/sdb6             794        9768     9190384   83  Linux

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

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

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

Command (m for help): p

Disk /dev/sdb: 10.2 GB, 10242892800 bytes
64 heads, 32 sectors/track, 9768 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

   Device Boot      Start         End      Blocks   Id  System

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

Calling ioctl() to re-read partition table.
Syncing disks.
ude:~# 

パーティションの作成

白々しく、、、
まっさらなディスクにパーティションを切る。
ude:~# fdisk /dev/sdb

The number of cylinders for this disk is set to 9768.
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): 
まずは、/boot 。2GB ほど
Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-9768, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-9768, default 9768): +2048M

Command (m for help): p

Disk /dev/sdb: 10.2 GB, 10242892800 bytes
64 heads, 32 sectors/track, 9768 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        1954     2000880   83  Linux

Command (m for help):
続いて / 。5GB ほど
Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (1955-9768, default 1955):
Using default value 1955
Last cylinder or +size or +sizeM or +sizeK (1955-9768, default 9768): +5120M

Command (m for help): p

Disk /dev/sdb: 10.2 GB, 10242892800 bytes
64 heads, 32 sectors/track, 9768 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        1954     2000880   83  Linux
/dev/sdb2            1955        6838     5001216   83  Linux

Command (m for help):
残りは全部拡張パーティションにする。
Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
e
Partition number (1-4): 4
First cylinder (6839-9768, default 6839):
Using default value 6839
Last cylinder or +size or +sizeM or +sizeK (6839-9768, default 9768):
Using default value 9768

Command (m for help): p

Disk /dev/sdb: 10.2 GB, 10242892800 bytes
64 heads, 32 sectors/track, 9768 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        1954     2000880   83  Linux
/dev/sdb2            1955        6838     5001216   83  Linux
/dev/sdb4            6839        9768     3000320    5  Extended

Command (m for help):
拡張パーティション内に swap を作る。1.4GB ほどぉ?
こんないるの?
Command (m for help): n
Command action
   l   logical (5 or over)
   p   primary partition (1-4)
l
First cylinder (6839-9768, default 6839):
Using default value 6839
Last cylinder or +size or +sizeM or +sizeK (6839-9768, default 9768): +1400M

Command (m for help): p

Disk /dev/sdb: 10.2 GB, 10242892800 bytes
64 heads, 32 sectors/track, 9768 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        1954     2000880   83  Linux
/dev/sdb2            1955        6838     5001216   83  Linux
/dev/sdb4            6839        9768     3000320    5  Extended
/dev/sdb5            6839        8174     1368048   83  Linux

Command (m for help):
残りは全部 sdb6
Command (m for help): n
Command action
   l   logical (5 or over)
   p   primary partition (1-4)
l
First cylinder (8175-9768, default 8175):
Using default value 8175
Last cylinder or +size or +sizeM or +sizeK (8175-9768, default 9768):
Using default value 9768

Command (m for help): p

Disk /dev/sdb: 10.2 GB, 10242892800 bytes
64 heads, 32 sectors/track, 9768 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        1954     2000880   83  Linux
/dev/sdb2            1955        6838     5001216   83  Linux
/dev/sdb4            6839        9768     3000320    5  Extended
/dev/sdb5            6839        8174     1368048   83  Linux
/dev/sdb6            8175        9768     1632240   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.
ude:~#

フォーマット

sdb1(/boot) は ext3
ude:~# mount /dev/sdb2 /tmp/root
mount: you must specify the filesystem type
ude:~# mke2fs -j /dev/sdb1
mke2fs 1.40-WIP (14-Nov-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
250368 inodes, 500220 blocks
25011 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=515899392
16 block groups
32768 blocks per group, 32768 fragments per group
15648 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 28 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
ude:~#
sdb2(/) は xfs
ude:~# mkfs.xfs /dev/sdb2
meta-data=/dev/sdb2              isize=256    agcount=8, agsize=156288 blks
         =                       sectsz=512   attr=0
data     =                       bsize=4096   blocks=1250304, imaxpct=25
         =                       sunit=0      swidth=0 blks, unwritten=1
naming   =version 2              bsize=4096
log      =internal log           bsize=4096   blocks=2560, version=1
         =                       sectsz=512   sunit=0 blks
realtime =none                   extsz=65536  blocks=0, rtextents=0
ude:~#
sdb5 は swap
ude:~# mkswap /dev/sdb5
Setting up swapspace version 1, size = 1400877 kB
no label, UUID=139aae0b-4e19-42f0-b935-62fcdd752343
ude:~#
sdb6 は xfs
ude:~# mkfs.xfs /dev/sdb6
meta-data=/dev/sdb6              isize=256    agcount=8, agsize=51007 blks
         =                       sectsz=512   attr=0
data     =                       bsize=4096   blocks=408056, imaxpct=25
         =                       sunit=0      swidth=0 blks, unwritten=1
naming   =version 2              bsize=4096
log      =internal log           bsize=4096   blocks=2560, version=1
         =                       sectsz=512   sunit=0 blks
realtime =none                   extsz=65536  blocks=0, rtextents=0
ude:~#

マウント

ude:~# mount /dev/sdb2 /tmp/root
ude:~# mkdir /tmp/root/boot
ude:~# mount /dev/sdb1 /tmp/root/boot
ude:~# mkdir -p /tmp/root/mnt/disk1
ude:~# mount /dev/sdb6 /tmp/root/mnt/disk1
ude:~# 

リストア

先日使ったバックアップをリストアする
ude:~# cd /tmp/root
ude:/tmp/root#
ude:/tmp/root# tar zxvf /mnt/Backup/whi/whi_20071206.tar.gz
	:
	:
なんだか、日付の警告がたくさん出る。

telnet 可能化

アンマウント

ude:/tmp/root# cd /
ude:/# umount /tmp/root/mnt/disk1
ude:/# umount /tmp/root/boot
ude:/# umount /tmp/root
ude:/#

LS-LGL に接続

LS-LGL にtelnet


BUFFALO INC. LinkStation series LS-LGL(SUIZEI)
LS-LGLFF7 login: root


BusyBox v1.1.1 (2007.11.12-13:48+0000) Built-in shell (ash)
Enter 'help' for a list of built-in commands.

~ # df
Filesystem           1k-blocks      Used Available Use% Mounted on
/dev/disk1_2           4990976     80324   4910652   2% /
/dev/ram1                 1024        40       984   4% /mnt/ram
/dev/disk1_1           1969408     38896   1830468   2% /boot
/dev/disk1_6           1621984       144   1621840   0% /mnt/disk1
~ # dmesg | grep ST3
  Vendor: Seagate   Model: ST310212A         Rev: 3.02
~ #

えくせれんとぉ

LS-L250GL
楽天市場
Amazon
Yahoo! ショッピング
Sofmap
TSUKUMO ネットショップ
ValuMore!
ムラウチドットコム
uWorks
パソQ


HDD の外付け
ハックの記録
LinkStation/玄箱 をハックしよう

ファンコントロール

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