How to Install Skywave Linux On A Hard Drive.

Skywave Linux is a fast and lightweight operating system, built on top of Ubuntu, and distributed as a live CD iso file. While many users prefer to install it to a USB stick or SD card, you may want to put it on your hard drive as an option in a dual boot or multiboot setup. Note that there is an installer included with Skywave Linux, and it may be used for hard drive installations if Skywave Linux will be the only operating system on the disk. Instructions given here are for a "frugal install" using an iso image or files copied from an image. It makes a perfect companion to larger Linux distributions such as Ubuntu, Mint,or Arch Linux. Use the instructions below to easly configure an existing Linux system to optionally boot and run Skywave Linux.

It is suggested to create a disk partition separate from the computer's main system to hold Skywave Linux and other special frugal installs. This will ensure that updates or clean-ups for one system do not damage or clutter the other one. The webmaster has accidentally erased frugal installs kept on his main system during overzealous maintenance. Take the lesson and keep Skywave Linux on a different partition...


Prerequisites (Systems Already Running Linux)

  1. A mainstream Linux system already installed, such as Debian, Ubuntu, Arch, Mint, or other type with Grub2 as the bootloader.
  2. At least 2GB of free space available for Skywave Linux
  3. A Skywave Linux ISO file. Get Skywave Linux from here.

In the example used here, the computer has one hard drive, and it is divided into two partitions. The main system runs on the first partition and the second partition serves as storage for documents, backups, and a frugal installation of Skywave Linux. Be aware that the drive and partitioning scheme is peculiar: the first drive is "hd0" while the first partition is numbered "1" and so forth.


Copying the Skywave Linux ISO File

  1. Start up the main operating system on the computer.
  2. Open the file manager as root.
  3. On the hard drive, in the partition to be used for frugal installations, create a folder called "isofiles"
  4. Navigate to the Skywave Linux ISO file, and copy it (CTRL-C).
  5. Paste the disc image into the newly created "isofiles" folder (CTRL-V).

Configuring Grub2 to Boot Skywave Linux

  1. In the file manager, as root, navigate into the folder /etc/grub.d
  2. Create (or edit) the file "40_custom" and paste in the following code:
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.

menuentry 'Skywave Linux v1.3' {
        insmod part_msdos
        insmod ext2
	set root='(hd0,2)'
        set isofile='/isofiles/skywavelinux-1.3.iso'
        search --no-floppy --file --set=root $isofile
        loopback loop $isofile
	linux (loop)/casper/vmlinuz.efi boot=casper iso-scan/filename=$isofile boot=casper quiet splash threadirqs ---
	initrd (loop)/casper/initrd.lz
}

  1. Startup options included after vmlinuz.efi can be changed to suit user preferences."
  2. For multiple Skywave Linux startup options, create more "menuentry" items and give each its own specific codes.

After editing /etc/grub.d/40_custom, open a terminal window and update grub2:

sudo update-grub

Installing Skywave Linux Frugally on Windows Machines.

Yes, it is entirely possible to put Skywave Linux on a machine with Windows already installed! Similar to other dual boot setups, it is necessary to create a partition separate from Windows and install Grub2 as the bootloader on that partition. It is actually much like the dedicated USB installation shown below, but instead of a separate flash memory device, the files and bootloader are installed to an extra partition just above Windows. To boot windows, Grub2 is set up to chainload the Windows bootloader.

For accomplishing this sort of installation, you must correctly determine the partition to be used for holding the Skywave Linux iso file and Grub2 configuration files. This example depicts a hard drive with Windows on the first partition and Skywave Linux on the second. Expect Windows to occupy /dev/sda1; install Grub2 and MOFO Linux to /dev/sda2.

We will begin by installing Grub2 to the second partition on the hard drive. Boot the machine into Linux from a live DVD or USB stick, mount the partition, and then write the Grub2 data to the second partition as shown below:

1) Open the terminal and get root priveleges:

sudo su

2) Verify the location of the second drive partition:

fdisk -l

3) Set up a mount point to work on the partition. You may delete it later:

mkdir /mnt/SKYPARTITION && mount /dev/sda2 /mnt/SKYPARTITION

4) Install Grub2 to the drive:

sudo grub-install --force --no-floppy --boot-directory=/mnt/SKYPARTITION/boot /dev/sda2

5) Create a directory to hold the one or more isofiles:

mkdir /mnt/SKYPARTITION/isofiles

6) Use your file manager, drag and drop the Skywave Linux iso file into the "isofiles" directory in the partition.

7) Create a "grub.cfg" file located at /boot/grub/grub.cfg in the partition which will hold menu data and direct grub to boot using one or more isofiles. In this example we will configure for booting Skywave Linux, MOFO Linux, and Windows 7. Be aware that Grub counts drives starting at zero and partitions starting at one:

set timeout=20
set default=0

