Direkt zum Hauptbereich

How to boot openSuSE 12.2 from SD Card

My old Asus EeePC was collecting dust since its display backlight driver chip got broken in August 2012. Now, for a project at the university its second life seems to be come. Unfortunately I disassembled its RAM memory and the HDD. Whilst it was no problem to assemble the built-off RAM again, the HDD was already built-in into an external HDD enclosure for a use as backup drive. I din't want to disassemble it again, so what should I do to get my EeePC running again...? The solution was pretty simple: with an SD Card.
But why after all using an SD Card, when an USB flash drive would be more common? The answer is pretty simple. An SD Card can be put into the reader in the EeePC and is covered completely. So its mechanically robust against collisions and cannot be torn off accidentally nor removed. And at least: why not using an SD card?

So greenly I bought an SDHC card, inserted it into the EeePC and created a bootable USB flash drive with openSuSE 12.2. An old flat screen, connected to the VGA port replaced the (already removed) display. The WiFi antenna was just a wire any more. But... it worked. I was able to install openSuSE without any (greater) problems. I just needed some more attention to create the right partitioning with GPartEd. The tricky issue was to not-select the USB flash drive as installation drive - just the SD card.
A much greater problem seemed to set the correct device for booting from. On several internet blogs you can read similar posts handling the installation of SuSE and other Linux distributions on SD cards, telling that the only problem is the boot loader. However, it isn't as easy. But finally, when SuSE tried to create a boot loader at the MBR (in my case sdb), the installation programm reports some errors. You can ignore then, but SuSE can't... so how to proceed?

The installation will end any way - somehow successfully like it appears. But when trying to boot just with the SD Card, you get only a rescue console with much luck. But why? The same installation performed on a flash drive will boot and run without any problems. There is no significant difference in the used media - except the digital right management of an SD Card. And this is the problem. SD cards in most cases are pre-formatted with an MBR and a basic partitioning matching the requirements of most SD card devices like digital cameras etc. and even formatting the card with Linux or Windows won't create a partitioning that will be albe to boot Linux properly. So first i stuck in that misery. Also deleting already present partitions on th card with Windows Disk Management console leads not to success. I tried several ways and performed also many installations without success.
Now it was at the time to be smart. When a USB flash drive of ~8 GB will boot and an SD card of the same size does not, it may be possible to clone the flash drive to the card. Linux and Unix contains the tool dd (DiskDump) for copying a drive one-to-one to another drive (or file). So i took the Live Stick again and cloned the flash drive with the properly installed openSuSE system and cloned it to the SD card. The I booted the EeePC with that card and came only to a rescue console...

Investigating the boot option entries with that rescue console showed the reason. The configuration was set to boot GRUB2 from a special device, identified by the device's UUID. The UUID of the SD card was another one than those of the flash drive. It was easy to recognize beacause the manufacturer name of the flash drive was contained in the UUID. But the rescue console didnt make me able to fix the problem with it. So what to do? I decided to use the USB Flash drive again to fix it (what meant to clone the drive again to the SDHC card).

So openSUSE 12.2 uses Grub2 as bootloader. Investigations revealed that there is a special config file,
/etc/default/grub
that need to be changed to fix this problem. Listening to the openSUSE home page the legend tells that you just need to modify the line GRUB_CMDLINE_LINUX_DEFAULT. But if it is that easy, why they don't use it as default configuration? However, I changed that line from
GRUB_CMDLINE_LINUX_DEFAULT=" resume=/dev/disk/by-id/usb-Kingston_DT_101_G2_001CC0C83B35EA90142A0042-0:0-part1 splash=silent quiet showopts"
to
GRUB_CMDLINE_LINUX_DEFAULT=" resume=/dev/sda1 splash=silent quiet showopts"
Comparing this two screenshots you can see that there is clearly the device UUID with the manufacturer of the flash drive in the picture above. I'm still investigating WHY GRUB2 uses UUIDs. Nobody mirroring a system does ever want issues like these.

