Blog-Archiv

Montag, 5. Januar 2015

Installing LINUX without CD or USB Stick

Mostly we have our noses high up in the air, thinking that nothing can harm us in our speculations about cloud circulation:-) Operating systems, hardware, installations, what's that? We successfully absolved these exams of digital life long ago.

But then that machine did'nt do anything when I started it, except switching on numerous leds to show that it got power. Both screens stayed dark, there was no sound, no operating system booting, no response at all. It did not even come up to the CMOS/BIOS option where you can press F-12 (or ESCAPE, or DEL, or any of these keys hardware vendors never tried to agree about) to set the first boot device to the CD-ROM drive with a boot-disk.

So I found myself nose deep down (between screen and keyboard :-), trying to figure out what to do now. Having no internet to advice me. Hard to imagine, isn't it? But it can happen every day, even to you.

Backed up data?

Making regular backups of your work, on any computer you work, is a necessity to survive such situations without severe injuries from running your head against the wall :-) Save your data any time before you log out or shut down or switch off.

I use my FTP space on my internet provider's server for that. And I have separate USB sticks for text files (source code), images (photos) and applications, where I do additional monthly backups.

Most emergencies happen after a long time, when the hardware starts to get old. It is like the seat belts in your car: 99% of the time you fasten them without having an crash after. But for the simple possibility to have one you should fasten them always.

Having Boot/Repair CD or USB stick?

Have your operating system CD (repair CD) or your USB boot stick on a safe place. You should be able to find it even after many years. Putting them into an envelope with name, date and content list is very useful. You should also write any administration password used during installation down there. I have that stuff in a box near the computer, including all login- and server-informations about my internet provider.

When you use LINUX, take the time to create an USB boot stick after a successful installation. It is little time compared to what you will have to spend when an online upgrade goes wrong (yes, such happens).

Having internet access?

In such situations it is always helpful to have internet access. The error messages that appear on the screen are not for normal people. You need the internet to translate these "communication attempts" into comprehensible hints what is wrong.

I have a cheap netbook for quickly looking at the internet. I use this rarely for work, but I keep it up-to-date and going. (For instance I write this Blog during that installation adventure now.)

It is also essential to have a router that allows you to use several computers at the same time on your internet access.

Here are three "communication attempt" examples.

