Wednesday, May 23, 2018

Booting Linux from a USB stick – a beginner’s guide

On a forum thread regarding being tracked by cookies on the soon to be mandatory Universal Jobmatch website, and the pitfalls of having to use unsecured wireless access points after having had your broadband cut off due to benefit sanctions, someone mentioned that it is possible to boot your laptop into Linux from a USB stick!

But how easy is it to actually achieve this? Well not very, I am a computing professional and it took me 3 or 4 hours to successfully load my chosen Linux Distribution onto a USB stick and boot from it. I took about 5 attempts using several different utilities before I finally achieved what I had set out to do. So, to save yourself a lot of frustration, annoyance and worry please learn what you can from my mistakes:

First of all you are going to need a USB stick or flash drive, I suggest you use a 4GB or larger, however most Linux distributions will fit on a 1GB. Some Linux distributions will not boot from a drive that is NTFS format, so FAT32 is preferred. If you want to reuse an old USB stick you may be tempted to reformat it using windows, DON’T. Windows (at least XP) seems to only be capable of formatting a USB stick up to 1GB with the result that a 4GB will be reformatted to 1GB by windows. If you must reformat your USB stick, perhaps because you partitioned it or whatever try using one of these:

RMprepUSB : This is able to do the entire job for you as well as preparing the USB stick(formatting) however it is far from the simplest to use. It also depends on Grub4dos, which I can not recommend unless you are already familiar with it.

BootICE : This will enable you to restore your USB stick to its original format, for example if your 4GB has been turned into a 1GB due to formatting it in windows.

Assuming that you have a fresh or reformatted USB stick ready to go you then need to look at what flavour of Linux you want to use. There are several utilities that claim to do this for you, however each one seems to favour its own selection of Linux distributions. If you try to use them to setup a Linux distribution ISO that you have downloaded, and its not one that the particular utility favours it may try to install it for you but there is a good chance that it won’t work when you come to boot from it. There are other considerations which need to be taken into account also, some of these utilities are designed to build ‘Multiboot’ USB drives, allowing you to boot into any of several flavours of Linux, and/or utility boot images such as ‘partition magic’.

XBOOT is one such utility, however the selection of Linux distributions that it supports is limited, and it tries to get around this problem by enabling you to load whatever ISO you have downloaded using Grub4dos emulation, which I do not recommend as mentioned above. Grub is not for novice users!

Another situation where it is possible to go horribly wrong in trying to create a Bootable Linux install on your USB stick is where the utility offers you to select the flavour you want from its list, saying it will download and install it for you to your USB drive.

UNetbootin is one of these. You would expect that such a program would download the ISO image to your hard drive under windows first, but this is not so. Like many bootloader utilities it installs its bootloader onto the USB, then expects you to reboot into the USB drive, where upon it tries to download and install the ISO. Which is fine if you have a hard connection to the net, but if you are on a wireless laptop you are in trouble! The instructions for this one, in this situation give the host name of the download server, but when you are booted from the USB and trying to download the ISO the bootloader wants the IP address, any you may well have no means of obtaining that without rebooting back into windows. This utility also allows you to create a bootable Linux distribution from an already downloaded ISO, but again unless it’s one that it explicitly supported by  UNetbootin, the USB may well not work, due to missing kernel components and so on. For example using UNetbootin to make a bootable USB stick with openSUSE-12.2-GNOME-liveCD-ISO (the latest version as of time of writing) the operation was successful however booting from the USB failed at boot time because the boot loader could not find the kernel image ‘gfxboot’.
The best utility for the beginner, and the one that I recommend is;

Universal USB installer from pendrivelinux.com ! This utility is simple, straightforward, and easy to use and supports almost all of the Linux distributions that can be loaded from a USB stick. It expects you to have downloaded your chosen ISO image already, and if you place the ISO in the same folder as its executable it will pick it up for you automatically. It does NOT support multiboot, i.e. it can only create a bootable USB using one ISO image, which is its only major drawback, but I suggest that ‘multiboot’ is something for the expert, and not for the beginner!

All of the above may well have problems if you are trying to make a USB with the very latest version of the Linux distribution you want, since they will all lag behind the distribution’s development cycle, that’s to say that the utility developer will most likely not have had time to update their product, so you should choose an older version of the ISO in this case, perhaps the most recent stable release rather than the current beta version.

Finally, You can’t accidentally damage your windows laptop by booting it from a USB stick unless you are really stupid! for example by formatting the wrong drive letter during the setup, or by attempting to use the USB to install Linux on the hard drive of your computer into the partition used by windows operating system.