After this the legend continues, telling that it is neccessary to "grub2-mkconfig -o /boot/grub2/grub.cfg to update the main configuration file." So I ran the command and tried to reboot - considering the boot options and checking the bootloader menu entried. The device had changed. Also the system did boot regularly. After all i cloned the flash drive again to the SDHC card and tried to boot from it - successfully. The problem was solved.

After all I unfortunately discovered that fixing the boot issues was the least problem. :( Meanwhile Linux is celebrating its 20th birthday but I still desperate on configuring it. There are the same weaknesses like ten years before. For instance try to configure a connection script for using the WiFi connection in runlevel 3. I get mad trying to connect with the command iwconfig or wpa_supplicant. In runlevel 5 the "Connection Manager" takes control instead of using Yast2 - why? And again there are three half-ready solutions for one problem, competing against each other and yo rather get mad than finding an easy or common way in a froum to get your problem solved. And just like ten years before you are investigating forum and you find ten different answers (each one ist the best). Finally it seemed that I got mad because I'm still using Linux (Windows 7 didnt make any trouble during installation and after). Why didnt I stick at Windows 7? I simply must have become crazy.

Kommentare

Beliebte Posts aus diesem Blog

Pi And More 11 - QMC5883 Magnetic Field Sensor Class

A little aside from the analytical topics of this blog, I also was occupied with a little ubiquitous computing project. It was about machine learning with a magnetic field sensor, the QMC5883. In the Arduino module GY-271, usually the chip HMC5883 is equipped. Unfortunately, in cheap modules from china, another chip is used: the QMC5883. And, as a matter of course, the software library used for the HMC5883 does not work with the QMC version, because the I2C adress and the usage is a little bit different. Another problem to me was, that I  didn't find any proper working source codes for that little magnetic field device, and so I had to debug a source code I found for Arduino at Github  (thanks to dthain ). Unfortunately it didn't work properly at this time, and to change it for the Raspberry Pi into Python. Below you can find the "driver" module for the GY-271 with the QMC5883 chip. Sorry for the bad documentation, but at least it will work on a Raspberry Pi 3. ...

How to use TOracleConnection under Lazarus for Win64

Lazarus Programmers have had no possibility to use TOracleConnection under 64 Bit Windows and Lazarus for years. Even if you tried to use the TOracleConnection with a correctly configured Oracle 11g client, you were not able to connect to the Oracle Database. The error message was always: ORA-12154: TNS:could not resolve the connect identifier specified Today I found a simple workaround to fix this problem. It seems like the OCI.DLL from Oracle Client 11g2 is buggy. All my attempts to find identify the error ended here. I could exclude problems with the TNS systems in Oracle - or the Free Pascal file oracleconnection.pp though the error messages suggestes those problems. After investigating the function calls with Process Monitor (Procmon) I found out, that even the file TNSNAMES.ORA was found and read correctly by the Lazarus Test applictaion. So trouble with files not found or wrong Registry keys could also be eliminated. Finally I installed the Oracle Instant Client 12.1c - aft...

Lazarus IDE and TOracleConnection - A How-To

Free programming IDEs are a great benefit for everybody who's interested in Programming and for little but ambitious companies. One of these free IDEs is the Lazarus IDE . It's a "clone" of the Delphi IDE by Embarcadero (originally by Borland). But actually Lazarus is much more than a clone: Using the Free Pascal-Compiler , it was platform-independent and cross-compiling since it was started. I am using Lazarus very often - especially for building GUIs easily because Java is still Stone-Age when a GUI is required (though there is a couple of GUI-building tools - they all are much less performant than Delphi / Lazarus). In defiance of all benefits of Lazarus there still is one Problem. Not all Components are designed for use on a 64 bit systems. Considering that 64 bit CPUs are common in ordinary PCs since at least 2008, this is very anpleasant. One of the components which will not be available on 64 bit installations is the TOracleConnection of Lazarus' SQLDB ...