Blog-Archiv

Samstag, 24. Januar 2015

Many LINUX on board

It is time to resume and then return to more productive work.
Looking at the work of others is not very productive. But sometimes you need that, to get a more realistic view of your own work. Which is what I did during the last weeks, with my eye on the LINUX operating system and its many variants (look at the impressive distribution graphic on Wikipedia).

I am writing this Blog article on an Arch LINUX called Manjaro. This Kilimanjaro gives me a Firefox 33.1.1 browser to edit the internet. This is the now the sixth operating system I have on my laptop. I'll end up with a different LINUX for every day of the week :-)

(I'm gonna stop installing further LINUX now, it's getting an addiction when you have a modern GPT hard-disk with a tera-byte space. One LINUX can live with 12 GB, and a GPT disk provides up to 128 primary partitions. So I could have nearly 100 LINUX on it :-)

To look at LINUX is to look at informatics history. UNIX existed before WINDOWS, and had a graphical user interface before WINDOWS (and MAC). But UNIX always was restricted to university- and industry-environments, until LINUX appeared in mid of the nineties. This was the UNIX for the personal computers, supported by an internet-oriented developer community around the world that competed with giants like Microsoft for controlling PC hardware. All efforts to get rid of them failed (and there were many, and some still try, see MFT at end of partition). Their basic idea was

"It is my hardware, not Microsoft's"

Which is right, isn't it?

