Friday, July 22, 2011

Solution to CIFS mount failure

Once the OS is upgraded to Ubuntu 9.10, the network drive mounted in CIFS type is no longer working again.

Trying to tackle the issue by the following command:
..
CIFS VFS: cifs_mount failed w/return code = -22

In a Google search, one post has been found useful.

Re-installing smbfs package again solves this problem:

..
$ sudo apt-fast install smbfs

Friday, July 15, 2011

Ubuntu Jaunty 9.04 old package repository

Ubuntu release Jaunty 9.04 has been deprecated while the repository is completely taken off from the mirror server and Ubuntu server as well. Since missing on the repository servers, this repository is being hunted by the users who stick to this particular release for a long time. For people who might have forgotten to upgrade the OS on their own, this could be a bad news. That means no more package available could be installed, via regular way.

To port the old release repository for maintenance and last minute update, a post on the forum points to an interesting location:

http://old-releases.ubuntu.com/

which stores all those obsolete releases of Ubuntu repositories including Jaunty 9.04. However, this requires some changes in sources.list file for proper redirection.

Open /etc/apt/sources.list and edit as follows:

#
# deb cdrom:[Ubuntu-Server 9.04 _Jaunty Jackalope_ - Release i386 (20090421.1)]/ jaunty main restricted

# deb cdrom:[Ubuntu-Server 9.04 _Jaunty Jackalope_ - Release i386 (20090421.1)]/ jaunty main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.

#deb http://mirror.aarnet.edu.au/pub/ubuntu/archive/ jaunty main restricted
#deb-src http://mirror.aarnet.edu.au/pub/ubuntu/archive/ jaunty main restricted
deb http://old-releases.ubuntu.com/ubuntu/ jaunty main restricted
deb-src http://old-releases.ubuntu.com/ubuntu/ jaunty main restricted


## Major bug fix updates produced after the final release of the
## distribution.

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
#deb http://mirror.aarnet.edu.au/pub/ubuntu/archive/ jaunty universe
#deb-src http://mirror.aarnet.edu.au/pub/ubuntu/archive/ jaunty universe
deb http://old-releases.ubuntu.com/ubuntu/ jaunty universe
deb-src http://old-releases.ubuntu.com/ubuntu/ jaunty universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
#deb http://mirror.aarnet.edu.au/pub/ubuntu/archive/ jaunty multiverse
#deb-src http://mirror.aarnet.edu.au/pub/ubuntu/archive/ jaunty multiverse
deb http://old-releases.ubuntu.com/ubuntu/ jaunty multiverse
deb-src http://old-releases.ubuntu.com/ubuntu/ jaunty multiverse

## Uncomment the following two lines to add software from the 'backports'
## repository.
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
# deb http://us.archive.ubuntu.com/ubuntu/ jaunty-backports main restricted universe multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ jaunty-backports main restricted universe multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu jaunty partner
# deb-src http://archive.canonical.com/ubuntu jaunty partner

#deb http://security.ubuntu.com/ubuntu/ jaunty-security restricted main multiverse universe
#deb http://mirror.aarnet.edu.au/pub/ubuntu/archive/ jaunty-updates restricted main multiverse universe
deb http://old-releases.ubuntu.com/ubuntu/ jaunty-security restricted main multiverse universe
deb http://old-releases.ubuntu.com/ubuntu/ jaunty-updates restricted main multiverse universe

Save and exit.

After that, you may try the following to check if you can checkout the updates correctly:
$
$ sudo apt-get update

You may now install those missing packages previously supported in Ubuntu release 9.04 before you decide to upgrade to a newer but still obsolete release 9.10.

Saturday, July 9, 2011

Ubuntu Upgrade from 9.04 to 10.04 - a CD/DVD way

Something interested is found from the post about the way to upgrade Ubuntu 9.04 subsequently to 9.10 and then to 10.04. The method involves performing Ubuntu upgrade by using an ISO image of Ubuntu 9.10 downloaded from the repository server.

