手順(2) パーティション分割とファイルシステムの作成 Edit

  • swapoffとumount
    /dev/hda1〜4のパーティションを切りなおすので、swapoffとumountを行います。
    # swapoff /dev/hda2
    # umount  /dev/hda3
    
  • fdisk
    次のようにパーティションを切ります。赤文字の値は重要
    パーティション開始終了サイズIDファイルシステム 備考
    /dev/hda1110208G83ext2debian iohack版 (linux-2.4.21-iodata)
    /dev/hda210211053256M82swap-
    /dev/hda31054615340G83ReiserFSdebian26 (linux-2.6.11-sh)
    /dev/hda4615419457100G83ReiserFS/share (共有領域) 

    # fdisk /dev/hda
    
    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): d
    Partition number (1-4): 1
    
    Command (m for help): d
    Partition number (1-4): 2
    
    Command (m for help): d
    Partition number (1-4): 3
    
    パーティション1を切りなおします。
    ここで重要なポイントは、First cylinderは1で無ければならない。
    さらに、Last cylinserは10以上1023以下でなければならない。
    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): 1
    Last cylinder or +size or +sizeM or +sizeK (1-19457, default 19457): 1020
    
    パーティション2〜4は適当でOK。
    Command (m for help): n
    Command action
       e   extended
       p   primary partition (1-4)
    p
    Partition number (1-4): 2
    First cylinder (1021-19457, default 1021): 
    Using default value 1021
    Last cylinder or +size or +sizeM or +sizeK (1021-19457, default 19457): +256M
    
    Command (m for help): n
    Command action
       e   extended
       p   primary partition (1-4)
    p
    Partition number (1-4): 3;
    First cylinder (1054-19457, default 1054): 
    Using default value 1054
    Last cylinder or +size or +sizeM or +sizeK (1054-19457, default 19457): +40G
    
    Command (m for help): n
    Command action
       e   extended
       p   primary partition (1-4)
    p
    Partition number (1-4): 4
    First cylinder (6154-19457, default 6154): 
    Using default value 6154
    Last cylinder or +size or +sizeM or +sizeK (6154-19457, default 19457): 
    Using default value 19457
    
    パーティション2のIDをスワップ(82)に設定
    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): p
    
    Disk /dev/hda: 255 heads, 63 sectors, 19457 cylinders
    Units = cylinders of 16065 * 512 bytes
    
       Device Boot    Start       End    Blocks   Id  System
    /dev/hda1             1      1020   8193118+  83  Linux
    /dev/hda2          1021      1053    265072+  82  Linux swap
    /dev/hda3          1054      6153  40965750   83  Linux
    /dev/hda4          6154     19457 106864380   83  Linux
    
    赤文字部分を再確認した後、ライトすること
    Command (m for help): w
    The partition table has been altered!
    
    Calling ioctl() to re-read partition table.
    Re-read table failed with error 16: Device or resource busy.
    Reboot your system to ensure the partition table is updated.
    
    WARNING: If you have created or modified any DOS 6.x
    partitions, please see the fdisk manual page for additional
    information.
    Syncing disks.
    # 
    
  • リブート
    リブートを行わないとパーティション情報が反映されないもよう。
    同じカーネル、ReiserFS対応カーネル(ブートラベル2)からリブートを行う。
    再度ログインして、

  • swap作成
    # mkswap /dev/hda2
    Setting up swapspace version 1, size = 271429632 bytes
    # swapon /dev/hda2
    
  • ReiserFS
    • /dev/hda3と4をReiserFSにします。
      # /tools/mkreiserfs /dev/hda3
      # /tools/mkreiserfs /dev/hda4
      # /tools/reiserfsck /dev/hda3
      # /tools/reiserfsck /dev/hda4
      
    • mountします。
      # mount -t reiserfs /dev/hda3 /mnt/hda3
      

