Table of Contents
dCore Install from ISO to Hard Drive Without Pre-Existing Boot Loader
Installation Type
A manual persistent dCore install from a <20 MB dCore ISO via USB or CD/DVD to hard drive. Using primarily built-in tools (eg. dd, fdisk, mkfs, vi) to prepare a hard drive, copy over dCore files and install either Grub legacy or Extlinux boot loader.
This will install a stand-alone dCore system without the need for an installer or pre-existing Linux system.
Requirements
- Working computer to prepare installation media on CD/DVD or USB (Linux system not required).
- Blank CD/DVD or USB device for the installation media.
- Reliable wired ethernet connection preferred to download and install a boot loader. Some notes on working with wireless connection are included here; however, a dCorePlus ISO (if available for your desired flavor) would be easier to use as it provides wireless support by itself.
- A hard drive with enough room for at least one new partition; use logical partitions to avoid shortage. Notice that the drive is throughout assumed to be '/dev/sda'.
- For those unfamiliar, willingness to learn applications like fdisk and vi.
- Patience and persistence to complete a manual install, take your time, enjoy the accomplishment!
Hardware Utilized
The original version of this guide was written for dCore-wily on a circa 1999 Pentium 800 MHz, 256 MB RAM, 32 MB Geforce2 graphics, 6 GB hard drive, ethernet connection. The system has a BIOS with MBR partitioning. PLOP boot manager was used, as the motherboard can not natively boot from USB (these additional steps not noted). Setting up a swap partition, outlined below, is recommended for systems with < 512 MB RAM.
Prepare Installation Media
From an existing working system (Linux, Windows or Apple) download desired dCore ISO file (most <20 MB), which contains the dCore-*.gz (base filesystem), vmlinuz-* (Linux kernel) and isolinux boot files. This install example uses Ubuntu-based dCore-xenial. Stable release dCore ISO files can be downloaded from http://tinycorelinux.net/dCore/x86/release/.
Prepare either CD/DVD or USB installation media:
- CD/DVD: Burn ISO to CD/DVD using favourite burn software. Ensure burn software is set to burn the ISO contents as a bootable disc (ie. burned disc must contain a /boot directory containing the vmlinuz and dCore-*.gz files plus the isolinux directory). If the burned CD/DVD contains only a single ISO file it was not burned correctly and will not work.
- USB: Linux users insert the USB device and run a command like
sudo fdisk -l
orsudo ls -l /dev/disk/by-id/*usb*
to determine the correct USB device. Then use thedd
command to transfer the ISO data to USB installation media. Thedd
command used in this dCore-xenial example:sudo dd if=/tmp/dCore-xenial.iso of=/dev/sdb bs=4M
.
Note:
- The target device (eg. of=/dev/sdb) does NOT use a trailing number, use the entire device.
- The dd command is destructive, backup any data beforehand and don't specify the wrong target device!
- Windows users may try using dd for Windows or Win32 Disk Imager.
- UNetbootin likely not supported.
Prepare for using wireless connection (optional)
If necessary, download the six 'wireless*' files from the folder 'sce/' in your download folder under http://tinycorelinux.net/dCore/x86/release/. Place them on an additional USB-stick so that they can be added to the running system.
Boot System to dCore Live
- Insert installation media (burned CD/DVD or USB device) and boot computer.
- Ensure BIOS is set to boot from either CD/DVD or USB depending on installation media used.
- Computer should load a dCore boot screen, press F2, F3 and F4 keys to review boot options then just press Enter to boot dCore. Depending on hardware and installation media speed, this may take a few moments to load and boot, be patient. Once dCore is installed performance is very fast.
- Will get dCore user prompt, successful dCore live boot running from RAM! This will boot to commandline only. Feel free to explore the system before proceeding. The Shift-PageUp/Down keys can be used to scroll up/down from screen to screen and Ctrl-c can be used to break out of any running program.
Partition Hard Drive
Below you find two examples for the partitioning of the hard drive; one applying a full wipe to it and setting up several different partitions for dCore, the other one adding a single partition for dCore to keep all its files in. The latter focuses on the case where a Windows operating systems is already present that one does not wish to trash.
The fdisk utility is built-in and will be used to partition and prepare the hard drive. Take care because all data on the hard drive can be lost. Although fdisk may appear daunting, it is straightforward. When running fdisk press the 'm' key at any time to review commands and 'p' to print the partition table to monitor progress.
Note:
- Various alternative partitioning software is available, such as cfdisk or GParted.
- If using alternative software, prepare the hard drive partitions beforehand and skip to the 'Copy dCore Files to Hard Drive' section below.
Wipe drive and set up three separate partitions for dCore
Prior to proceeding run the sudo fdisk -l
command for an overview of all attached storage drives. This example installs dCore-xenial onto /dev/sda1.
This example will set up a single small 6 GB hard drive with three partitions, an ~3 GB partition for the /boot directory and dCore, an ~2 GB partition for data (helps keep mydata.tgz backup file small) and an ~1 GB swap partition (low RAM system). Modify the partition scheme to suit hardware and needs. Systems with > 2-4 GB RAM may not need a swap partition. Large hard drives may benefit from additional data partitions, selectively mounting only what is required during runtime.
Reset Partition Table and Create First Partition for Boot Files and dCore Extensions
- Enter
sudo fdisk /dev/sda
to begin fdisk, will get a 'Command (m for help):' prompt. - Press the 'm' key to familiarize with the various options
- Press 'o' (letter 'o') to create a new DOS partition table.
- Press 'w' to write the table to disk, this exits fdisk.
- Enter
sudo fdisk /dev/sda
again to re-enter fdisk. - Enter 'n' to add a new partition.
- Enter 'p' for primary partition (can create up to 4 primary partitions per drive, not including extended partitions).
- Enter '1' (number one) for first primary partition.
- At first cylinder (default 1) prompt press Enter to select the default, meaning first new partition will begin at the start of the disk.
- At last cylinder prompt enter desired cylinder number to determine first partition size. In this example, a value of 392 was entered as the fdisk prompt indicates the 6 GB hard drive has a total of 784 cylinders and the intention is to use ~1/2 the drive (~3GB) for /boot and tce directory/dCore files. Note, as per fdisk instructions a specific MB value may also be entered.
- Enter 'p' to print the partition table to monitor progress.
Create Second Partition (/dev/sda2) for Data
- Enter 'n' to add a second partition for data.
- Enter 'p' for primary partition.
- Enter '2' for second primary partition.
- At first cylinder prompt enter desired cylinder number. In this example default was 393 (second partition starts where first partition ends), so press Enter to accept default.
- At last cylinder prompt enter desired cylinder number. In this example default was 784 (end of the drive). This is not desired as extra space will still be needed for the third swap partition. With ~3 GB left on the drive, the goal is to have ~2/3 of this space for data and the remainder for swap. In this example, a value of 653 was entered. Basic math: 784-393 = 391 cylinders remaining; 391 x 2/3 = 260 cylinders to be used for second data partition; 393 (start position) + 260 (partition size) = 653.
- Enter 'p' to print the partition table to monitor progress.
Create Third Partition for Swap
- Enter 'n' to add a third partition for Linux swap.
- Enter 'p' for primary partition.
- Enter '3' for third primary partition.
- At first cylinder prompt enter desired cylinder number. In this example default was 654 (third partition starts where second partition ends), so press Enter to accept default.
- At last cylinder prompt enter desired cylinder number. In this example default was 784 (end of the drive). The goal is to use the entire drive and no other partitions are planned, so press Enter to finish creating the third partition.
- Enter 'p' to review the partition table, from the example above:
Device Boot Start End Blocks Id System /dev/sda1 1 392 3148708+ 83 Linux /dev/sda2 393 653 2096482+ 83 Linux /dev/sda3 654 784 1052257+ 83 Linux
Create Boot Flag and Update Swap Partition Id
- Enter 'l' (small letter l) to list partition types, notice Linux swap is Id #82.
- Enter 't' to change a partition's system Id.
- Enter '3' (partition 3 will be used for swap).
- At Hex code prompt, enter 82 (Linux swap Id).
- Enter 'a' to toggle bootable flag.
- Enter '1' to make first partition bootable (will contain boot files and Grub).
- Enter 'p' to review the partition table (see below for the above example).
- Enter 'w' to write table to disk and exit (otherwise all your work will be lost).
- Enter
sudo reboot
to reboot system. - Use earlier instructions to reboot into dCore live.
Device Boot Start End Blocks Id System /dev/sda1 * 1 392 3148708+ 83 Linux /dev/sda2 393 653 2096482+ 83 Linux /dev/sda3 654 784 1052257+ 82 Linux swap
Add single new partition for dCore
Prior to proceeding run the sudo fdisk -l
command for an overview of all attached storage drives. If some partitions should be deleted, it is important to exactly know which ones. For inspecting their content, issue mount /mnt/sdXy
and ls /mnt/sdXy
; finally umount /mnt/sdXy
. Take note of which ones you wish to delete.
Create partition for boot files and dCore extensions and possibly delete other partitions
- Enter
sudo fdisk /dev/sda
to begin fdisk, will get a 'Command (m for help):' prompt. - Press the 'm' key to familiarize with the various options.
- Optional: press the 'd' key followed by its number to delete a partition.
- Enter 'n' to add a new partition.
- Either enter 'p' for a primary partition (can create up to 4 primary partitions per drive).
- For logical partitions, one must first create an extended one instead of a primary one; thereafter one may create dozens of logical ones within the extended one.
- At first cylinder prompt press Enter to select the default.
- At last cylinder prompt enter the size in the form
+sizeM
, e. g.+10000M
for a ten gigabyte.- The single dCore partition may be reasonably small; a couple of gigabytes is by far enough unless one wishes to store much date, of course.
- Enter 'p' to print the partition table to monitor progress.
Create swap partition and set boot flag
For systems with a low amount of RAM, create a swap partition as explained above.
Set the boot flag on the dCore partition previously created.
Reboot
Issue sudo reboot
and use earlier instructions to reboot into dCore live.
Create Hard Drive File Systems
The new partitions still require file systems. Using the built-in mkfs utility the following will prepare ext2 file systems on the first and second partition and swap in the third swap partition. Note the mkfs.ext3
and mkfs.ext4
commands can be substituted as desired.
- Enter
sudo mkfs.ext2 /dev/sdax
to install a file system on the dCore and data partitions.- Enter 'y' (yes) to proceed if any warning prompts received.
- Enter
sudo mkswap /dev/sday
to prepare the swap partition. - Enter
sudo rebuildfstab
to refresh fstab data with the new file systems.cat /etc/fstab
will confirm that the newly created ext2 and swap partitions.
Reboot
Issue sudo reboot
and use earlier instructions to reboot into dCore live.
Copy dCore Files to Hard Drive
It is assumed throughout that /dev/sdax
is the dCore partition and /dev/sday
is the data partition (if present); furthermore /dev/sdXy
is the partition created from the ISO-image.
- After rebooting into dCore live, run
cat /etc/fstab
to confirm the new partitions and filesystems. - Enter
mount /dev/sdax
to mount the new dCore installation partition. - Enter
mount /dev/sdXz
to mount USB installation media (whatever partition “z” on device “X” contains the install media). - Run
sudo mkdir /mnt/sdax/boot
to create a boot directory on the first hard drive partition. - Copy the dCore base file system and the dCore kernel to the new hard drive '/boot' directory. Notice the change in name for the target file (added dash)!
sudo cp /mnt/sdXy/dCorexenial.gz /mnt/sdax/boot/dCore-xenial.gz
(substitute file name with your dCore version)sudo cp /mnt/sdXy/vmlinuxxenial /mnt/sdax/boot/vmlinuz-xenial
(substitute file name with your dCore version)
Setup dCore TCE Drive For Persistence
- Enter
tce-setdrive
and select '/mnt/sdax' to set up the dCore TCE directory, which will provide a persistent system to install SCE extensions.ls /mnt/sdax/
will verify that the 'tce/' directory has been set up. Explore the directory as desired. Note the 'sce/' sub-directory will be empty as no SCE extensions have been imported yet.
Load wireless extension (optional)
Plug in the USB-stick with the 'wireless*' files. If necessary, one can safely unmount and remove the installation medium by issueing umount /dev/sdXz
. Again, dCore will automatically create an appropriate folder for the new USB-stick as '/mnt/sdXz'.
Make the extensions available to dCore:
- Mount that folder by issueing
mount /mnt/sdXy/
. cp /mnt/sdXy/wireless* /etc/sysconfig/tcedir/
Now load them by launching sce-load
twice, selecting “wireless-<kernel version>-tinycore” and then “wireless”. The first adds hardware drivers whereas the latter provides wireless functionality. In the article dCore Wireless it is explained how to set up a wireless connection by these means.
SSH (optional)
In order to avoid typing all of the following, one may want to log-in via SSH. This can be achieved by the following steps.
sce-import openssh-server
(import OpenSSH-server as an extension)sce-load openssh-server
(load the extension)sudo ssh-keygen -A
(generate SSH-keys)sudo passwd tc
(set a password for user “tc” instead of the empty one )sudo service ssh start
ifconfig
yields the IP-address of the machine and one may then connect via SSH to user “tc” with the given password.
With the exception of the loading of the extension, this all is not be persistent and thus will not be available after rebooting. If SSH is needed later on, follow the instructions for installing it permanently.
Import, Configure and Initiate Boot Loader
We present Grub Legacy and Extlinux as possible boot loaders. The latter will be configured for a possible chain loading to another operating system.
Vi
Built-in Vi is no beginner's friend but for simple configuration files it is easy to get the job done. At first, hit 'i' to enter insertion mode, after which one can type and use the arrow keys for navigation during editing. To save, hit Escape and enter ':wq' followed by Enter.
There are decent Vi quickstart tutorial and there are numerous tutorials online. Note that on most systems the arrow keys can be used for navigation during editing.
Alternatively import and load the more intuitive Nano editor (sce-import -b nano
, sce-load nano
).
Grub
- Enter
sce-import -o grub
(small letter o) to import the Grub legacy boot loader OnDemand (network connection required). Select 'grub' from the menu (not grub2 or other variations), this will import Grub legacy, your first installed extension! Note OnDemand is adequate for the Grub install as it will not likely be needed again after this setup. ls /mnt/sdax/tce/sce
will confirm that grub.sce is present.- Enter
sce-load grub
to load Grub into RAM for use. - Enter
sudo mkdir /mnt/sdax/boot/grub
to create a Grub configuration directory. - Enter
sudo vi /mnt/sdax/boot/grub/menu.lst
and create the following Grub configuration file (see below).- Substitute dCore file names (ie. vmlinuz-xenial, dCore-xenial.gz) with your dCore installation version.
- Substitute correct partition number in
tce=sdax
. cat /mnt/sdax/boot/grub/menu.lst
will confirm that the configuration file has been properly created.
- Enter
sudo grub-install
-
-
recheck
-
-
root-directory=/mnt/sdax /dev/sda
to setup Grub. If re-running this command in the future a '-f' (force) switch may be required at the end of the command to overwrite.ls /mnt/sdax/boot/grub
will confirm that the directory is populated with various Grub files.
- Afterwards, Grub may be removed by
sce-remove grub
; confirm by pressing Enter.
default 0 timeout 10 title dCore-xenial root=(hd0,0) <- no spaces !!! kernel /boot/vmlinuz-xenial nozswap showapps tce=sdax <- enter desired space separated boot codes here initrd /boot/dCore-xenial.gz
Extlinux
- Enter
sce-import extlinux
to import the Extlinux boot loader (network connection required). Confirm the selection by Enter; this will import Extlinux as your first installed extension!ls /mnt/sdax/tce/sce
will confirm extlinux.sce is present.
- Enter
sce-load extlinux
to load Extlinux into RAM for use. - Enter
sudo mkdir /mnt/sdax/boot/extlinux
to create an Extlinux configuration directory. - Enter
sudo vi /mnt/sdax/boot/extlinux/extlinux.conf
to create the following Extlinux configuration file (see below).- Substitute dCore file names (ie. vmlinuz-xenial, dCore-xenial.gz) with your dCore installation version.
- Substitute correct partition number in
tce=sdax
. cat /mnt/sdax/boot/extlinux/extlinux.conf
will confirm that the configuration file has been properly created.
- Enter
sudo extlinux
-
-
install /mnt/sdax/boot/extlinux/
to setup the higher stage of Extlinux in the boot directory. - Backup the Master Boot Record (MBR) by entering
sudo dd if=/dev/sda bs=1 count=440 of=mbr-orig.sda
.- If need be, one may restore the MBR later by
sudo dd if=mbr-orig.bin of=/dev/sda
.
- Install the first stage of Extlinux in the MBR.
- Switch to the root user by
sudo su
. - Over-write the MBR by
cat /usr/lib/EXTLINUX/mbr.bin > /dev/sda
( double-check before hitting Enter!!!). - Return to the regular user by pressing Control + D.
- Copy over the needed modules.
sudo cp /usr/lib/syslinux/modules/bios/menu.c32 /mnt/sdax/boot/extlinux/
sudo cp /usr/lib/syslinux/modules/bios/libutil.c32 /mnt/sdax/boot/extlinux/
- Afterwards, Extlinux may be removed by
sce-remove extlinux
; confirm by pressing Enter.
DEFAULT menu.c32 TIMEOUT 20 LABEL dCore KERNEL /boot/vmlinuz-xenial INITRD /boot/dCore-xenial.gz APPEND tce=sdax nozswap showapps <- enter desired space separated boot codes here
Chain loading other operating systems
In case Extlinux should chain-load another OS, one must additionally load the module chain.c32. Add the following section to the configuration file.
LABEL Windows MENU PASSWD donotuse KERNEL chain.c32 APPEND hd0 1
First dCore Boot from New Hard Drive Install
- Remove installation media (CD/DVD or USB device).
- Enter
sudo reboot
and ensure BIOS is set to boot from first hard drive. - Hold your breath while booting into newly installed dCore!
This will boot dCore from hard drive very quickly, ~15 seconds from boot loader to dCore prompt on ancient hardware, using ~40 MB RAM. Commandline only until graphics and additional extensions are installed. Follow the dCore Desktop Quicky guide to quickly and easily upgrade a console-based installation to a graphic desktop (FLWM and wbar like Tiny Core). Enter backup
if changing any data or configurations. Enter sudo poweroff
to shutdown. Explore the dCore wiki or post on the forum for assistance.