This is what Ubuntu showed me while booting:
[  69.051078] via-ircc 0000:00:11.C: device not available (can't reserve [io  0x4000 0x407f])

Or consider this "meaningful" message directly in the partition editor:

You will not be able to create, delete or resize partitions on this disk, but you may be able to install to existing partitions there.

The partition editor worked quite normal, I could create, delete and even resize partitions. Besides, not very much useful can be found on the internet concerning this message!

Before rebooting, place a Debian install iso file on the root directory of your hard drive or USB drive. These can be obtained from cdimage.debian.org

Nice to know, but which ISO? CD-1 ? DVD-1 ? The Live ISO ? Hybrid ? What exactly means "root directory of your hard drive" ? When I booted, the installer did not find any ISO image, although it was placed in C:\ (WINDOWS root directory), which was the hard disk itself booted from.

Reuse an old computer

My laptop is gone. The repair of such a device costs much more than a new one. They are built to be thrown away. Not nice, but reality. Have you seen the "Story of Stuff"? We have to cope with that.

I have an old computer that still works, with 500 MB memory (yes such exists). It already has three operating systems, a WINDOWS-XP SP-1, an Ubuntu 6.06 and a Suse 8.1. So I decided to try out whether I could install an up-to-date LINUX on it, abandoning the other two, because they are too old for upgrading.

To install a new operating system you need a "boot device", which is a pluggable data store (CD, DVD, USB-stick, ext. disk) having a basic operating system on it that can partition hard-disks, create file systems, and then copy data onto them. My old computer does not offer the opportunity to boot from an USB stick. The BIOS (where you define the boot device order) will tell you whether this is possible. If USB ain't there, your only option is to use PLOP if you have a working CD-burner or floppy disk drive. But mind that this boot loader might kill your LINUX boot loader, see my experiences on bottom of this page!

The machine has a CD-ROM drive, but no burner to write some LINUX ISO-image on a CD. Also I have no current LINUX boot/install CD.

But the existence of one already running operating system (WINDOWS) is, together with internet access, enough to install LINUX.

Having Time?

Such problems always take a lot of time. It should be a weekend. Rarely I was off with less than one day of work when installing a new operating system.

What costs so much time are especially the bad installer user interfaces. For example the new Ubuntu 14.04 Live installer comes with animations, the UI being so slow that you always wonder whether you clicked or not, they fade in and out any popup! The Fedora installer presents a partitioning tool that simply resets your "/" input when assigning a root partition, without telling you why, but it took 900 MB download volume to come so far! Installing an operating system sometimes is like searching a way through a labyrinth.

Also you might have to start chkdsk /f or /R, scandisk or fdisk or whatever test- and repair-programs exist on the different operating systems, and these run for a long time. Last time I started a WINDOWS defragmentation I canceled it after 2 hours. It ran on a 27 GB disk, and it did not report how much percent already was done! When I let an Ubuntu utility test the memory chips, I canceled it after one hour and about 6 millions of errors (although the computer worked completely normal).

Getting knowledge

There are many LINUX available for free installations from the internet. Look at the choice in UNetbootin:

  • Ubuntu (Kubuntu, Xubuntu, Lubuntu, Mint, ...)
  • Debian
  • Fedora (RedHat)
  • OpenSuse
  • Mandriva
  • ...

Ubuntu is the most user friendly and popular LINUX today. It is based on Debian. Ubuntu offers different systems that are all built from the same source base, but have different desktop environments, and are aimed at different user groups (a big part of them aim just the user-interface design taste:-).

When your machine is old, with a slow processor and 512 MB memory only, Lubuntu 12.04 is the only option (L=light). Do not try the 14.04 version, because it includes window animations you can not configure away, this kills any weak machine.

With 1024 MB memory you could dare Xubuntu, and with more capacity you can use the flag ship Ubuntu.

For a current LINUX system you need minimally 12 GB hard disk space. Create an "extended partition" behind the WINDOWS partition. You need at least one partition for "/" (root) and one for a swap partition. The latter should be at least as large as the memory, or better its double size, so for 512 MB RAM create a 512 - 1024 MB swap partition. Put the swap partition after the WINDOWS partition, and let the root-partition be the last one. There is a good article about partitioning on the Debian site. Partitioning can be done with any LINUX installer. They also can shrink existing WINDOWS partitions.

How a second operating system can be a boot device

The technique is following (you need unused hard-disk space, or some partition you can abandon, at least 8 GB):

Running WINDOWS, an ISO image containing a LINUX operating system is downloaded and extracted to the local C:\ disk. The file C:\boot.ini then receives a new entry to be able to boot the new operating system. After restart, that system can be chosen on boot loader level. It offers you to install it to some free partition on your hard-disk.

How it is done:

  • Download wubi.exe (Ubuntu only) or UNetbootin (lots of LINUX derivates) and start it, do not yet download an ISO-image, they will do this.

  • In the displaying GUI dialog,

    • choose the LINUX version you want to install, and

    • assign a target drive for the ISO-image of the operating system, in this case the harddisk (C:\), to install beside WINDOWS.

    • Press "Install". Downloading the ISO-image of the OS (operating system) takes quite a long time, it has at least 800 MB.

    • Finally files get unpacked, and then you are prompted to reboot.

    • Alternatively you can download the ISO image yourself (use a BitTorrent client for that) and tell UNetbootin to extract this.

  • When rebooting, a new list is presented, offering "UNetbootin" (or "Ubuntu", or "Wubi") beside the installed WINDOWS, so you choose "UNetbootin". In case you have a still active bootloader (e.g. a grub), there will be two levels of boot menus, and you will come to that new list only after choosing to start "Microsoft WINDOWS" first - this might be a little confusing.

  • After that boot loader prompt, a line of text appears on top of screen, saying "Bootin GRLDR, press ESC to ...", now you can press ESACPE to get to a menu that lets you choose to install immediately to hard disk. Else the try-out LINUX starts up, which takes even more time, and might be quite slow.

  • Being in a fully functional LINUX now, you can choose to install to hard disk, which would include a LINUX-made boot loader menu (not the one from C:\boot.ini). The way the installation is done is vendor-specific.

  • After the installation succeeded and you have tested it by at least one reboot and one user-login, you should go back to your boot device (WINDOWS) and clean up the LINUX files there by starting UNetbootin. It will ask you to remove the current installation, answer "Yes", as it means the installation that has been made on the WINDOWS partition. You should check if the (big) ISO image has been removed from C:\Documents and Settings\username\Local Settings\TEMP. Also directories in root directory C:\ might have remained: .disk, boot, casper, dists, isolinux, pool, preseed, unetbtin, ubnldr*.

UNetbootin is available for several platforms, not only WINDOWS. The described way to install is called "hd-media". Another way is "net-boot". The difference is that with hd-media you have a downloaded ISO image on your hard-disk, while with net-boot everything except the boot system is downloaded from the network (internet).

Running LINUX from WINDOWS, without opportunity to change the system persistently, is called "live-mode" (is just for trying out).

What really happened

You might want to skip the following "narration" and go directly to the summary.

When I started, I did not yet know a lot of the things mentioned above.

First thing I tried was WUBI. After reboot, the boot.ini choice was there, but the booting Ubuntu crashed. Then I tried UNetbootin, although this seems to use WUBI for Ubuntu downloads. However, finally I got an Ubuntu 14.04 up and running, but during installation to hard-disk this happened:

The installer encountered an error copying files to the hard disk:
[Errno 5] Input/output error.
This is often due to a faulty hard disk ... CD ROM drive ... try to clean ...

Moreover that LINUX was incredibly slow. The UI needed seconds to respond. I thought this is just the live-mode, what proved as mistake later.

I tried again with Ubuntu 12, then 10, then 13, several times, sometimes letting format the root partition, sometimes not, it always ended either in the same error message, or in a complete crash (frozen UI, blinking keyboard, no more mouse response).

During that I discovered the option to branch into an immediate hard disk installation after startup by pressing ESCAPE (as mentioned above), and by that had the advantage of a faster UI.

Then I tried Fedora, but this installer did not let me edit the partition table. I mean, it did, but finally when I said "Done" it always complained that no partitions were assigned. Do not know how to drive that, found nothing about it.

On the second day I managed to crash the boot loader by another courageous Ubuntu installation attempt that seemed to have succeeded at least partially. So I was forced to re-install WINDOWS before continuing, because I could not start any operating system any more. By that I lost tons of Microsoft XP upgrades that accumulated in the course of time. Microsoft ended support for XP in June 2014. Try browsing the web with InternetExplorer-6, you won't succeed. You can not download anything from sourceforge, not even read those pages. That WINDOWS is now a sinking island with flooded shores. But it runs safely and fast on that hardware, unimpressed by the many crashes of the LINUX systems, and it did not destroy the file system on a setup-repair, so I could restore at least my Firefox to download tools.

After all I was secure about the fact that something is wrong with my hard disk, but I did not know where. I tried to check disks in WINDOWS "Computer Management" UI, and started to defragment. I tried to start chkdsk /f (XP scandisk replacement), but this told me that it can not work because it can not lock the disk, and offered me to do it on next reboot. I could not state any improvement through that program after reboot and a long time to wait for WINDOWS to show up then.

Finally I dared to simply remove the old LINUX partition from the WINDOWS "Computer Management". Then the Ubuntu installation succeeded. Endurance prevails, I thought :-) Proudly I started that Ubuntu 14.04.1, the most current one, just to find myself in a system that was as slow as it was in the try-out installation. Ubuntu contains compiz as desktop manager, and this software is simply too much for an old 500 MB memory PC. Typing one character took about 3 seconds.