The look at LINUX is also a look at the success of human collaboration. The community is programming LINUX mostly in C, shell and Python. Hardly a modern object-oriented language found its way to them (except C# as I recently found out on OpenHub). Listen to Linus Torwald's "Java, what a horrible language" statement on YouTube.

But do not try this (watching a video in web browser) on an Arch LINUX or Debian, because Adobe Flashplayer is not available there. These LINUX contain free software only. You can install Flashplayer by yourself. If you can. And this is where the LINUX problems start. Because human collaboration depends on the ability to communicate even with non-expert users. Internet forums are full of good and bad instructions how to solve this or that. It takes a lot of time to find the good ones, and then to understand them.

Being convinced by the Java idea of no more having to write platform-specific software any more, I really missed what is going on upon these platforms. LINUX has become incredibly strong also on desktop computers. It is a trend maker concerning UI controls. There are concepts to impress users by 3-dimensional effects like the compiz desktop manager provides e.g. in its "rotating desktop cube". Innovation nowadays happens not just at big companies like Microsoft, Apple and Google.


LINUX Tribes

  • Debian
    • Ubuntu
      • Mint
      • Zorin
      • Elementary
      • Linux Light
      • ....
  • Arch
    • Manjaro
    • ....
  • Gentoo
    • Sabayon
  • Red Hat
    • Fedora
    • Mandriva
    • CentOS
  • Slackware
    • OpenSuse
  • Puppy
  • ....

I have arranged them here by importance from my personal point of view. Of course this list is much longer, see Wikipedia for more details.

The most user-friendly and thus popular system is Ubuntu and its children. Their mother Debian is not nice. Even Linus Torvalds says that Debian is hard to install. The more amazing is that Ubuntu is based on Debian. But even if the Debian installer has become better, you won't be satisfied with that system, because multimedia sucks: videos crash, sound does not work.

Ubuntu

All Ubuntu variants have the same nice install procedure which is quite easy to use. As it is mostly run from a Live-CD, you have a fully featured operating system with internet connection and web browser under your fingers. Any occurring install problem can be solved by searching the internet.

But be aware that it will encourage you to erase any other operating system on your machine when it comes to partitioning. Always go to "Manual Partitioning" when installing a LINUX! This is not an Ubuntu characteristic, all other LINUX do the same.

Arch

Arch is a very basic LINUX. Pure Arch is for people who like to do it by themselves, or would like to develop their own LINUX. Meanwhile it tends to become what Debian is for Ubuntu, it is available also with desktop managers, see Antergos or Manjaro.

Gentoo

Gentoo is like Arch, except that it compiles a kernel customized for local hardware when installing it. Some already have tamed this and let us use their desktop environment. Like Arch, Gentoo is not a Debian.

Others

Some might stay on the way. Fedora tries its best to prevail, but will not with that installer. Slackware always was infamous, even among LINUX experts. These old LINUX are for the users that already know them.


Several LINUX on a GPT disk



My boot menu

How did I prepare my laptop for so many operating systems? Not at all, except that I convinced the always-preinstalled Windows 8.1 via its own partition editor to give me back 500 GB. But in review there is something to say.

It would have been nice to have a dedicated grub boot loader partition that exists independently of all installed LINUX. But I did not find a good manual on the internet about how to do this for grub 2 (1.97 and newer).

So I have the boot loader and its configuration for all installed LINUX on my Ubuntu. That means I

  • install a new LINUX without installing its boot loader (if this is not possible, I do not install it)
  • on reboot, after installation, I start the Ubuntu
  • in a super-user shell I launch update-grub, this detects the newly installed LINUX and puts it into the boot loader menu
  • I reboot again and now choose the newly installed LINUX
  • when it is not able to boot, I remove its bootloader menu entry and its partition using Ubuntu

The GNU partition editor is available on nearly every LINUX meanwhile.
Following screenshot shows how gparted renders the partitions of my hard-disk. Each LINUX installation take just 4-6 GiB space. I gave them 18-25 GB each to grow old. The completely new installed WINDOWS on /dev/sda5 takes 53 GiB without having been used at all, and 4 more partitions.

I use WINDOWS only to test Java applications. But the 462 GiB free space will not be lost. Every modern LINUX can read and write NTFS file-systems (although it took many years to achieve that). So I

  • have a /etc/fstab entry (see below) for the WINDOWS partition on each LINUX, mounting that file-system on boot
  • hold all my /home data on that partition (pictures, music, documents, ...)
  • and thus can see the data from all my LINUX installations in the same way

/etc/fstab

# <file system>   <mount point>   <type>   <options>   <dump>   <pass>
#
# / was on /dev/sda10 during installation
UUID=e6606afe-96d5-4a4b-8f40-bdb5c2e98e51  /  ext4  errors=remount-ro  0  1
#
# /boot/efi was on /dev/sda1 during installation
UUID=50FD-01D8  /boot/efi  vfat  defaults  0  1
#
# swap was on /dev/sda7 during installation
UUID=e3828083-e6a6-480a-abf6-46740a78c19f  none  swap  sw  0  0
#
# manually added WINDOWS disk
UUID=72025F23025EEC1B /media/windisk  ntfs-3g  defaults,windows_names,locale=en_US.utf8  0  0

None of the LINUX that I installed can live with UEFI secure boot mode except the Ubuntu editions. Debian and Manjaro (Arch) do not boot when I switch to that mode.

What LINUX installers need to learn

  • an installer is a Wizard and thus needs to show all pending and done steps in a left-side list
  • EFI partitions should be recognized automatically and re-used by default
  • any click of a user must be answered by a progress indicator that stops as soon as the action was done (partitioning, formatting, copying, ...) - this is for the user to early recognize frozen systems
  • already existing user data in /home or /usr/shared should be preserved, e.g. by offering to keep the existing file system type (or upgrade it?)



Personal experiences with LINUX systems

I never used WINDOWS a lot. Always had a dual boot computer with LINUX as default. I did a lot of shell script programming back in the nineties, trying to automate my work continually. And then Java appeared.

Nonetheless this is about LINUX. Here come my short stories.

Suse

Suse means "Software und System Entwicklung", which was the name of the German company that developed the so-called system in Nürnberg. This was my first LINUX in 1997. I had been working on UNIX systems before since 1990.

I remember meditating over so called "mode lines" to get my screen resolution working. And a thick manual because I didn't yet have an internet connection. And a recursively looping install routine that always prompted me again to choose the software to install. And that the Suse directory structure was somewhat different from that of other LINUX.

I stopped using Suse when Ubuntu appeared. Life became significantly easier since then. It is still available as OpenSuse. I did not find an ISO image, but when you are able to find out how to configure their FTP server you might succeed in installing OpenSuse. KDE goes back to Suse, and compiz desktop manager was developed by Novell that bought Suse.

Ubuntu

I use Ubuntu since 2007 (Dapper Drake, 6.06). Some versions of it have died because I never upgraded it and started to use other computers meanwhile. But I never had reason to complain. I also have it on my netbook, currently wondering whether I could upgrade that to 14.04.

There is still one major design flaw in LINUX. I never lost my data when repairing a WINDOWS installation, or installing a new one. But installing a new LINUX always means also losing your data and configurations.

The following screenshot shows the Ubuntu/Unity dialog where you can switch off the touchpad while typing, and switch off tapping as click (System/Settings):

Mint

This is my favorite. Being an Ubuntu, it is the most popular LINUX on this planet. Everything is where I expect it. I immediately find every tool I need. I can resize the main menu when lists get big. It has beautiful graphics. Windows behave nicely. No slowing down animations. Really a well usable operating system. Java preinstalled. Thank you!

The following screenshot shows the Mint/Xfce dialog where you can switch off the touchpad while typing, and switch off tapping as click:

Zorin

An Ubuntu that uses compiz and a lot of its effects. Windows are hopping and flying away. Music and video worked, like in every Ubuntu, without extra hours. Zorin comes with Google-Chrome as default browser, without Firefox. This is somehow unusual, because Firefox is the standard LINUX browser.

Debian

Installed this just because I wanted to see the difference to Ubuntu. Graphically not so bad (Gnome). A browser named "Ice Weasel", video did not work. Spent an hour searching for solution, but did not succeed in installing Flashplayer. Or maybe succeeded, but there was no sound. Spent another hour just for getting sound, did not succeed.

The worst LINUX installer I have ever seen was the Debian installer back in the nineties. I think it was called dinst. If it is still the same today I wonder how I got around it.

Fedora

This already was my second attempt with Fedora. Started the Live-CD and pressed "Install to hard disk". Confused me again with its strange way to plan partitions, calling them LVM (logical volumes). This is a GPT disk, Sir. It showed me existing partitions, but not the free space I could use, and where it is. After I had created a partition for it, it did not show me where that partition will be. The system always gave me the impression that I need not to know about anything, like "Let me do it and you will be happy", which is a no-go with LINUX.

Finally I started to read the help, because I did not trust that system. I rebooted to check whether it already had wasted my disk. Started again, but there simply was not enough information on that installer screen to make me sure that it won't destroy anything. And always that "Done" button without knowing what would be done then. Clicking something and getting no response for many seconds. I aborted the installation. Let experts eat experts. This LINUX will have to implement an installation program to survive. I never had a problem working with the fdisk commandline partitioner, but this installer is nearly as bad as dinst.

Arch

The downloaded ISO image has just 587 MiB. Starting the installer shows a console root prompt, nothing else, no graphic user interface, no curses application, nothing. I started to read the help file in current directory and decided to not reinvent the wheel, because that information was not detailed enough for a successful installation. I would have needed a lot of additional instructions.

Manjaro

First installation I canceled because I thought it would not let me partition the disk for it. Then I saw in a video that the partition editor comes up only after time-zone choice. Started again and was stuck when it refused to go on due to a missing EFI partition. I created one for it, but then found out that I could have reused the WINDOWS EFI partition (which it did not show me as EFI partition). I deleted the created EFI partition in Ubuntu, which then led to a hanging Manjaro boot. I installed it once more, now referencing the already existing EFI partition. Worked nice then, no complications, very similar to the Ubuntu installer. Why do they all need to know the EFI partition?

The user interface has everything a modern LINUX desktop needs (I chose the Xfce variant). The only problem occurring was the dimming of the screen during boot. This seems to be a quite popular bug on laptops. Something dims the screen while LINUX boots, and brightness is never restored again, so that you find yourself sitting before a quite dark UI. There is a tool called xbacklight on Arch that you can use when there is nothing on your keyboard that brings back the screen brightness. On my laptop it was the F12 key that again enlightened Manjaro. There also was a fix instruction on some Arch forum, but that did not work.


When you work with low-level LINUX systems like Arch you are automatically drawn into operating system problems. For example a boot message appears saying "root device is not configured for boot" or similar, and immediately disappears again, and you want to know what it was about. You end up following several instructions how to avoid disappearing boot messages that all do not work.

For example I dared to change to a "virtual terminal" via Alt-Ctl-F4. Normally there should be 6 terminal screens available via Alt-Ctl-F1 up to Alt-Ctl-F6, but on Arch there is only one on Alt-Ctl-F4. So there was my terminal screen, but the boot messages were not there, just a login prompt. Now I was not able to get back to the graphical user interface any more by pressing Alt-Ctl-F7, which is the standard key for such. I had to log-in and make a shutdown -r now. Up again I googled for a solution and found the command chvt N ("Change to Virtual Terminal N" I guess). But this works only when you are logged in. And applying it with numbers like 6 took me to an empty screen where I could not input any new command. Etc etc ....



Montag, 12. Januar 2015

Installing LINUX on a DELL laptop besides WINDOWS 8.1


Target was: have the best of both worlds (WINDOWS and LINUX :-)
Subject was: Inspiron 15 laptop with an Intel I5 64-bit processor, 8 GB RAM and 1 TB disk
Operating systems involved: WINDOWS 8.1, LINUX Ubuntu 14.04.1
Hardware information received from retailer: none
Internet information about the laptop's LINUX compatibility: none
Strategy: (1) read, (2) think, (3) decide, (4) click :-)
Needed for: preserving WINDOWS during a LINUX installation