menuentry 'Skywave Linux 1.4' {
        insmod part_msdos
        insmod ext2
	set root='(hd0,2)'
        set isofile='/isofiles/skywavelinux-1.4.iso'
        search --no-floppy --file --set=root $isofile
        loopback loop $isofile
	linux (loop)/casper/vmlinuz.efi boot=casper iso-scan/filename=$isofile boot=casper quiet splash threadirqs --
	initrd (loop)/casper/initrd.lz
}
menuentry 'MOFO Linux 4.3' {
        insmod part_msdos
        insmod ext2
	set root='(hd0,2)'
        set isofile='/isofiles/mofolinux-4.3.iso'
        search --no-floppy --file --set=root $isofile
        loopback loop $isofile
	linux (loop)/casper/vmlinuz.efi boot=casper iso-scan/filename=$isofile boot=casper quiet splash threadirqs --
	initrd (loop)/casper/initrd.lz
}
menuentry 'Windows 7' {
        insmod part_msdos
        insmod ntfs
        set root='(hd0,msdos1)'
        chainloader +1
}

Booting the Skywave Linux Frugal Install

To run Skywave Linux, simply boot the computer and await the appearance of Grub2's menu. It should list both the main system and also Skywave Linux. Select Skywave Linux, and observe a normal startup sequence. After a few seconds of scrolling messages, the desktop should appear. At this point, the system is ready to run.

Other systems may be added in the same manner as Skywave Linux. Kali Linux, Slitaz, SLAX, Siduction, Knoppix, or any other live CD or DVD may be installed alongside Skywave Linux. The iso files may all reside in one group, but each will need its own entry (plus startup options) written to "/etc/grub.d/40_custom."


A Dedicated USB Stick For Frugal Installs

Yet another option is putting multiple systems onto a large USB stick or SD card. In that case, you must install grub to the USB stick and then use the file "/boot/grub/grub.cfg" for the menu entries. There are computer users who actually use nothing but frugal installs on a large USB stick, with the hard drive strictly storing documents, multimedia files, and so forth.

To install Grub2 to the boot sector of a USB stick, you will plug in the stick, mount it, and then write the Grub2 data to the stick. In the following example, we'll install to a USB flashdrive plugged into a machine running Linux on the hard drive. The hard drive is "sda" and the USB stick is "sdb". The first partition on the USB stick is "sdb1".

1) Open the terminal and get root priveleges:

sudo su

2) Verify the location of the USB stick:

fdisk -l

3) Set up a mount point to work on the USB drive. You may delete it later:

mkdir /mnt/USBDRIVE && mount /dev/sdb1 /mnt/USBDRIVE

4) Install Grub2 to the drive:

sudo grub-install --force --no-floppy --boot-directory=/mnt/USBDRIVE/boot /dev/sdb

5) Create a directory to hold the isofiles:

mkdir /mnt/USBDRIVE/isofiles

6) Use your file manager, drag and drop the Skywave Linux iso file into the "isofiles" directory on the USB stick.

7) Create a "grub.cfg" file located at /boot/grub/grub.cfg on the USB stick which will hold menu data and direct grub to boot using one or more isofiles. In this example we will configure for booting Skywave Linux and Skywave Linux. Be aware that Grub counts drives starting at zero and partitions starting at one:

set timeout=20
set default=0

menuentry 'Skywave Linux 1.4' {
        insmod part_msdos
        insmod ext2
	set root='(hd0,2)'
        set isofile='/isofiles/skywavelinux-1.4.iso'
        search --no-floppy --file --set=root $isofile
        loopback loop $isofile
	linux (loop)/casper/vmlinuz.efi boot=casper iso-scan/filename=$isofile boot=casper quiet splash threadirqs --
	initrd (loop)/casper/initrd.lz
}
menuentry 'MOFO Linux 4.3' {
        insmod part_msdos
        insmod ext2
	set root='(hd0,2)'
        set isofile='/isofiles/mofolinux-4.3.iso'
        search --no-floppy --file --set=root $isofile
        loopback loop $isofile
	linux (loop)/casper/vmlinuz.efi boot=casper iso-scan/filename=$isofile boot=casper quiet splash threadirqs --
	initrd (loop)/casper/initrd.lz
}

Test the USB stick by rebooting the computer system and making sure the BIOS is set to look for the stick as either a USB flash memory or as a hard drive on the system. If necessary, use "E" to edit the Grub commands at boot time and find out what works. Most problems involve pointing Grub to the isofile, then to the vmlinuz and initrd files within the iso.

Persistence: How to Keep Your Changes

There is no need to lose files you create or changes you make while operating your system from an iso file! Configure the system to boot with persistence enabled. In the persistent mode, new data and settings are written to a dedicated partition which holds them safely between shutdown and subsequent restarts. Sure, it is possible to manually save your files before shutting down at the end of a computing session, but why bother when persistent mode does it automatically? You can even install software and retain it for future computing sessions.

Persistence requires two things: a dedicated partition of at least 128 MB and an additional boot parameter. When setting up partitions, create one in EXT2 or EXT3 format and label it "casper-rw". Persistence can be added to an existing USB stick or SD card by creating a new partition and setting the label to "casper-rw". For best results, consider making the partition 1GB to 2GB in size. Then add "persistent" to the kernel boot options in grub2. At start-up, the system will find and use the partition for any changes made.

Good luck, and enjoy the convenience and robustness of having one or more operating systems frugally installed to an inexpensive USB drive.


Tags:Linux Multiboot Grub2, Skywave Linux Grub2, Customize Grub2
©2015-2017 Skywavelinux.com, All Rights Reserved.
Contact Us, Privacy Policy, XML Sitemap.