site  news  contact

How to install EasyOS on your hard drive

March 17, 2019 — BarryK

Preface:
When writing a tutorial, there is a temptation to explain every little detail, resulting in the reader's eyes glazing over. This page is a tutorial about how to install EasyOS on a PC hard drive, rotating-platter, eMMC, SSD, or whatever, and it is hoped to provide enough detail so as to be easy to read, with links to further reading, or alternative installation methods. It is hoped that you find a pleasant balance is achieved.

This page has been created for EasyOS 1.0.12 or later. Some steps will be different for earlier versions.

Alternative installation methods

Regarding alternative installation methods, well, had better get those out of the way. Here they are, itemized:

  1. The page that you are reading right now is for modern (manufactured in 2012 or later) Windows desktop PCs and laptops, with UEFI firmware. For older PCs with BIOS firmware, the installation steps are somewhat different, and require a separate tutorial, here:

    https://easyos.org/install/easy-frugal-installation.html  

  2. The page that you are reading right now explains how to create or use existing partitions in the internal hard drive, in which to install EasyOS. An alternative is to install Easy to an entire drive. If this is a possibility for you, take a look at it, recommended due to the extreme simplicity of installation. The tutorial is here:

    https://easyos.org/install/how-to-install-easyos-on-a-new-ssd.html 

  3. If your PC is already setup for multi-booting, with rEFind boot-manager, read this:

    https://easyos.org/install/install-to-pc-with-existing-refind-boot-manager.html 

    You should be able to adapt the instructions to some other boot-manager such as GRUB2.

Preparation

The method explained in this page is to install to two partitions in an internal hard drive, on modern UEFI-firmware PCs.

It really is "part-2", as you first have to create some empty space on the hard drive, in which to create those partitions. This would be the situation if your PC runs Windows and there had never been any Linux distribution installed on it.

Warning about 32GB

The Mele has a 32GB solid-state hard-drive, of type eMMC, with Windows 10 Home installed. Microsoft now advise that 32GB is not big enough to handle upgrades, and are recommending new baby computers to have 64GB.

This tutorial describes reducing the C: drive down to 20GB, though, in "part-1" it does mention only creating a 644MB gap in the eMMC, and use an SD-card as the working-partition of the EasyOS installation.
Yes, this is do-able, and the Author has confirmed that it works on the Mele. You would need to modify the procedures described below, accordingly.

