Asus Eee 1101HA hangs

I have just bought an Asus Eee 1101HA and (after compiling a custom kernel with the correct drivers) it is working almost perfectly. Sometimes the whole system just hung and after a keypress the hung had gone and it was OK for a while until the next hang…

This had been happening in console and under X too. I thought it might be a kernel-related issue, some kind of a timer or interrupt problem, maybe timeout.

All in all this turned out to be an APIC problem, and the machine is working perfectly with a noapic boot parameter.

Posted in: Uncategorized by kakaopor No Comments , , , ,

LVM boot issue on Debian Linux with initramfs-tools

Although the format /dev/[vg_name]/[lv_name] format is easier to read when you got plenty of VGs (compared to /dev/mapper/[vg_name]-[lv_name]), it won’t work at boot.

This is the few lines of default initramfs script which is responsible for the behaviour described above:

/usr/share/initramfs-tools/scripts/local-top, from line 40:

# Make sure that we have a d-m path
vg=${vg#/dev/mapper/}
if [ "$vg" = "$1" ]; then
    return 1
fi

And it wouldn’t be enough to remove this check, because there is an another one for the format:

# Make sure that the device includes at least one dash
if [ "$(echo -n "$vg" | tr -d -)" = "$vg" ]; then
    return 1
fi

So you have to use the /dev/mapper/[vg_name]-[lv_name] format in GRUB’s menu.lst (or LILO’s lilo.conf) to boot from an LVM device. Unless you change the script above, of course :)

Posted in: Uncategorized by kakaopor No Comments , ,

5853:0001 XEN device

5853:0001 is a XEN HVM virtual SCSI adapter.

Source: https://code.ticketmaster.com/trac/browser/spine/trunk/lib/Spine/Plugin/SystemInfo.pm?rev=123#L225

Posted in: Uncategorized by kakaopor No Comments , ,

ORA-19502, ORA-27072 during RMAN restore (Oracle)

I was trying to load database from an RMAN backup (duplicate database until …), and the restore process died after some time, and gave me the following error messages (I have tried it several times, with different backups, these repeated randomly):

ORA-19502: write error on file "/path/to/datafile.dbf", blockno 1669073 (blocksize=8192)
ORA-27072: File I/O error
Linux Error: 2: No such file or directory

ORA-19502: write error on file "/path/to/datafile.dbf", blockno 1831475 (blocksize=8192)
ORA-27072: File I/O error
Linux Error: 13: Permission denied

Long story short, these messages are exotic forms of the boring “Out of disk space” message.

And even if you have enough space for the restore, you may need ~+20% spare space. Don’t know exactly why, but that was needed in my case.

Oracle loves disk space and strange messages – lesson learned.

Posted in: Uncategorized by kakaopor No Comments , ,

Bootsplash patch for Linux kernel 2.6.32

Although the Bootsplash has been superseded by Splashy many of us liked Bootsplash. I was unable to find a patch for 2.6.32, so I made one from the patch for 2.6.30.

http://dev.kakaopor.hu/stuffs/bootsplash-3.1.6a-2.6.32.diff

Posted in: Uncategorized by kakaopor 3 Comments , , ,

PHP4 and PHP5 per VirtualHost on the same Apache 2 webserver

I assume you have a working Apache 2 installation with PHP4 modules installed, if not run the following and you will have:


sudo apt-get install apache2 apache2-mod-php4

Note: you can also have PHP5 installed as module and PHP4 as CGI, everything works the same way with swapping the versions in commands.

First of all you will need the php5-cgi package, and enable the Actions module:


sudo apt-get install php5-cgi
a2enmod actions

Add a ScriptAlias directive to your apache2.conf - if you have not done this already - like this:


ScriptAlias /cgi-bin /cgi-bin

Now create the /cgi-bin directory and symlink the php5-cgi binary to /cgi-bin/php5-cgi:


mkdir /cgi-bin
ln -s /usr/bin/php5-cgi /cgi-bin/php5-cgi

Finally in every VirtualHost where you need PHP5 support put these lines:


AddHandler php5-script .php
Action php5-script /cgi-bin/php5-cgi