Upgrading Using the Alternate CD/DVD

Download the alternate installation CD via:
$
$ sudo wget http://mirror.aarnet.edu.au/pub/ubuntu/releases/9.10/ubuntu-9.10-alternate-i386.iso

Burn the ISO to a CD and insert it into the CD-ROM drive of the computer to be upgraded.

If the ISO file is on the computer to be upgraded, you could avoid wasting a CD by mounting the ISO as a drive with a command like:
$
$ sudo mount -o loop ~/Desktop/ubuntu-9.10-alternate-i386.iso /media/cdrom0

A dialog will be displayed offering you the opportunity to upgrade using that CD.

Follow the on-screen instructions.
If the upgrade dialog is not displayed for any reason, you may also run the following command using Alt+F2:

$
$ gksu "sh /media/cdrom0/cdromupgrade"

After an upgrade to Ubuntu 9.10 is successfully completed, another wave of upgrade to 10.04 can be done through GUI update manager.

Ref: https://help.ubuntu.com/community/KarmicUpgrades

Sunday, June 19, 2011

Aspire ONE (Model 0751H) GMA500 widescreen display setup on Fedora 14

Before installation of the problematic Poulsbo driver on Ferdora 14 (freshly installed), please try the followings first:

$ su -c 'yum clean all'
$ su -c 'yum update'

Reboot to let the updated kernel running.

Install rpmfusion free and non-free repositories rpms:

$ su -c 'yum localinstall --nogpgcheck \
http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm \
http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm'

Thanks to AdamW's articles, the correct steps are listed here:

To install Poulsbo driver:

$ su -c 'yum –enablerepo=rpmfusion-nonfree-updates-testing \
install xorg-x11-drv-psb'

To fix the problem of missing psb.ko for whatever updated kernel:

$ su -c'yum –enablerepo=rpmfusion-nonfree-updates-testing \
install akmod-psb'

Reboot to take effect for widescreen display.

Optimize the following sections in /etc/X11/xorg.conf:

Section "Device"
Identifier  "Videocard0"
Driver      "psb"
Option      "IgnoreACPI"
Option      "MigrationHeuristic" "greedy"
Option      "ShadowFB" "true"
EndSection

Section "Extensions"
Option     "Composite" "Enable"
EndSection

Section "Screen"
Identifier "screen1"
Device "Videocard0"
DefaultColorDepth 24
EndSection

Section "DRI"
Mode 0666
EndSection

Edit /etc/grub.conf as follows:

Add the following parameters to the end of line of kernel command:

elevator=noop mem=896m acpi_osi=Linux acpi_backlight=vendor

Reboot and see if the system performance is improved.

Friday, June 17, 2011

An Open Source version of RedHat Enterprise Linux

I have been looking for other alternatives which mimics or offers free version of Enterprise OS like RedHat Enterprise Linux. Two of them have been found so far, like CentOS and Scientific Linux.

RHEL6 has been released for a while but CentOS didn't quite catch up with the latest version of RHEL, so I turned to use Scientific Linux which has version 6 now. Also, the fancy of SL6 may be due to its support by famous national laboratories around the world, such as Fermilab and CERN. These labs are working on high energy physics and make use of SL6 inside their IT infrastructure.

SL6 is actually rebuilt from the source RPMs of RHEL6. People are working on security fixes and put them upstream back to RedHat repository. This makes SL6 binary compatible with RHEL6. Now I use SL6 on my Aspire ONE netbook as well.

The good thing that I have experienced is the high quality of software packages as compared with other open source edition of Linux which may crash and make your system useless in some occasions. You may not obtain the latest update in time but the stability and reliability offered by typical enterprise class system is certain.
Although "Scientific" is not a cool name to me, it is surely a good choice of enterprise class OS in production environment.

Site reference:
http://www.scientificlinux.org/

Wednesday, June 1, 2011

User Privileges for MySQL administration and automation