Requisites

  • 2 USB sticks (one at least 1 GB, one at least 512 MB), formatted preferably by WINDOWS, as rescue devices for both operating systems
  • internet connection
  • a downloaded ISO image of the latest Ubuntu 14.04 amd64 ISO image, available on releases.ubuntu.com (best use BitTorrent to download it)
  • UNetbootin for writing the LINUX ISO image to an USB stick
  • lots of time to read, think, decide and click :-)

Here is a very helpful link to Ubuntu-Help.

Fast Success

Here is a way to get LINUX installed on hard-disk without having to repair WINDOWS. Mind that this is not guaranteed to also work on your computer!
What did I do? I ...

  1. logged into WINDOWS

  2. went to "Computer Management" - "Disks" in system control panel and tried to shrink the big WINDOWS partition, it let me take away 470 of 980 GB

  3. used UNetbootin to download the LINUX Ubuntu 14.04.1 amd64 "Live" ISO image (to drive LINUX without installing it) and wrote it to the prepared USB stick (the image requires 1 GB).
    Warning: after the grub LINUX boot loader had been installed successfully, I had problems to use UNetbootin one more time to install another LINUX. After running it and rebooting, Windows reported an unsafe state and requested a repair disk. It was not possible to get to the UNetbootin boot menu. So I gave up installing from WINDOWS filesystem and used an USB stick after.

  4. created a WINDOWS repair utility on another USB stick with at least 512 MB for the case that things might go wrong

  5. inserted the LINUX USB stick, because boot order can be set to prefer the stick only when it was inserted before switching on the computer, else the BIOS won't see the stick

  6. rebooted

  7. pressed F2 on computer startup to get into UEFI (Unified Extensible Firmware Interface) setup, this is now what once was called BIOS

  8. did NOT use the Legacy Mode here, and thus hopefully avoided grub surprises

  9. disabled "Fast Boot", else the stick wasn't detected

  10. "Secure Boot" was enabled (this is default)

  11. changed the boot order to first check for USB (which was listed by its product label), did not do anything else on any other page of the UEFI setup


  12. pressed F-10 to save and reboot (they call it "reset", quite misleading)

  13. Ubuntu showed its boot menu, selected default (run it)

  14. clicked on "Install Ubuntu" icon on Ubuntu desktop

  15. after choosing language and more the partitioning showed up, I chose doing "Something else" than erase all existing operating systems :-)


  16. created a swap partition of 16 GB (twice the memory), as primary partition, because this was a GPT disk management (see below) and thus I can have up to 128 primary partitions

  17. created a "/" root partition of 25 GB with an ext4 LINUX file system, also of type primary

  18. clicked on "Install", and off it went without safety questions

  19. clicked OK to reboot with removed USB stick

