LoginSignup
12
13

More than 5 years have passed since last update.

Tiny Core Linux7のCoreをHDDにインストール

Last updated at Posted at 2016-07-02

Tiny Core Linux 7の最も小さいイメージであるCoreをHDDにインストールした時のメモです。Tiny Core Linuxは最新のv7.1でもCoreと言われる最小イメージなら11Mしかないという超軽量なLinuxです。

最も大きなイメージであるCorePlusでも106Mなので、一昔前のPCでも全く問題はないと思いますが、今回はCoreから始めてみたいと思います。

USBメモリからTiny Core Linuxを起動

起動用USBメモリの作成

Tiny Core Linuxのサイト」にアクセスしDownloadsをクリックします。以下の3つのイメージが公開されていますが今回は最も小さいCoreをダウンロードします。

  • Core (11 MB)
  • TinyCore (16 MB)
  • CorePlus (106 MB)

ダウンロードしたISOファイルをUSBメモリに書き込みます。これで起動用USBメモリは完成です。(追記2018/4/15)この方法では起動できないという場面に遭遇しました。「Tiny Core Linux 9の起動用USBメモリを作る」も参考にしてください。

$ sudo dd if=Core-current.iso of=/dev/sdb

起動

作成したUSBメモリをPCに接続し起動します。
VirtualBox_TinyCoreLinux-Core_02_07_2016_16_28_38-2.png

CorePlusではメニューが表示されたのですがCoreはないようです、こまま[Enter]キーを押すかしばらく待つと起動します。

VirtualBox_TinyCoreLinux-Core_02_07_2016_16_32_29-2.png

しばらく待ってもこれ以上何も変わりません。…どうやらCoreにはウィンドウシステムは入っていないようです。

HDDにインストール

HDDへのインストール方法は http://tinycorelinux.net/install_manual.html あたりでも書かれているのですがちょっとハードルが高いのでもっと簡単にインストールできそうなtc-installを使いたいと思います。

tc-installをインストールします。

$ tce-load -wil tc-instal

CLI版のtc-install.shを実行します。

$ sudo tc-instal.sh
Core Installation.

Install from [R]unning OS, from booted [C]drom, or from [I]so file. (r/c/i): 

ウィザード形式で質問に答えていけば良さそうなので「c」を入力し[Enter]。

Select install type for /mnt/sr0/boot/core.gz

Frugal
* Use for frugal hard drive installations.
Note: You will be prompted for disk/partion and formatting options.

HDD
* Use for pendrives. Your BIOS must support USB-HDD booting.
* A single FAT partition will be made.
Note: Requires dosfstools extension.
Warning: This is a whole drive installation!

Zip
* Use for pendrives. Drive will be formatted into two FAT partitions.
* One small one for USB_ZIP boot compatibility, and used to hold Tiny Core.
* The remaining partition will be used for backup & extensions.
Note: Requires dosfstools and perl extensions.
Warning: This is a whole drive installation!

Select Install type [F]rugal, [H]DD, [Z]ip. (f/h/z): 

HDDにインストールしますので「h」を入力し[Enter]。

Select disk for core

     1. sda
     2. sr0

Enter selection ( 1 - 2 ) or (q)uit: 

sdaにインストールしますので「1」を入力し[Enter]。

もしこの段階で、

sda appears to have a partition already mounted!
Check if correct device, if so,  umount it.
Press Enter key.

のようなエラーが表示されて進めない時は、一度再起動しboot: のところにmicrocore base又はmc baseと入力しブートします。baseオプションを指定する事でHDDがマウントされなくなりますのでインストールを進めることができます。

Select Formatting Option for sda1

     1. ext2
     2. ext3
     3. ext4
     4. vfat

Enter selection ( 1 - 4 ) or (q)uit: 

フォーマットはext4でいいと思いますので「3」を入力し[Enter]。

Enter space separated boot options: 
Example: vga=normal syslog showapps waitusb=5 

ブートオプションは後からでも指定できますので、このまま[Enter]。

Last chance to exit before destroying all data on sda1
Continue (y/..)? 

最後の確認なので「y」を入力し[Enter]。「Installation has completed」を表示されれば完了です。

Writing zero's to beginning of /dev/sda
Partitioning /dev/sda