However, the Author has found that Windows 10 Home can live in only 20GB. Windows does have a utility for freeing-up space, and one item is to remove history, so you lose rollback. In theory, Windows can use an external drive for download when updating, however, the Author has not tried that.
This is acceptable to the Author, as he hardly ever uses Windows (and probably you won't either, when you realise how good EasyOS is!)

Well, read the so-called "part-1" and see if you need to do any of it. If you do need to create a "empty gap" in the hard drive, then do it. The link also explains some changes that you will need to apply to Windows for it to tolerate booting another operating system.

Please read the "part-1" tutorial:

https://easyos.org/install/prepare-your-computer-for-booting-linux.html

The status quo, for reading the rest of this tutorial, is that you have read "part-1" and kicked Windows into shape, and you either created an "unallocated gap" in the hard drive, or can use existing (non-Windows) partitions.

To be able to install EasyOS, you need to be running EasyOS!

Easy enough, the next step in this "Preparation" section is to bootup Easy on a USB-stick. Please go here to find the latest version, download, and follow the instructions to write it to a USB-stick:

https://easyos.org/install/how-to-write-easyos-to-a-flash-drive.html

Then, boot-up your computer from the USB-stick and you are good-to-go for this tutorial...

The case study for this tutorial is a Mele PCG35 Apo mini-PC, that is introduced in "part-1". Here it is, booted-up from a USB-stick:

image1

Author's note:
Ha ha, that reminds me. I received an email recently, from a chap lamenting that I was not supplying Easy OS as an ISO file -- his complaint was that there is lots of room on a CD to write stuff, but no space on a USB Flash stick. Not so! I have a simple solution -- masking tape, as you can see above. Whenever I change what is in the drive, I apply a new piece of tape. The thing about masking tape is that it is cheap, sold everywhere, and you can write on it.

Next step, that "unallocated gap" has to be turned into two partitions, one fat32, the other ext4. For that we have a superb Utility, named GParted...

Creating Linux partitions on the internal hard drive

Part-1 explained how to use the Windows Disk Manager utility to shrink the C: partition, to make space for creating a Linux partition. This is the safe way to do it, that will keep Windows happy.

Now that you are running EasyOS, you can use the GParted partition management utility, to create one or more partitions in that "unallocated" gap.

Start GParted from the menu (look under "Filesystem"), and first-up there is a wrapper-window, which asks which drive you want to work on:

Menu "Filesystem"
choose "GParted partition manager"
choose "mmcblk0"

In the Mele, the internal drive is named "mmcblk0", and partitions are named "mmcblk0p1", "mmcblk0p2", "mmcblkop3" and "mmcblk0p4". This is Linux naming, and the Windows C: partition is actually "mmcblk0p3".

After GParted starts, this is what you will see, for the Mele case-study:

image2

...you can see the "unallocated" gap created in part-1.

Now, what we need to do is create two partitions. The first will be a small 640MB partition with a fat32 filesystem -- this is required for booting, and we will know it as the "boot partition". OK, let's do it...

Creating a fat32 boot partition

A computer with UEFI-firmware will recognise a boot-partition, and add it to the list of bootable operating systems. In the GParted window:

Right-click on "unallocated"
choose "New"

Then you will see this window, and fill in the parameters appropriately:

image3

...we only want a size of 640MB, fat32 filesystem, and give it a suitable label, in this case "easy1".

And here it is:

image4

There is one more thing to do, to make "mmcblk0p5" bootable:

Right-click on "/dev/mmcblk0p5"
choose "Manage flags"
tick "esp" and "boot"

Bootable partition created!

That's for booting-up. However, the actual partition used when Easy OS is running, is going to be another one, and we will know this as the "working partition".

Creating a ext4 working partition

Basically the same procedure as before:

Right-click on "unallocated"
choose "New"

And fill in as appropriate. In this case, leave the size as-is, which will fill all available space, choose "ext4" filesystem, and type in a label, for example "easy2":

image5

You are finished with GParted, exit from it.

However, there is one little hiccup. GParted does not support fine-tuning some ext4 settings. It is a pity, but we have to do this manually. Not essential, but highly recommended, putting it into a coloured box to emphasize that this should be done:

Please do this!

There are two highly recommended tweaks that can be made to the ext4 filesystem:

  1. Disable journal
    On Flash drives, which includes SSDs, it will prolong the life of the drive if writes are avoided as much as possible. One thing that can be done in this regard is to turn off "journalling".
  2. Enable encryption
    If this is enabled, then folders may be encrypted. This works on a per-folder basis, so does not affect the rest of the filesystem that you want to leave unencrypted. Highly recommended for keeping your personal information secure.

Here is how you do it. The Author is making a big "song and dance" about it, with this coloured box, but really, it is just this one-liner. Open a terminal and run this:

# tune2fs -O encrypt,^has_journal /dev/mmcblk0p6

That's it, done.

Note that "-O" is a capital-letter. If you want to, you can paste the above command into a terminal window -- drag to highlight it, then click the middle-mouse-button in the terminal -- this is the standard Linux method for pasting any highlighted text, works in all apps.

Almost there! Just need to put some files into the fat32 partition...

Populating the boot partition

Near the bottom of the screen you can see the partitions, "sda" is the USB-stick and "mmcblk0" is the internal SSD. The partitions "mmcblk0p5" and "mmcblk0p6" are the newly-created boot- and working-partitions. To populate the boot-partition, all that you have to do is drag some files from "sda1" to "mmcblk0p5":

image7

...it is easy, just click on "sda1" and "mmcblk0p5" to mount them, file manager windows will pop-up, and drag some files across -- as shown above.

You only need to copy the files and folder shown in /mnt/mmcblk0p5 above. The others are for the Syslinux boot manager, for booting the USB-stick on pre-2012 PCs.

Tantalizingly close now! Just a little fix required in that initrd file...

Fixing initrd

The file initrd is a tiny Linux filesystem, that the kernel loads into RAM and runs at power-on, prior to launching the "proper" EasyOS. File easy.sfs is the entire EasyOS filesystem, and vmlinuz is the Linux kernel.

If we were to reboot right now, Mele would detect the "mmcblk0p5" boot-partition, and would load the vmlinuz kernel, which in turn would load initrd. But, bootup would fail at that point. We need to fix one little thing -- there is a text file inside initrd, named BOOT_SPECS, that has to be edited.

Which is quite easy to do. initrd is a binary file, however, it can be opened up just by clicking on it, and this window will appear:

image18

...despite the warning, click "Yes" and this appears...

image15

...looks good!

What that "fix" has done is inform where the boot- and working-partitions are. Every partition has a unique UUID (Unique Universal Identifier). If you want to, you can confirm that the "fix" is correct, by running the 'blkid' utility, like this, in a terminal:

# blkid /dev/mmcblk0p5
/dev/mmcblk0p5: LABEL="easy1" UUID="EF1E-16B2" TYPE="vfat"

Click "Yes", and you get a confirmation...

fixed1

Well... you don't have to, but there is one extra thing that you can do manually to that BOOT_SPECS file. Notice that WKG_DIR='' -- that means that Easy will create folders at the top-level of the working-partition.

You might find it a bit more tidy if Easy were to create its folders under a sub-directory. This clearly separates folders created by Easy and anything else that you might want to do on that partition. If it is only a 7.4GB partition, then you not going to be using that partition for much else, but if it is a much bigger partition, then maybe. Putting this into another nice little coloured box:

For the fastidious

If you click on initrd file again, you can open it up and edit that BOOT_SPECS file in a text editor. What is suggested is that you do this:

WKG_DIR='easy'

Where WKG_DIR can be any arbitrary path that you want. The folder does not have to exist, it will be created. There is a snapshot further down that will show the result after bootup.

We are now ready to bootup Easy from the internal hard drive...

Booting Easy

The installation described on this page is already setup for booting Easy, no extra boot manager required. No invasive modifications to the hard drive. Later, if you decide that you don't want Easy on the hard drive, just bootup Easy from the USB-stick and run GParted, then delete those two partitions -- hey presto, you are back to the start of this web page.

You can then bootup Windows and run the Disk Manager, as described in part-1, and grow the C: drive to fill up that 640MB + 7.4GB gap that was previously created.

Anyway, it is most likely that you will really like Easy running on the internal drive, and will keep it!

So, how do we boot Easy, for the very first time? The answer is to run UEFI-Setup. Power-on, holding down the hot-key (ESC key on the Mele), then select whether to boot Windows or Easy.

Easy will then present you with a boot menu:

image11

...that bottom item will run the UEFI-Setup, a handy way to run it on future occasions, without needing to press the hot-key.

A picture is needed to show Easy now running on the Mele:

mele12

At first bootup, Easy creates some folders in the working-partition. It was suggested above that if you had put some thing into the WKG_DIR variable, then those folders will get created under it.

Well, for the example of WKG_DIR='easy', the folders 'containers', 'releases', etc. are created under 'easy':

wkg1

wkg2

...just for the sake of tidiness, then you can bung anything else that you want at the top level.

To round-off this page, explaining more about dual-booting...

rEFInd boot manager

The UEFI-firmware works as a rudimentary boot manager. At power-on, it scans the drives, searching for what are known as "EFI system" vfat partitions. You will see in the GParted snapshots above, that there is one for booting Windows, "mmcblk0p1".

The exercise we went through on this page is to create another, "mmcblk0p5". At power-on, the UEFI will recognise all of these EFI system partitions, and add them to the boot-list. By default, it puts the Windows one on top, that is why you have to run UEFI-Setup and change the order.

This works fine, and is a very simple and non-invasive way to dual-boot. And, especially, easily reversible.

However, if you want a nice menu at power-on, offering you a selection of operating systems, well, Easy already has it: the rEFInd boot manager.

The boot-menu snapshot shown above, is actually provided by rEFInd, and by a very simple configuration change, rEFInd can be told to scan the computer and offer other OSs in the menu. In the boot-partition, open file EFI/BOOT/refind.conf in a text editor. You will see this:

timeout 10
textonly on
textmode 0
showtools shutdown,reboot,firmware
#scan_all_linux_kernels off
#scanfor manual,internal
scanfor manual

menuentry "Easy OS" {
loader /vmlinuz
initrd /initrd.q
ostype linux
options rw
submenuentry "Filesystem check" {
add_options "qfix=fsck"
}
submenuentry "Commandline only, do not start X" {
add_options "qfix=nox"
}
submenuentry "Rollback to earlier session" {
add_options "qfix=bak"
}
}
menuentry "Windows 10" {
volume SYSTEM
loader \EFI\Microsoft\Boot\bootmgfw.efi
disabled
}

This configuration file tells rEFInd to not do any automatic scanning. Notice the entry for "Windows 10" at the bottom. If you comment-out that "disabled" line, and replace "SYSTEM" with the label of the Windows ESP partition (on my Mele it is "SYSTEM"), then you will have Windows added to the boot menu.

Alternatively, you can turn on automatic scanning, which is, quite frankly, brilliant. Just change these three lines, like so:

scan_all_linux_kernels off
scanfor manual,internal
#scanfor manual

Reboot, and hey presto, Windows is in the menu:

image13

...this example is for the Author's Mele PCG35 Apo mini-PC. If there were other OSs, they would also be picked up and offered in the menu.

Post-amble

Probably most of the install describe above could be further automated with a nice GUI. The Author might do it one day. There is a certain personal satisfaction though, doing it manually.

The Mele PCG35 Apo has an interface for 2.5inch SATA hard drive or SSD, which would be another really nice way to install Easy, and, in fact, there is a tutorial to do this:

https://easyos.org/install/how-to-install-easyos-on-a-new-ssd.html

Have fun!


(c) Copyright Barry Kauler, December 2018, March 2019, all reproduction rights reserved.
A disclaimer: Barry Kauler has provided these instructions in good faith, however there is a disclaimer of all responsibility if something does go wrong. It shouldn't, but if you type in something incorrectly and wipe your C: drive, that is entirely your own responsibility. if you are a Linux newbie and want to install Easy on the internal hard drive, it is recommended that you find a Linux-knowledgeable guy to help.


Tags: install