And there it was, a nice grub 2 boot menu let me drive both WINDOWS and LINUX (to be sure I tested both :-)

Because you install from a fully-featured "Live" LINUX you can even search the internet for answers when problems occur during installation. This makes it really easy. The only bottleneck is the work to be done in UEFI / BIOS (no internet available).


Worthwhile to know

How to boot from USB?

Be sure that the USB stick is inserted BEFORE switching on the computer!

For this DELL laptop, F2 is to get to the UEFI setup screen (BIOS), and F12 calls an UEFI boot menu, both available during laptop hardware startup. I needed a lot of time to find out the correct UEFI / BIOS configuration for booting from USB. I had switched to "Legacy Mode", because in default UEFI mode the USB was not listed, but this was a mistake. I had set up the boot device order, but the computer ignored the USB stick and and even the hard-disk (Windows Bootmanager) and went into a network boot device search. The USB was listed here as "hard drive", selecting it brought the UNetbootin menu. After I had switched back to UEFI, the USB finally was listed with its product label (still not as USB). And now it respected the boot order I defined. The problem was that I thought I can define USB as first boot device without having the stick inserted!

MBR or GPT?

How to know whether a disk is managed by MBR (Master Boot Record) or GPT (GUUID partition table)? With a GPT you can have up to 128 primary partitions, with MBR only 4. Plays a role when creating partitions on LINUX install.