All you have to do is restart the apache to take changes effect and you’re done.

Posted in: Uncategorized by kakaopor No Comments , , , , ,

I have forgot the password of MySQL’s admin user – how to recover?

If you have accidentaly locked out yourself, or just forgot your password for the admin (root) user of the MySQL, here is a quick-and-dirty solution.

First you have to shut down the MySQL server, next you need to start it in safe mode with no priviliges table loaded, update the password to a new one, and restart the database server just as before.

Step by step

  1. Stop the database server:
    $ sudo /etc/init.d/mysql stop
    Stopping MySQL database server: mysqld.
  2. Start in safe mode in the background (remember the PID! (29789 in my case as you can see)):
    $ sudo mysqld_safe --skip-grant-tables &
    [1] 29752
    Starting mysqld daemon with databases from /var/lib/mysql
    mysqld_safe[29789]: started
  3. Now you can log in with the root user without password.
    $ mysql -u root
    Welcome to the MySQL monitor. Commands end with ; or \g.
    Your MySQL connection id is 39
    Server version: 5.0.51a-6 (Debian)

    Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

  4. Set a new password, flush the privileges, and quit:
    mysql> UPDATE mysql.user SET password=PASSWORD('your-new-password') WHERE User='root';
    Query OK, 0 rows affected (0.00 sec)
    Rows matched: 3 Changed: 3 Warnings: 0

    mysql> FLUSH PRIVILEGES;
    Query OK, 0 rows affected (0.00 sec)

    mysql> QUIT
    Bye

  5. Now shut down the mysqld_safe what you have used (kill its PID):
    $ sudo kill 29752
    STOPPING server from pid file /var/run/mysqld/mysqld.pid
    mysqld_safe[29869]: ended
    [1]+ Done sudo mysqld_safe --skip-grant-tables
  6. And you can start your mysql server normally again:
    $ sudo /etc/init.d/mysql start
    Starting MySQL database server: mysqld.


Original source is the Locked Out of MySQL topic on CentOS.org.

Posted in: Uncategorized by kakaopor No Comments , , ,

early-ssh updated to v0.2 (for Debian as well:)

I have updated the early-ssh to version 0.2. This includes just a few bugfixes and new features, including scp support.

You can download the new version from http://dev.kakaopor.hu/early-ssh/

Posted in: Uncategorized by kakaopor No Comments , ,

How to unlock crypto root partition in Debian Linux over SSH (and more)

Early-ssh is a simple initramfs-tools hook script which provides an SSH server at boottime (in the initramfs) before the root filesystem gets mounted, so you will be able to do a numerous things, such as:

  • unlocking crypto devices – even your root can be an encrypted filesystem
  • assembling/altering mdadm RAID arrays
  • checking the root filesystem in read-write mode, taking action in case of errors
  • and so on… (if you have anything you wish to see here, please share it in a comment)

You can download the source code, and debian package here:
http://dev.kakaopor.hu/early-ssh/

Posted in: Uncategorized by kakaopor 3 Comments , ,

Minimal things needed for SSH login on Debian Linux

I was unable to find a place where all these things are collected, so I have decided I will write it down here.

So I am currently working on a little project where I need to have SSH access during the boot (on the initrd system). The following things are needed to create a working – as far as I know – minimal SSH server:

  • ifconfig – to configure the network interface
  • route – to configure the routing
  • Dropbear SSH server – a very small, and fully functional SSH server, client, keygen
  • /etc/login.defs
  • /etc/passwd, /etc/shadow, /etc/groups – for the authentication
  • /lib/libnss_files* – for the authentication processing
  • /etc/nsswitch.conf with the following content:

    passwd: files
    group: files
    shadow: files
  • /dev/pts – with devpts mounted (mount -t devpts none /dev/pts) for the terminals

On some systems the Dropbear needs a “better entropy device” than /dev/random, so we should symlink /dev/urandom to /dev/random.

And that’s all, everything should be fine now, and should run. I think I will write an another post with the whole “early ssh” thing soon, but I still need testing, and have to clean up my code somewhat.

Posted in: Uncategorized by kakaopor 1 Comment , ,
i
north-supercharged