To automate MySQL administration like using auto backup script, the user privileges play an important role on how MySQL server to be control with enough security measures to prevent mis-using such user role.

Assuming "mysqldump" and "mysqladmin" are going to be used in such automation, the following privileges should be clearly identified and applied to a particular user role for successful MySQL administration:


  • SUPER
  • SELECT
  • SHOW DATABASES
  • SHOW VIEW
  • LOCK TABLES
  • RELOAD
  • SHUTDOWN
  • PROCESS
  • REPLICATION SLAVE
  • REPLICATION CLIENT

Example of assigning privileges:
>c:\xampp\mysql\bin\mysql –u –p –-port=3306
Enter password: ************

mysql>CREATE USER ‘replica’@’localhost’ IDENTIFIED BY ‘password’;
mysql>GRANT REPLICATION SLAVE ON *.* TO ‘replica’@’localhost’;


For details of particular privilege, please refer to the manual page:
http://dev.mysql.com/doc/refman/5.5/en/privileges-provided.html

Converting EXT3 partition into EXT4 on Ubuntu

EXT4 type partition is the successor of EXT3, but it may not be turned on by default installation. Indeed, EXT4 driver is backward compatible with EXT3/EXT2 partition. The conversion from EXT3 to EXT4 partition is straight forward.

Please backup important data and software you have been using on Ubuntu Linux.

BEFORE DOING ANYTHING, PLEASE SHUTDOWN ALL LAMPP RELATED PROCESSES:
$ sudo /opt/lampp/lampp stop
To switch the existing Ext3 file system to the new Ext4 driver, it is necessary to edit a configuration called "fstab":
$ sudo nano /etc/fstab
Look for ext3 on the line that defines your disk and change it to ext4.

To ensure the right device to be converted, you may check the name of the device by issuing the following command:
$ df -h

Make a note of the device as you will need it in the next step. In the example above, the device for the encrypted partition is "/dev/mapper/encrypted".

Next reboot your system. This is required so that you switch to the Ext4 Kernel driver. Do not continue without rebooting first.

Enable Ext4 features:
$ sudo tune2fs -O extents,uninit_bg,dir_index /dev/mapper/encrypted
WARNING: Once you run this command, the filesystem will no longer be mountable using the ext3 filesystem!

After running this command (specifically, after setting the uninit_bg parameter), it is also important to run fsck to fix up some on-disk structures that tune2fs has modified:
$ e2fsck -yfDC0 /dev/mapper/encrypted
Notes:

Running fsck will complain about "One or more block group descriptor checksums are invalid" - this is expected and one of the reasons why tune2fs requests to fsck.
By enabling the extents feature new files will be created in extents format, but this will not convert existing files to use extents. Non-extent files can be transparently read and written by Ext4.
If you convert your root filesystem ("/") to ext4, and you use the GRUB boot loader, you will need to install a version of GRUB which understands ext4. Your system may boot OK the first time, but when your kernel is upgraded, it will become unbootable (press Alt+F+F to check the filesystem).
If you do the conversion for the root fs on a live system you'll have to reboot for fsck to run safely. You might also need to add rootfstype=ext4 to the kernel's command line so the partition is not mounted as ext3.

WARNING:
It is NOT recommended to resize the inodes using resize2fs with e2fsprogs 1.41.0 or later, as this is known to corrupt some filesystems.
If you omit "uninit_bg" on the tunefs command, you can skip the fsck step.

Installing open-vm-tools on Ubuntu Guest VM

To help boost the performance of Ubuntu Guest VM, it is recommended to install VMware tools. The problem is it may not fully compatible with various release of Ubuntu. Ubuntu do have their own repository of Open VM tools for use. So, why not have a try on it?

Installing open-vm-tools from Ubuntu repository:

The VMware tools are part of open-vm-tools. Make sure that the "multiverse" repository is enabled and do:

Install kernel headers so modules will work
We need this on a 10.04 guest running in a Fusion 3 host
$ apt-get install linux-headers-virtual
Install kernel modules
$ apt-get install --no-install-recommends open-vm-dkms
EITHER: install tools for an xorg install
$ apt-get install open-vm-tools
OR: a headless install
$ apt-get install --no-install-recommends open-vm-tools

Direct Upgrade Ubuntu from 9.04 to 9.10

Ubuntu upgrade from 9.04 to 9.10 can never be easy like this:

Before the actions, it is essential to backup any running database and web server for disaster recovery and then turn them off completely.

You can easily upgrade over the network with the following procedure.

1. Start System/Administration/Update Manager

2. Click the Check button to check for new updates.

3. If there are any updates to install, use the Install Updates button to install them, and press Check again after that is complete.

4. A message will appear informing you of the availability of the new release.

5. Click Upgrade.

6. Follow the on-screen instructions.

Finally, reboot the system and see all changes.

There was compatibility issue regarding XAMPP package since people complained they couldn't get XAMPP based server startup after the reboot. In my case, it did happen before. In recent trial of GUI upgrade directly from Ubuntu Update Manager, the problem seems to be solved. I have even got another notice from Update Manager about Ubuntu upgrade to version 10.04 as well.

Tuesday, May 31, 2011

Resync MySQL Slave with Master

For various kinds of reasons, it is not unusual to find MySQL Slave instance in a broken state during the replication. The quick fix requires a perfect database backup of Master instance. From the backup file, two parameters must be extracted for restoration of data onto Slave Server:

bin-log filename: MASTER_LOG_FILE
bin-log position: MASTER_LOG_POS

Of course, the overall system performance may be affected during the backup operation. However, MySQL Master server can be kept running as normal without any interruption.

You may find it difficult to find all the switches required for a successful online backup operation. Fortunately, an example is here.

Before anything happens, you'll find it easier to manage all those by opening two separate terminal consoles for both Master and Slave instances.

Terminal console for Master server:

The following command (recommended to run under “sudo –s” environment) will dump all databases on Master instance:
$ mysqldump -uroot -p \-S /etc/mysql/mysql.sock \
--master-data --hex-blob --opt --single-transaction \
--comments --dump-date --no-autocommit \
--all-databases > target_backup.sql

Please make sure the path of socket file of MySQL Master server is correct.

With “--master-data” switch, Mysqldump program will make a comment for the bin-log filename and position which can be really useful for resynchronization afterwards.

With “--single-transaction” switch, a global lock is acquired for a very short time at the beginning of the dump while any action on logs happens at the exact moment of the dump.

With “--hex-blob” switch, image data with BLOB type can be well preserved inside the backup without any disruption.

Once finished, you'll get a perfect backup file from MySQL Master server named "target_backup.sql".

Terminal console for Slave server:

Now, it is time to put the data onto MySQL Slave server. Please beware that the socket file used here becomes “/etc/mysql2/mysql2.sock”. Don’t it mix up with that of Master instance.

$ mysql -uroot -p -S /etc/mysql2/mysql2.sock < target_backup.sql

Now, login to MySQL Slave server:

$ mysql –root –p –S /etc/mysql2/mysql2.sock


Please check if MySQL user role named “slaveuser” with “replication” privileges does exist on Slave server.

Then, execute the following commands to resynchronize Slave server:

mysql> STOP SLAVE;
mysql> RESET SLAVE;
mysql> CHANGE MASTER TO MASTER_HOST=’localhost’,
>MASTER_PORT=3306,
>MASTER_USER=’slaveuser’,
>MASTER_PASSWORD=’XXXXXXXX’,
>MASTER_LOG_FILE=’mysql-bin.XXXXXXXX’,
>MASTER_LOG_POS=XXXXX
>;
mysql> START SLAVE;

For the corresponding values of MASTER_LOG_FILE and MASTER_LOG_POS, please read through the heading comments inside “target_backup.sql” file.

To check the status, please issue the following command:

mysql> SHOW SLAVE STATUS;

It is useful to check the error log of MySQL Slave server to confirm whether everything is back on track.