Launch cmd.exe (WINDOWS) and enter

C:\> diskpart

DISKPART> LIST DISK

Disk ### Status  Size     Free    Dyn Gpt
-------- ------- -------- ------- --- ---
Disk 0   Online     75 GB     0 B       

DISKPART> exit
This is a MBR managed disk. If it was of type GPT, this would have looked like
Disk ### Status  Size     Free    Dyn Gpt
-------- ------- -------- ------- --- ---
Disk 0   Online     75 GB     0 B      *

MFT at end of partition?

Shrinking the WINDOWS partition is said to be kind of impossible when the invisible MFT (Master File Table) has been put to the end of the partition, so that you can not shrink it. You will know about that when you try to shrink the partition in WINDOWS Computer Management disk utility. If it offers zero bytes, you will need a lot of magic.

Is "amd64" for AMD processors only?

The acronym "amd64" means 64 bit, it is not a restriction to AMD processors. It is just a naming convenience because AMD first built such processors. You can apply any amd64 LINUX ISO image also to an Intel PC when it is 64-bit.

No more WINDOWS rescue DVD

I prepared an empty read/writeable DVD which turned out to be dispensable, because WINDOWS 8.1 does not support rescue DVD anymore, only USB stick! It wants 16 GB for a full image backup, and for a small rescue device it wants 512 MB.

Can not write to DVD

When you insert a read-write DVD into an Windows operating system, it will ask you to format the medium. When you click "Yes", you got a file system on your DVD. When you then boot LINUX and want to "burn" an ISO image to that DVD, the burning utility (e.g. Brasero) will tell you that the disk is full. It looks like you can not burn data to a DVD after Windows formatted it. But this is wrong (at least for LINUX). What you need to do is un-mount the DVD. Sounds absurd, but it works. Most LINUX automatically mount a DVD when they detect its insertion. Find out the DVD's mount point and its device. Open a terminal and type (the $ is the terminal's prompt symbol)

$ df
Filesystem     1K-blocks     Used Available Use% Mounted on
/dev/sda8       24476036  5009848  18199808  22% /
none                   4        0         4   0% /sys/fs/cgroup
udev             4028680        4   4028676   1% /dev
tmpfs             807896     1196    806700   1% /run
none                5120        0      5120   0% /run/lock
none             4039472       80   4039392   1% /run/shm
none              102400       52    102348   1% /run/user
/dev/sda5      484461564 49290276 435171288  11% /media/windisk
/dev/sda1         507904    55720    452184  11% /boot/efi
/dev/sdb1        7812864     9600   7803264   1% /media/fridell/20A6-2E72
/dev/sr0         4589632  4589632         0 100% /media/fridell/UDF Volume

Here the DVD device is /dev/sr0 and its mount point is /media/fridell/UDF Volume. ( /dev/sdb1 is an USB stick.) Now launch

umount "/media/fridell/UDF Volume"

Please notice the "quotes" to mask the space in the directory name! Restart the DVD burning software, it should offer "burning" to the DVD now.

USB sticks containing ISO images

Mind that once after having written an ISO image to an USB stick, you can not repeat this process with UNetbootin before having formatted the USB stick again. UNetbootin will not report an error, but it won't write anything to the stick in that case!

Gparted cylinder aligning

Heard about gparted (a nice LINUX partition editor) and the obligation to uncheck its 'round to cylinders' checkbox when working on WINDOWS partitions, see Ubuntu-Help.

Installer complains about missing "Reserved BIOS boot area"

After partitioning a dialog comes up saying

The partition table in use on your disk normally requires you to create a separate partition for boot loader code. ...