So back to the roots. I read that XUbuntu is the right thing for me. Downloaded it, rebooted, began installation into existing ext4 partition, crashed. The boot loader is damaged, no more WINDOWS again. My back aches, my ass hurts from sitting a really long time. Operating systems go to the substance. Tomorrow is the third day of this adventure.

On this new day I repaired WINDOWS by a setup CD, and then downloaded Lubuntu. It was up-and-running after first installation attempt via UNetbootin. But still those nasty window animations delayed my work for seconds (drag a window and you wait up to 10 seconds). I looked for a solution on the internet, but it seems that they hardcoded the animations into the desktop manager! It has three desktop manager variants that you can choose on login level (there is no "Unity 2D" option):

  • Lubuntu
  • Lubuntu Netbook
  • Openbox

Currently I am on "Lubuntu Netbook", but it also got those animations. Seems that the whole world has gone animation-crazy. Let the processors get hot, it's a cold world.

It has become dark on this third day. Lubuntu is not booting. It crashes immediately after having been chosen on boot loader level. So now I have an endlessly self-rebooting computer :-)

Either that software is really not what we would expect from a stable operating system, or my hard disk is really old and faulty. But why is WINDOWS then booting so fast and without problems? Just because it is as old as the hardware?

So now after searching hard for a LINUX for old weak machines I came upon LinuxLite. But UNetbootin does not support that. (Why? It's an Ubuntu!) But I was able to download the ISO-image with my netbook LINUX, and put it onto an USB stick:

  # got to download directory
$ cd downloads

  # check where the USB stick is
$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda6        67G  5.8G   58G  10% /
udev            489M  4.0K  489M   1% /dev
tmpfs           100M  824K   99M   1% /run
none            5.0M     0  5.0M   0% /run/lock
none            496M   80K  496M   1% /run/shm
/dev/sda2        73G   24G   49G  34% /media/disk
/dev/sdb1       7.3G  4.0K  7.3G   1% /media/Sony_8GR

  # the USB stick is /dev/sdb1, unpack ISO-image to it
$ sudo dd if=linux-lite-2.2-32bit.iso of=/dev/sdb1 bs=4M

There is a small tool that allows to boot from USB stick even when the BIOS does not have such an option. It is called PLOP. There is an explanation on the internet how to apply this. I grabbed an old floppy disk, downloaded rawwrite for WINDOWS and followed the explanation until I had a boot floppy (simply putting plpbt.img onto the floppy). And it really worked! With the floppy disk and the USB stick both inserted into the computer I saw a boot menu that let me boot from the USB stick! But the glory was short, the LinuxLite on the USB stick crashed immediately. I tried the same with an older USB stick that contained an Ubuntu 12 and it worked. That installation crashed on file copy, again with the usual input/output [Error 5].

The floppy experiment damaged my grub boot loader. Having to repair with Microsoft CD again, else no operating system any more. I don't give up. Next is Mint Linux. Live mode is nice, and without animations (really important now). Installation fails with the usual input/output [Error 5]. "Oh, it's an Ubuntu!".

Next is Elive, a Debian with a desktop manager called Enlightenment. Really beautiful Mac imitation. Its Firefox browser calls itself "iceweasel" and is of version 3.05 (year 2009)! That is not what I am looking for.

Meanwhile I have tried really a lot of desktop LINUX derivates, but none succeeded in establishing itself on my hard disk. All Ubuntu except Lubuntu failed on coyping files, and Lubuntu failed when I rebooted for the second time to try out the installation. I could not boot Lubuntu anymore after that crash, I had to uninstall it by UNetbootin.

So, what about the myth that you can install LINUX on any old box? Ubuntu seems to be not the one. I found on the internet that Ubuntu is giving up support for old machines, but Debian still keeps it. But I could not yet install Debian due to unclear documentation of its install procedure.

Now here is the Debian experience. I tried the so-called "hd-media" installation, where UNetbootin requests you to put an ISO file into file system root before rebooting. But that did not work. After having booted, Debian reported that it has not found any ISO image. I started a shell and looked around, there was none. Rebooting back to WINDOWS I found it was in C:\ where I had put it before, and it had a correct ".iso" extension. Putting it into the unetbootin directory did not help either. There was no visible Debian-directory where I could have copied the file to. The internet said that this problem happens when the ISO does not fit to the hd-media files, both must be from the same build and server. So I tried to find out from where UNetbootin downloaded the hd-media files. Making a screenshot (was too fast to read) and then searching on that server showed that there simply is no ISO file for the hd-media installation!

I switched to the net-installer then. Installing without an ISO, directly from some HTTP/FTP server. UNetbootin offers that kind of install. It worked fine. Automatic internet connection detection with DHCP setup, you just have to input things like country, keyboard, root password etc. Easily it ran. Until the copy error, again. Like all other Ubuntus, without closer specification what the problem is (input/output Error). Other than Ubunbtu, Debian enables you to continue after that error, or even repeat the copy process. I tried to repeat, but again ran into the same problem. Then I ignored it and tried to finish the installation, but then grub (boot loader) could not be installed, and I was not able to circumvent this by entries in the UNetbootin menu.lst on the WINDOWS disk (UNetbooting uses a WINDOWS grub for starting Live-LINUXes).

So the reason for my problem was not that Ubuntu has given up support for older machines (although they do this, implicitly, by forcing animations to the desktop environment!). There must be a defect on my hard-disk the software can not adjust. I didn't know that such defects can not be circumvented by the OS when formatting the medium. I decided to look for the location of the problem by first trying to put the system into the front part of the free disk space, and then in the back part. When both fail, its time to abandon that machine. There were 30 GB free, I divided this into 15 GB, which is said to be enough for a LINUX partition.

The installation into the front part ran into the copy-problem, but the installation into the back part succeeded! Also the grub installation now succeeded, so I could boot my new Debian! Looking for the usual disappointment I opened the installed web browser. It called itself "iceweasel", but this time (other than on Elive) it seemed to be a real modern Firefox browser. Looking at the JavaScript debug environment convinced me, this is an acceptable system. Started a YouTube video, no problem, even audio worked fine.

Now, after having found out how to "master" my hard-disk, I could have installed an Lubuntu. But I was curious in trying out Debian, and how much it differs from an Ubuntu system. Is it really just the desktop environment (Gnome, KDE, XFCE, LXDE, Cinnamon, ...)? Debian itself comes with Gnome. I am missing nothing so far. Feels very much like Ubuntu.

For mounting the WINDOWS FAT32 partition I must know its identification under LINUX:

$ sudo blkid
/dev/sda5: UUID="43a75950-f637-4d76-aaba-3988c6c4a575" TYPE="swap" 
/dev/sda1: UUID="ACB9-797F" TYPE="vfat" 
/dev/sda6: UUID="0e77c53f-d84f-4fab-b3c4-3671df6d96f5" TYPE="ext4" 

This shows that my disk is /dev/sda1, or UUID="ACB9-797F". I let the system mount it (hopefully) automatically by appending a line in /etc/fstab:

$ sudo gedit /etc/fstab

  # append this line to end and save/quit:
/dev/sda1   /media/c   vfat   user,fmask=0111,dmask=0000   0   0
  # ... or alternatively with UUID:
# UUID=ACB9-797F   /media/c   vfat   user,fmask=0111,dmask=0000   0   0

  # test to mount:
$ sudo mount /media/c

There it is, read/write! For NTFS (WINDOWS NT filesystem) I have

/dev/hda1   /media/c   ntfs-3g   rw,exec,fmask=0003,dmask=0000,gid=1000   0   0
  # my group-id is 1000 on that machine

Ubuntu recommends this:

UUID=WHATEVERUIDITHAS  /media/windisk  ntfs-3g  defaults,windows_names,locale=en_US.utf8  0 0

Next step will be to install Java. This raises me to a further abstraction level:

  • Java applications run (and can be developed) on any platform
  • Java provides also user interfaces (AWT, SWT, Swing, JavaFX)

After some troubles with the recommended way to install Java/Oracle on Debian via apt (this just resulted in a "oracle-java8-installer not found"), I simply downloaded the JDK from the Oracle page. You just have to put its install directory into an OS environment variable called "JAVA_HOME", and put $JAVA_HOME/bin into your OS execution PATH, then you can call any Java application.
Is Java not "free enough" for Debian? Did you notice that Debian meanwhile also contains "proprietary" software? The newest purist is gNewSense LINUX ...

From NetBeans I got a shell script file, with chmod 754 netbeans-8.0.2-javaee-linux.sh I made it executable, and then started it by typing ./netbeans-8.0.2-javaee-linux.sh. A graphical installer starts up.

If you prefer desktop icons, you can activate them in Debian with dconf-editor. Start that tool and go to org - gnome - desktop - background, click on "Show desktop icons" there. Then go to org - gnome - nautilus - desktop and switch off the hard drives that you don't want to see as icons. You should see the NetBeans icon on the desktop. To add new icons, simply copy one of the files in $HOME/Desktop (German $HOME/Arbeitsfläche) and edit it either with gedit or by calling its properties by right-mouse-click popup menu.

Today, back on the floor, I must admit that this is an endless workaround. No hope for skype. I tried every workaround recommended on any forum, all I get from skype 4.3.0.37 is "Aborted". Don't mess around with sqlite3, this tool is not up-to-date on Debian 7.7.0, and even when you manage to get the most recent version up-and-running on your machine, the UPDATE statements to be found on the internet won't help.

Being fed up with bad German error message translations and thus changing the locale to English brings even more problems. The partitioning tool "gparted" does not start, complaining with

what: locale::facet::_S_create_c_locale name not valid

After trying out all forum solutions in vain (my Debian doesn't know a software called dpkg-reconfigure, not even apt-get knows it) I found the following workaround:

sudo gedit /usr/sbin/gparted

  # add the line 
export LC_ALL=C
  # somewhere before
BASE_CMD="/usr/sbin/gpartedbin $*"'

Summary

So what to resume now? This computer won't be a substitute for a fast and reliable machine like I would need. On the other side I got an up-to-date view to the internet now, which the old WINDOWS-XP could not provide (Firefox 3.6 was the highest I could get for WINDOWS-XP SP-1).

But I learnt some things that might stand in the shadow of all the things mentioned until now:

  • the real asset of computers is the internet
  • internet technology is improving continually, and thus forces us to upgrade our tools (e.g. since a week my Ubuntu 12.04 shows me, instead of a video-player, a message that my player is not supported any more!)
  • when we upgrade our browsers, we also must upgrade our operating systems, at least from time to time
  • operating systems expire, see WINDOWS-XP, and Ubuntu "Long Term Support" (LTS) has turned out to be 3 years!
  • new operating systems are tailored for new hardware
  • at some point, upgrading operating systems is possible with new hardware only
  • conclusion: investment in good hardware is not a good investment, because it will be outdated by technology before it actually has aged - here it is again, the "Story of Stuff", which goes hand in hand with disregard of quality.

It is a surfing life. Either you ride the wave, or you stay behind. The animation hype has become an enforcement. Are we expected to nod in agreement?