手順(3) debian26環境の構築 Edit

  • baseシステムをダウンロードして展開
    # cd /mnt/hda3
    # /tools/wget http://eggplant.ddo.jp/www/download/debian26/base/base26-sh4-xxxxxxxx.tgz
    # tar vxfzp base26-sh4-xxxxxxxx.tgz
    # mv debian26/* .
    # rm -rf debian26 base26-sh4-xxxxxxxx.tgz
    
  • ホスト名/IPアドレスの設定
    次の5つのファイルに記述されたホスト名やIPアドレスを、各自の環境にあわせて修正します。
    • /mnt/hda3/etc/hosts
      127.0.0.1    localhost
      192.168.1.81 landisk
      
    • /mnt/hda3/etc/hostname
      landisk
      
    • /mnt/hda3/etc/resolv.conf
      nameserver 192.168.1.1
      
    • /mnt/hda3/etc/network/interfaces
      # Used by ifup(8) and ifdown(8). See the interfaces(5) manpage or
      # /usr/share/doc/ifupdown/examples for more information.
      auto lo
      iface lo inet loopback
       
      auto eth0
      iface eth0 inet static
      address 192.168.1.81
      netmask 255.255.255.0
      gateway 192.168.1.1
      
  • /mnt/hda3/etc/hosts.allow
    telnet接続等を許可する端末のIPアドレスを列挙します。
    ALL : 127.0.0.1 192.168.1. 192.168.0.  ← 追加
    
  • fstabの設定
    • /mnt/hda3/etc/fstab
      # UNCONFIGURED FSTAB FOR BASE SYSTEM
      /dev/hda3     /            reiserfs    defaults        0 1
      /dev/hda4     /share       reiserfs    defaults        0 0
      proc          /proc        proc    defaults        0 0
      /dev/hda2     swap         swap    defaults        0 0
      
    • /shareの作成
      # mkdir /mnt/hda3/share
      

手順(4) debian26環境からブート Edit

  • ブートラベル
    • 第1ラベル debian26 kernel-2.6 + /dev/hda3
    • 第2ラベル 変更せず linux-2.4.21(kernel-2.4ReiserFS対応版)
  • lilo-selk(sh-lilo-sel改)を打ち込む
    • remount
      # mount -o rw,remount / 
      
    • kernelのコピー
      lilo-selkで起動するカーネルは/dev/hda1の/boot下に置く必要があります。
      # cp /mnt/hda3/boot/vmlinuz-2.6.13-sh /boot
      
    • /etc/lilo-selk.confの変更
      linear
      boot=/dev/hda
      disk=/dev/hda
      bios=0x80
      timeout=50
      install=/boot/boot.b-selk
      default=debian26
      image=/boot/vmlinuz-2.6.13-sh
              label=debian26
              root=/dev/hda3
              read-only
              append="mem=64M console=ttySC1,9600"
      
      image=/boot/vmlinuz-2.4.21
              label=debian-iohack
              root=/dev/hda1
              read-only
              append="mem=64M console=ttySC1,9600"
      
    • lilo-selk実行
      # lilo-selk -C /etc/lilo-selk.conf
      Added debian26 *
      Added debian-iohack
      
  • ブート
    1番目のラベルからブート
    (ブートに失敗した場合、慌てずに2番目のラベルからブート行い対策すること。)
    (私の場合、1度失敗した。swap作成からやり直すとうまくいった。)

  • telnetでログイン
    起動後、telnet接続すると次のようなログインプロンプトが現れます。
    "root"と"landisk"のアカウントを用意しています。初期パスワードは共に"landisk"です。
    ユーザlandiskでログイン後、suコマンドでrootになれます。
    (パスワードの変更をお忘れなく。。。)
    Debian GNU/Linux 3.1 landisk
    landisk login: landisk
    Password: landisk
    Last login: Sat Apr 16 11:01:57 2005 from 192.168.1.2 on pts/1
    Linux landisk 2.6.11-sh #1 Tue Apr 12 20:59:46 JST 2005 sh4 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.
    landisk@landisk:~$
    landisk@landisk:~$ su
    Password: landisk
    
    landisk:/home/landisk#
    


トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2006-06-13 (火) 20:02:27 (6534d)