This seems to be due to having booted in BIOS "Legacy Mode". Read this.

Windows disk not accessible from LINUX

When you shut down Windows, it hibernates itself by default, except when you explicitly choose the "Shut down" menu item. When you then boot LINUX, and you have a mount-line in /etc/fstab for the Windows-disk, you might be prompted to skip this mount, or do it read-only, this happens while booting. This prompt looks like the OS can not start up. It can be avoided by turning off the Windows "Fast Startup" option:

  • log into Windows as administrator
  • open the Control Panel and click "Power Options" (energy settings)
  • click the "Choose what the power buttons do" link on the left side
  • although you are administrator you must click the "Change settings that are currently unavailable" link now
  • all checkboxes should be enabled, you can disable "Turn on fast startup" checkbox in the lower part of the UI
  • do not forget to save the settings
This setting is also available in regedit.exe (Windows Registry editor) under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Power.

Beautiful boot

Start an editor as superuser (sudo gedit) and load /etc/defaults/grub. Comment out / in following lines:

# GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

GRUB_TERMINAL=console

Save, and then launch sudo update-grub in a terminal.
Now you will have a nice centered console boot menu without graphics, and you will see LINUX outputs during startup and shutdown :-)

Start without login (unsafe!)

If you want to avoid the login screen to require your password, you can do this in both operating systems. Do this only when your computer is safe against any threats. In LINUX you can do this in

"System Settings" -> "User Accounts", check the box for "Auto login".

You will have to enter the superuser password to be able to change that setting.

In WINDOWS you must use a cmd.exe terminal and input

netplwiz

There you have a checkbox to deactivate the login screen. You will have to enter your password when switching it off.

Restore boot loader after installing another LINUX

After I had installed a second LINUX (Debian), the boot loader of the new LINUX had taken over the boot menu. It contained all necessary entries to boot the two other operating systems, but I wanted to use Ubuntu's grub.

In the computer's UEFI setup all three operating systems were visible as bootable devices: "ubuntu", "debian", "Windows boot manager". So I could simply set the boot order to prefer Ubuntu, which caused the Ubuntu boot menu to show up again.

But this did not contain the new Debian. To refresh it, all I had to do (in Ubuntu) was

sudo update-grub

After that the new Debian LINUX was in the boot menu of the Ubuntu boot loader. Mind that Debian 7.8.0 can not start up in UEFI's SECURE BOOT mode, but Ubuntu 14.04 can.

After having installed a third LINUX (Mint), there was no new bootable device visible in UEFI setup. Mint had taken over the "ubuntu" UEFI entry (Mint is an Ubuntu). Any LINUX boot menu can be restored using

sudo update-grub   # reconfigures boot menu, searching for new bootable partitions
sudo grub-install  # copies boot loader files to boot partition

This is what I did to reactivate Ubuntu's boot menu, working from Ubuntu.

The internet recommends to prepare a separate boot loader partition in case there are more than one LINUX present on a machine. But I did not find a manual about how to install such using grub 2 (only for grub 1). Why would I need this: when having a lot of different operating systems on a machine, you might forget which one contains the boot menu.

Editing grub boot menu

What's in the the grub 2 boot menu is in /boot/grub/grub.cfg (no more in menu.lst like it was with grub 1). But this is some kind of script now, and thus far more complicated to edit than menu.lst was. Be very careful! You need no update-grub after.

Be aware that your changes will disappear on next update-grub call, because /boot/grub/grub.cfg is a generated file. Alternatively you can try to understand what is going on in /etc/grub.d/, there is a README ...

I don't know whether this is worthwhile to know or just an absurd detail: grub 1.97 is already grub 2, grub 1.96 is grub 1. Maybe we need personalized versioning mappings per developers ...






Who do we think we are?

First booting the laptop, directly after having bought it, launched a program that explained me that this operating system is not mine but just borrowed. If I cooperated, I would be allowed to use it. Cooperating means something like letting that OS vendor look at my living room through the computer's camera. This program forced me, by required input, to create an outlook or hotmail account. It also asked for my full name, sex, age and phone number, all required inputs. On the next page it asked me to repeat the 4 trailing numbers of my phone number. There was no "Back" button :-)
I mean, this all happened before any operating system (with closable windows) came in sight!



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?