Sunday, 13 October 2024

Following instructions; avoiding assumptions (part 3): booting, using, and installing the live Linux system

TL;DR: this post is about installing Linux on your computer when you want to keep Windows, which most people will, and you only have the one hard disk. If you're installing Linux and you're happy to overwrite everything, then it's practically a three or four click process from the Live environment for most mainstream distros. I've written this as a guide for people I know who can then ask me questions having decided they want to take this (most difficult) route. 

You've downloaded the .iso, and you've written the .iso to a USB drive. Let's revisit our mission statement again:

Linux Mint is a popular Ubuntu-based distribution that we're going to download as an .iso file; we're then going to write the .iso to a USB thumb drive and boot into the live environment. This will allow you to explore Linux without making any changes to your computer. If we're happy with the live environment, we're going to take the next step and install it on our computer. 

Now we have our bootable USB, we're going to boot into the live environment and, in the first instance,  use it as an operating system. Only when we're happy are we going to take the big step of installing it on our system. Booting into the live environment poses no threat to your current setup; but if all of this is completely new to you, you might want to consider booting on an old machine, though I will be exploring ways to make the "install" part of this as safe as possible. 

I'm going to assume that you currently only have Windows on your computer. If you have Linux or Linux and Windows (in other words, you've dual booted before), then this process won't be quite so mysterious to you. It's perfectly possible to set up your system where your offered four or five OSes to boot from at startup if you're so inclined (and some of us are). 

Step one. Insert your USB drive into a USB port and reboot your computer. Almost certainly, nothing will happen -- by nothing I mean you're likely to boot into Windows as usual. This means you have to go into the BIOS and change the boot order, or perhaps you have a boot order menu that can be activated with one of the F keys while your computer starts up. This will be different on different computers, so I can't be certain what you're configuration will be. Below is a screenshot of my computer booting:




Yours, of course, might be different, and very probably is. Whether via the BIOS or the boot order menu or both (when I boot into my BIOS, I'm told to press F8 for the boot menu), you should see your USB drive detected and be able to select it. All being well, you will boot into a live version of Linux Mint. 

If you do not successfully boot into the live environment after you've located the USB drive, it's worth giving it another go, but it's vital you see the live environment working and can use it -- for browsing and creating a file in the office suite, as two examples -- before moving on to the install step. Below is a screenshot of the system booting into a live environment:





And below, having successfully booted (Note: I changed the wallpaper): 




Click on the icon (start menu) in the bottom left-hand corner, and a menu will appear, from where you can browse and launch the applications.










The system is perfectly usable. You can use Firefox to browse the web, LibreOffice to produce documents, you can configure the system to your liking, move the task bar, change the wallpaper, but if you reboot the system all will be lost, though of course you could have saved any files you worked on to an external disk or uploaded them to the cloud. The point is the live environment is a fully functioning operating system you are free to use. You don't have to install it if you don't want to. Explore for a while and decide whether or not you want to install. 

I'm going to assume you do. But here are some questions. 

Do you have just the one disk with Windows on it? If that's the case, you will need to shrink Windows to make room for Linux (this is called partitioning) and install Linux in the newly created space. The installer will do that for you, and you will end up with a setup in which you boot into a Grub menu and choose either Linux or Windows at startup. Linux will be the default. This used to be how it was done, and it can still be done this way today. 

However. Do you have a spare hard disk. The best approach these days -- what with BIOS booting and all -- is to install Linux and its boot-loader on an entirely separate hard disk. This is by far the safest option. A super safe option is to actually disconnect your Windows disk while installing Linux. If not subsequently being able to boot your Windows partition is a nightmare scenario for you, you might want to consider one of the safer options. 

Option 1 (partitioning your existing disk, the riskiest option): 

There is, as you can imagine, more than one way of doing this. This is how I would do it. In the live enviornment, start the program GParted (this is a partitioning program). It will look something like this... ... 


... though if all you have is the Windows installation that came with your computer, you will probably see three or four partitions, all Windows related and maybe one to do with the manufacturer of the computer, who also want a lookin in your life.  The point is you have to shrink the biggest partition (which will be your main Windows partition) to make room for Linux. To do this, right-click and choose Resize/Move and then drag the partition in, thus:










Note: if your Windows partition is quite full you will not be able to shrink it very much, and you might be better with one of the alternative approaches. Now click on Resize/Move and your partition will look like this: 








Apply the changes, and GParted will shrink your partition and create your free space. This may take some time. Quite a lot of time, indeed.  In the free space, you will be creating a partition, on which you will install Linux. 

Note: If all this seems like rather a daunting faff and is putting you off, then good. Far better that you're put off at this stage than rue the day you ever started with it when you can't boot Windows... because then you'll unfairly blame Linux. 

Once you've shrunk your partition, it's a good idea to come out of the live Linux environment and reboot your computer to check you can still boot into Windows. If you boot into Windows, you can continue; if not, you'll be doing a lot searching on your search engine of choice to clear up the mess and recover what you had before. 

Assuming you successfully booted into Windows, you still have a lot of treacherous terrain to navigate. Insert your USB key and boot back into the Linux live environment. Once there, reopen GParted and create a partition in the free space. I usually go for ext4:








GParted gives you lots of opportunities to back out (helpful when doing screenshots like this), so check your work before applying. With this done, close GParted and start the installation process. To do that, you can double-click on the icon on the desktop.








And this will open the installer: 














Choose your language and click Continue -- you will be taken to the next screen, where you should select your keyboard. Do so, and click Continue.














The next screen will ask you if you want to install multimedia codecs. You might as well do so, so tick the box and click Continue. You will be taken to the Installation Type page. This is the tricky bit. You need to select Something Else and then click Continue. 














This is where you have to choose the correct partition and it's vital you get this right. Otherwise you could damage/overwrite your Windows partition. When you click on it, you will have to choose a file system and a mount point. See below:














Click OK and you will get a warning about writing the changes to disk.














If you're comfortable, click Continue. The next screen will ask you where you want to install the boot loader. Since you only have the one disk and you already have an EFI partition, you should click Install Now and the installation will begin. 

If you have never installed an operating system, this will seem very daunting. This is how it used to be done before spare hard disks and BIOS booting, and a lot of lessons were definitely learned the hard way. Nowadays, you would want to leave Windows alone and install on a spare hard disk, ensuring that you also choose to install the boot-loader to that hard disk, too, and don't mistakenly install it to the one your Windows installation is on. This can happen because that's where the installer is likely to find the EFI boot partition. Christopher Barnatt of Explaining Computers even recommends temporarily disconnecting the Windows disk, so there is no risk of making a mistake. 

Following instructions; avoiding assumptions (part 3): booting, using, and installing the live Linux system

TL;DR:  this post is about installing Linux on your computer when you want to keep Windows, which most people will, and you only have the on...