/dev/sda:
Formatting /dev/sda1
mke2fs 1.42.13 (17-May-2015)
0+1 records in
0+1 records out
440 bytes (440B) copied, 0.026071 seconds, 16.5KB/s
UUID="e30b4801-9034-480c-9de0-8a08124a338e"
Applying extlinux.
/mnt/drive/boot/extlinux is device /dev/sda1
Setting up core image on /mnt/sda1
Installation has completed

USBメモリを抜いて再起動し起動できれば成功です。

dfduコマンドでどれくらい消費しているのかを見てみます。

$ sudo df -h
Filesystem                Size      Used Available Use% Mounted on
rootfs                  222.2M     12.4M    209.8M   6% /
tmpfs                   123.4M         0    123.4M   0% /dev/shm
/dev/sda1               118.0G     69.8M    117.9G   0% 

$ sudo du -hs /
21.9M   /

homeとoptディレクトリをHDDに変更

tc-install.shを使ってOSはHDDにインストールできましたが実はこの状態ではhomeとoptディレクトリはメモリ上に展開されていますのでhomeとoptディレクトリもHDDに変更します。

HDDのhomeとoptディレクトリを使用するようにブートオプションにhome=sda1 opt=sda1を追加します。

$ sudo vi /mnt/sda1/boot/extlinux/extlinux.conf
DEFAULT core
LABEL core
KERNEL /tce/boot/vmlinuz
APPEND initrd=/tce/boot/core.gz quiet home=sda1 opt=sda1 ....

sudo rebootで再起動して完了です。

アプリのインストール

HDDにインストールはできたものの、この状態では何もできませんのでとりあえず何かアプリをインストールしてみたいと思います。

Tiny Core Linuxにはtce-loadとうコマンド以外にもtceというコマンドがあります。tce-loadコマンドはインストールするアプリの名前が分かっていないと使えませんが、tceコマンドはキーワードで検索してインストールできますので、こちらの方が便利です。

試しに日付を調整するntpclientをインストールしてみます。tceコマンドはパラメーターなしでtceと入力して使います。

$ tce
tce-ab - Tiny Core Extension: Application Browser

S)earch P)rovides K)eywords or Q)uit:

メニューが表示されますのでキーワード検索の「k」を入力します。

Enter search term(s), e.g. browser:

「ntp」と入力して[Enter]。

tce - Tiny Core Extension browser

     1. chntpw.tcz
     2. ntpclient.tcz

Enter selection ( 1 - 2 ) or (q)uit: 

検索結果が表示されます。ntpclientをインストールしてみますので、「2」と入力し[Enter]。

Title:          ntpclient.tcz (TESTING)
Description:    ntpclient -- a small NTP client for unix-alike computers
Version:        2007_365
Author:         Larry Doolittle
Original-site:  http://doolittle.icarus.com/ntpclient/
Copying-policy: GNU General Public License Version 2
Size:           12.0K
Extension_by:   vitex
Tags:       ntpclient -- small NTP client unix-alike computers
Comments:       From http://doolittle.icarus.com/ntpclient/:
                  ntpclient is an NTP (RFC-1305) client for unix-alike
                  computers. Its functionality is a small subset of
                  xntpd, but IMHO performs better (or at least has the
                  potential to function better) within that limited
                  scope. Since it is much smaller than xntpd, it is
                  also more relevant for embedded computers.
                See http://doolittle.icarus.com/ntpclient/README and
                http://doolittle.icarus.com/ntpclient/HOWTO for more
                informtion.
                -----------------------------------------------------
                This extension was built from
                  http://doolittle.icarus.com/ntpclient/ntpclient_2007_365.tar.g

情報が表示されますので「q」を入力します。

A)bout I)nstall O)nDemand D)epends T)ree F)iles siZ)e L)ist S)earch P)rovides K)eywords or Q)uit: 

インストールの「i」を入力します。完了したら「q」を入力し終了します。

確認してみます。

$  sudo ntpclient -s -h ntp.jst.mfeed.ad.jp
42551 43138.499   34062.0     26.4  2166694.7  63217.2         0
$ date
Sat Jul  2 11:59:04 UTC 2016

こんな感じで必要なアプリをインストールしていく事ができます。

関連リンク

12
13
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
12
13