You may be wondering by now how the hell you make your computer boot from the USB drive rather than the hard drive. The thing is that precisely how you do this depends not on what operating system you want to use but on what BIOS your computer has installed, and the exact procedure varies from BIOS to BIOS. In general the first screen that loads during the boot process is a placeholder for the BIOS, and usually this screen will tell you that such and such an ‘F’ key will allow you to enter the setup screen for the BIOS. On most PCs this is F8, on laptops (such as Toshiba) it may be F2. You will have only a couple of seconds in which to press it. On PCs the setup screen will allow you to specify which drive letter to boot from, or will allow you to enable booting from drive letters other than the default (C:). Or as on Toshiba laptops you can specify which devices can be booted from. This will enable the boot menu, which on a Toshiba is accessed by pressing F12 on the first screen. This allows you to select the device you want to boot from at startup. However every make of computer seems to have a different BIOS, and you should refer to your machines user manual to get the exact procedure for your machine.

The language of Science Fiction - An Essay

I remember Bob Heinlein talking about a writer who served up the same basic plots over and over, sometimes 'filing off the serial numbers' of a story he liked changing the lines a bit and then he 'owned it'. I have always shied away from this method of writing, even when people writing about writing have stated that there are only a limited number of basic types of plot, and almost all stories will fit to these basic types. I figure there are going to be no more Heinlein stories, since the guy is deceased. How about filing off the serial numbers and changing the lines a bit on some of his stories? The fact of the matter is that you can't copyright Ideas, only the form in which they are expressed. This of course smacks of plagiarism but consider for a minute what would happen if plagiarism was in fact a criminal offence. If plagiarism extended copyright to the extent of protecting ideas then any idea in science fiction, once used (and published!) would no longer be available to any other writer to use as his or her work and separate works which were published that did use the same or similar ideas could face years of legal wrangling to determine to whom the idea belongs. If one work used the concept of 'gravity plating' for example, then no other work except by the same author(s) could use that or a substantially similar concept. This is verging on the ridiculous! The non-legal definition of plagiarism is not clear and it is this concept of protecting ideas which makes it unclear, so we must beware of taking large chunks of another person’s work and claiming them as our own, or indeed whole works and simply changing a few proper names and so on. But, using an idea which is already present in the language of science fiction is not a crime, so long as the actual use of the idea is in your own words and your own story.

It is Heinlein's ideas that make his stories so interesting, in many cases the plots themselves are somewhat weak, but the ideas presented make the story worth reading. Clearly much of the technology he describes is defunct. Stories written in the 1940's and 50's no longer stand up technically in the 21st century. For example, in one story he describes an atomic powered 'space ship' which is basically an orbital lifting vehicle powered by steam, super-heated by a fission pile. The ship is cobbled together by a bunch of teenagers and an 'old space hand'. We now know this would never have worked due to the weight of the shielding that would have been required to prevent the occupants being irradiated. In another story a ship of a much larger scale is described, also using the same basic principle but of sufficient size to carry the necessary shielding for the passengers to at least survive in the short term. The danger of radioactive contamination is such that such a ship would never be permitted, unless either these dangers are solved, or nobody gives a shit about the danger. Another classic Heinlein story involves a 'tunnel in the sky' which is basically a Stargate concept not dissimilar to the movie of that name.

Once of the main problems which has been holding me back in my writing of science fiction is the feeling that it is necessary to always come up with something, some concept that is completely new, never been done before, and such ideas are few and far between. By the 21st century, most if not all possible ideas have been explored, often in several ways and differing approaches. Science Fiction has become more mainstream, that is to say that the story has become more significant than the ideas which are explored. Which in my view makes it possible incorporate old ideas in the form of the genre, with good plot and characters. In much the same way a writer may approach writing a detective story, or a western, the ideas and concepts of these genres are basically dictated by what has gone before and it is only the implementation that differs from example to example.

So how would we go about 'ripping off' Heinlein, without being plagiarist, and which stories or ideas are the most suitable to be 'updated'?

Let's look at 'Tunnel in the Sky' in more detail. The ideas behind this is the basic precursor to the Stargate concept; a planar region of space-time is by means of some sort of machinery, connected directly to a similar planar region of space-time, usually light-years removed. This story actually pre-dated several academic papers derived from Einstein’s special and general theories of relativity, where some solutions to his equations implied that a traversable stable wormhole could be created, given sufficient energy and a source of negative mass. Subsequently a whole new field of physics has been developed to theoretically describe the physics of wormholes. I have mentioned the Stargate movie previously, more recently we have the concept of 'Runcible Gates' described by the author Neal Asher, and probably other variations on the theme by numerous other writers. This is to say that the 'Stargate' concept has become part of the language of science fiction and indeed also the language of theoretical physics. Asher's Runcible gates are more or less identical in effect to those gates found in Heinlein's story. So basically there is no problem using this idea, since it has become part of the language of science and fiction.

So what about the plot of the story?

The basic plot is that a group of high school students are taking a frontier survival class taught by a veteran. Their final exam involves being dropped by means of a star gate onto another planet with only what they can carry and expected to survive for 10 days or two weeks. The survivors are picked up by means of another gate set several kilometres away from the initial drop. Only this time it goes wrong, the recovery gate does not open, due to 'solar interference', and the group is marooned for months. The lead character becomes 'mayor' of the primitive village that they establish. There are various trials and tribulations when the kids assume rescue is not coming, and with negligible resources they do in fact survive after a fashion. The premise is that even a bunch of teenagers can whip an alien environment and survive with only minimal losses given the basic appropriate training and moral turpitude.

Echoes of filed off serial numbers and altered lines here? Perhaps those who have read 'Lord of the flies' or other similar stories will find elements of the plot recognisable, Heinlein did say in his writing that there are no new plots. But is the plot worth ripping off (again). Perhaps, perhaps not.

Given that the Stargate concept is now accepted as part of the language of science fiction, what other concepts are also now part of that language? Well certainly the 'Star trek Universe' or series of series have added a number of 'concepts' to the language of science fiction. Most notable of these would probably be the 'phaser' and 'photon torpedoes' and the 'transporter'. Star trek conveniently glosses over the problems involved in creating artificial gravity, instead of ships which require spin to provide artificial gravity using centripetal force, the deck plates of all ships in the Star trek Universe magically produce a one directional and variable gravitational field apparently by electro-mechanical means. The 'transporter' concept is an interesting one, in that it is basically predicated on matter-transportation from one place to another by means of some electro-mechanical process, something that has also been used elsewhere in science fiction. For example, the movie 'The Fly' where the inventor of a matter-transport machine gets merged with an intruding fly. Safe to say then that 'matter-transport' is now part of the language of science fiction. A variation on the theme of matter-transport has been used in several novels, in the form of a person (or animal!) being able through the power of their mind to teleport themselves and or others between locations in space-time.

Another concept that Star trek has gifted to the language of science fiction would have to be 'warp-drive' or 'warp-bubble'. The basic concept is that a warp-bubble is created around a space ship, then space-time is compressed in front of the ship and expanded behind it, thus allowing the ship to travel at a velocity faster-than-light. The actual physics of this is far from proven, unlike wormhole theories which have a basis in Einstein’s equations, warp-theory seems to be completely fantasy, however in his 1994 paper Alcubierre formally proposed this concept, in his metric the relativistic effects, such as time dilation do not apply. One aspect of these Star trek theories is in fact realistic, warp-bubbles require the use of anti-matter as a source of energy, and anti-matter has indeed been detected in real physical experiments. Unfortunately, at present it would take millions of years to collect a sufficient amount of it to be useful in this respect.

An older concept, in the same vein, is 'hyperspace', often characterised as a region or property of space-time which when entered will allow the spaceship to travel faster-than-light, there is no real world theoretical basis for the 'hyperspace' concept. However, recent developments in theoretical physics require that higher orders of dimensions in space-time must exist mathematically in order to describe quantum mechanical objects and behaviours that exist. It is not then beyond the realms of possibility that some sub-set of these higher orders of dimensions might not represent something like the 'hyperspace' concept.

Heinlein has also looked at the possibility of higher order dimensions, for example in his book 'The Number of theBeast' where he postulates that the four space-time dimensions we experience are in-fact a sub-set of six available dimensions, and if a machine could be made to switch between these available dimensions it would not only be possible to travel faster-than-light, but also to travel to 'alternate dimensions' and to travel forwards and backwards in time. The concept of 'alternate universes' has been much used in science fiction, though usually the writers spend little or no time actually explaining the conceptual theory, and just get on with the story.

The concept of time travelling is very popular in Science Fiction, so much so that most people will be familiar with 'The Grandfather Paradox', where a time traveller travels back in time and impregnates his grandmother, thus becoming his own grandfather. Many entertaining plots have been developed using loops through time or loops in time. Again the means of travelling is usually by virtue of some electro-mechanical device the theory of which is rarely explained in any detail. It is my view that 'time-travel' has been 'done to death' in the genre. However, in each case it is done by means of the hypothetical electro-mechanical machine, whereas in theory the only way to achieve time-travel currently would be by means of two 'Krasnikov Tubes' (a type of wormhole), one outgoing and one side by side returning, which when traversed in the reverse direction would give rise to time travelling in that the traveller would arrive before having left, the temporal displacement being directly proportional to the length of the tubes. There is some discussion as to whether there must be some currently unknown physical law which would act to prevent this, a sort of 'Law of Conservation of Time'.

In summary I would say that the state of science fiction today is that the language, as of that of any other genre of writing, is well established and there is no shame in using that language to tell a story, so long as that story is sufficiently entertaining that someone wants to read it. It doesn't matter whether you use the concepts behind faster-than-light travel to enable your setting to be that of a space empire in conflict with its neighbour, or you use the multi-universe or multi-dimensional concepts to enable your character to travel in time, with all the interesting philosophical paradoxes that that entails. Your readers are assumed to understand or simply to accept these concepts as part of the language of science fiction, so much so that many writers now use these concepts like buzz-words without really going into detail on the theory.