jump to navigation

Malaysian Fuel Economy 12 December 2009

Posted by Maulvi Bakar in : Society , add a comment

Today I make a discovery with mixed feelings.

My main mode of transportation is a japanese-made K-Car, locally assembled and branded.  I love that car. It is small, zippy and cute too.  Just nice for my own personal use.

The Malaysian government introduces a new type of petrol/gasoline a few months ago – RON95 and phases out the RON92.  At the same time, the price for RON97 was raised to RM2.05 per litre and RON95 was priced at RM1.80 per litre, the old price for RON97.

Just like sheep, I too committed and tried this new type of fuel. After all, the one which we’re used to are now more expensive, litre-wise. Soon after, I noticed some significant differences when using the RON95 fuel. On one hand, I seem to be missing somewhere about 50KM total of mileage out of a full gas-tank. On the other, my trusty, zippy car now seems to lost it’s pickup and responsiveness.

In response to this new development in my car driving experience, I decided to do a little test -

On a full gas-tank of RON95, I decided to the risk of really pushing the distance. With a sharp-eye on the fuel indicator, waiting until the needle went past ‘Empty’, only then I pull into a gas station for a refill. Usually, it was 430KM, this time, I managed to squeeze 450KM!

The refill was at 35 litres! Thus if I am to refill with RON95 at RM1.80 per litre for 35 litres, with a mileage of about 12.85KM per litre, it will set me back by RM63.

This time, I tried refilling with RON97 fuel at RM2.05 per litre for 35 litres. A full tank of RON97 costs me RM71.75

Now with RON97, I really drove my car almost like a maniac!  Mind you, almost!! I am not a total maniac.  But the responsiveness returned!! I really love it!  The car was so speedy that on the way back home from work on one fine day causes a hatchback german-made luxury car said to be imported from the state of Bavaria felt it’s ego challenged.  No dispute that he’s the emperor of the roads and a K-Car is not your class of competition but some people really do wants to show-off like kids!

Enough digressing, I am sure everyone’s more interested in the mileage distance. Bear in mind, while on Ron95, I drove normally.  On RON97, let’s just say – I enjoyed driving.  This time the distance is 515KM.  I am sure I can go further.  But when I refill the gas-tank again, with RON97, it’s 35 litres!

Let’s calculate – RON97 at 35 litres at RM2.05 per litres, I achieved 515KM.  That gives me 14.71KM per litre! It sets me back by RM71.75 for the 35litres.

If I am to achieve 515KM on RON95 at 12.85KM per litre, I have to put in 40 litres of fuel  which will cost me RM72. Now the difference is so slight here!  But I believe I can achieve better results if I did not substitute a brick for my foot on the accelerator and if I drive more like sane people like everyone else. (No! I believe I am sane, everyone else are maniacs!)

Furthermore, the response that I get from my car is simply fantastic!.  The difference where it counts might be insignificant, but just count how many cars are out there in the streets! Imagine the amount of profit that they rake!  I am driving a car with a fairly efficient engine.  How about those who drove cars with really bad fuel consumption technology? Those on Carburetors instead of Fuel Injections – Uh! disclaimer, I don’t even know what those words means!

Anyhow, enjoy!!

Centos Public Mirror – http://centos.maulvi.net 15 October 2009

Posted by Maulvi Bakar in : Linux, Society, System , add a comment

To the world..

I present the Centos Public Mirror hosted on http://centos.maulvi.net

Basically, I’ve been installing and re-installing centos over and over and over..  Also, at any one time, I have a bunch of centos boxes running both physically and virtually.  This prompts me to run my own centos mirror.  It’s twofold – it saves time and make it easier for me to simply grab any packages.

Then I had a revelation – after leeching from the community, it’s time to give back something… This mirror is one small way I could do to give back and with a big THANK YOU to the wonderful centos linux community.

Enjoy!

Creating a new Linux RAID1 device and extending an existing LVM Volume onto it. RHEL/Centos 5 13 June 2009

Posted by Maulvi Bakar in : Linux, System , add a comment

I’m seriously into server consolidation and virtualization.  I’m going to eliminate my other VMWare server and just concentrate on one.

First order of the day is to upgrade the RAM and Available HDD space. Upgrading the RAM is simple enough, just add/replace the modules.

Expanding the available space is another matter.  This is actually an extension of my previous posting – New HDD, enlarging Red Hat/Centos ext3/lvm partition, but there’s another factor in the equation, RAID1 (Mirroring) devices.

The existing root partition resides in an LVM partition which in turn resides in a RAID1 (Mirroring) Multi-Disk (MD) partition which is based on a twin 400GB HDD configuration.

I’ve acquired a pair of 500GB HDDs. Now to extend the existing LVM ontothe newly acquired disks in a RAID1 configuration.

Step 1 is to create Software RAID partitions on the said disks -
# fdisk /dev/sdc
# fdisk /dev/sdd

Create a new ’sdc1′ and ’sdd1′ partitions using type FD, which is Linux RAID Autodetect.

Next, we need to create the Multi-Disk Volume -
# mdadm --create /dev/md2 --level=1 --raid-devices=2 /dev/sdc1 /dev/sdd1
Since I already have ‘md0′ for my ‘/boot’ and ‘md1′ is the existing volume with the existing LVM that was the intended target for expansion, thus naturally I’m using ‘md2′.

Basically, I am creating ‘md2′ device in RAID1 configuration using 2 devices namely ‘/dev/sdc1′ and ‘/dev/sdd1′.

You can monitor the status of your RAID devices using ‘/proc/mdstat’ -
# cat /proc/mdstat
Personalities : [raid1]
md2 : active raid1 sdd1[1] sdc1[0]
487331648 blocks [2/2] [UU]
[>....................] resync = 1.9% (9622656/487331648) finish=90.0min speed=88417K/sec

The steps here onwards are basically the same as previously mentioned here, the only difference is the ‘/dev/md2′ device is the target.

To start, we need to create a Physical Volume within the newly created ‘/dev/md2′ RAID device.
# pvcreate /dev/md2

After that we will extend the existing volume ‘VolGroup00? onto the newly created physical volume.
# vgextend VolGroup00 /dev/md2

Once done, the next step is to extend the Logical Volume within the volume group to use the free space newly made available when you extend the volume group previously.
# lvextend /dev/VolGroup00/LogVol00 /dev/md2
Here is the difference where I did not specify the space size to extend as the default will be to use all available spaces.

And finally, we’ll enlarge the ext3 partition to make use of the newly available free space in the logical volume.
# ext2online /dev/VolGroup00/LogVol00

I hope you guys read this below before proceeding..
# man ext2online
WARNING
Note that resizing a mounted filesystem is inherently dangerous and may corrupt filesystems, although no errors resulting in data loss have ever been reported to the author. In theory online resizing should work fine with arbitrarily large filesystems, but it has not yet been tested by the author on a filesystem larger than 11GB. Use with caution. Backups are always a good idea, because your disk may fail at any time, you delete files by accident, or your computer is struck by a meteor.

It is a good idea to ‘e2fsck -f /dev/VolGroup00/LogVol00′ before doing anything.

Enjoy!

HPUX Breaking Mirror and Extending LVM 2 June 2009

Posted by Maulvi Bakar in : Unix, Work , add a comment

I’m learning new things nowadays..  Particularly HPUX.  Not really my cup of tea since it not open-source but interesting enough though.

We had one machine with mirrored harddisks with one being faulty that needs removal.

Break mirror procedure..

1. Remove the mirror on the Logical Volume affected within the Volume Group
lvreduce -m 0 /dev/vg01/lvol1
lvreduce -m 0 /dev/vg01/lvol2

2. Now remove the Volume Group from the Physical Volume that is targeted for removal
vgreduce /dev/vg01 /dev/dsk/c2t0d0

3. Finally remove the Physical Volume from the Physical Disk
pvremove /dev/rdsk/c2t0d0
Please note the ‘r’.. ‘r’ stands for physical disk, while the one without is the physical volume..

Restore mirror procedure…

1. First, let’s verify things
ioscan -funC disk
pvdisplay /dev/dsk/c1t0d0        # get lvm info of existing disk.
pvdisplay /dev/dsk/c2t0d0        # get err, no lvm def on it, raw disk.

2. Now we create the Physical Volume within the Physical Disk and extend the Volume Group onto it.
pvcreate /dev/rdsk/c2t0d0        # add physical disk to be used by LVM
vgextend /dev/vg01 /dev/dsk/c2t0d0    # incorporate new disk to existing vg00

3. Check and verify!
strings /etc/lvmtab            # see new disk used by lvm

4. The next steps will actually perform the mirror, and it will fail if -m mirroring option is not activated with valid license
lvextend -m 1 /dev/vg01/lvol1 /dev/dsk/c2t0d0    # add mirror for lvol1
lvextend -m 1 /dev/vg01/lvol2 /dev/dsk/c2t0d0    # add mirror for lvol2

Enjoy!

Changing user’s file ownership across the board 25 December 2008

Posted by Maulvi Bakar in : Linux, Unix, Work , add a comment

The guys from the promised database lands had their systems acting funny.  After investigation, they found out that, their files was having the wrong group ownership.

There’s a total of 70,000 files involved.  Promised lands or not, manually changing 70,000 files (and folders) is not a good prospect.  Well, I could go through the individual sub-folders but I would need to work from the last in-depth sub-folders and work my way out.  Even that does not guarantee accuracy, since there might be sub-folders with multiple owners which I’m not suppose to touch.  When that happen, then I have to go through it manually looking at each files and folders individually – not good.

There has to be a short-cut.

I know I can locate all the files that needs to be changed it’s ownership by using the following commands -
find ./ -user someuser -group wronggroup -print

It’ll list all the relevant files and sub-folders. At first, maybe I’ll output it into a file, all the results. Manipulate the file into an executable. Append each lines with a “chgrp correctgroup” and have something like – “chgrp correctgroup ./to/the/path/of/the/file”.

I am smart, hey! ;-)

Let’s prove that I can be smarter  :-P

Vanity and pride are different things, though the words are often used synonymously. A person may be proud without being vain. Pride relates more to our opinion of ourselves; vanity, to what we would have others think of us.

Jane Austen

No, I’m just trying to figure out the best way of doing things.

“xargs -t <commands>”

xargs is a command of Unix and most Unix-like operating systems. It is useful when one wants to pass a large number of arguments to a command. Arbitrarily long lists of parameters can't be passed to a command, so xargs will break the list of arguments into sublists small enough to be acceptable.

xargs - build and execute command lines from standard input

The “-t” is for the verbose option. It’ll spew out the output of the commands being executed.

Basically, every time the output of the earlier “find”, it’ll append the extra commands specified and have it executed. Voila, no need to make a separate executable. My solution is thus -

find ./ -user someuser -group wronggroup -print | xargs -t chgrp correctgroup

Happy 4th Anniversary to myself  ;-)

Merry Christmas everyone!

Enjoy!

Linux sparse file in /var/log/lastlog using RHEL3 19 November 2008

Posted by Maulvi Bakar in : Linux, Work , add a comment

The guys in the promised backup lands had their heads scratching.  Their backups seems to bloat an extra 1.2TB in size!  The culprit seems to be the

/var/log/lastlog

Lastlog is sparse file which contains unallocated blocks or “empty space” and it does not actually take up filesystem space.  Simple test like thus will have a very straightforward results -

$ du -H /var/log/lastlog
156kB   /var/log/lastlog

Furthermore, “lastlog” is a file that almost never grow anyway. A common issue apparently.

Usually it is suggested that either the file be excluded from the backup excercise or, if policy-wise not possible, then the backup application to be configured to handle the specific sparse file, in this case “lastlog”.

Sparse files can confuse some backup software. Usually tools like GNU tar requires the use of the -S parameter to fix it. If you are using some other software, consult the backup software’s manuals for options on how to deal with sparse files.

Enjoy!

RHEL4 U5 Install, Boots Up with “GRUB” error on screen. 29 October 2008

Posted by Maulvi Bakar in : Linux, Work , 1 comment so far

This one is a funny error. After finishing the installation, the system reboots and ‘poof’ on screen only displays “GRUB”.

My suspicion is that, GRUB somehow or rather did not install properly onto MBR. Considering previously that the system comes only with a single harddisk. Later on, after fixing a second harddisk, the OS was re-installed with RAID1. Maybe that’s the cause as the old GRUB was not properly overwritten.

Basically, I re-insert the installation CD and boot up into rescue mode.
linux rescue

Upon boot up, mount the filesystem thus -
# chroot /mnt/sysimage

Use grub the regenerate the grub stuff on both hdds thus -
# grub

On the grub command line, select the 1st harddisk
grub> root (hd0,0)

Initialize grub onto the 1st harddisk
grub> setup (hd0)

Do the same for the 2nd harddisk
grub> root (hd1,0)
grub> setup (hd1)

Exit the grub menu -
grub> exit

Reboot the system and your grub should behave normally now..

Enjoy

From the Badlands to the Hardlands and finally to the Promised Land. 18 October 2008

Posted by Maulvi Bakar in : Home, Work , 2 comments

Hmm..

My retirement seems to be quite short-lived. I thought I’m gonna retire from the so called promised land. Well, I did retire.. Thought of taking up agricultural activities, then the economy gone south.

Turns out, the promised land is a Hardland. Well, I’m a former Badlander. At first, I thought I can hack it. Hack it I did! 3 years!.. or somewhere close to it! The results? Diabetic, Low Blood Pressure or somewhere close to it too ;-)

The advise is to retire ;-) as if that is possible. Nope, it’s just that I need to be mindful of myself, my health and ultimately, all those who have a claim on my life (The spouse, the Inhouse Celebrity).

Then, I got head-hunted again! First from a Japanese Electronics Giant™, but they balked at my physical conditions. My suspicions is more due to my academics, being a graduate of the Jedi Academy (or maybe the Starfleet Academy ;-) . Then, it’s an American Technology Giant™ (purportedly to be the largest in the world! It’s true!). Now, these guys didn’t even care about my formal background, just so I can demonstrate my abilities.

Heh! Use the force Luke!

I am grateful to be given an opportunity with the American Technology Giant™. Now I truly believe I am in the promised land. I sincerely believe I may just retire here instead… Professionally of course.. The union-like work environment. The superb benefits package, especially medical, hospitalization which covers spouse and children, unlimited mind you! All these does help nudging me towards my decision.

Wish me luck!

Time Travelling in VMware Server for Linux (Guest & Host) 6 August 2008

Posted by Maulvi Bakar in : Home, Linux, Work , 2 comments

I run two VMware host machines at home. This is where I do most of my ‘Training’. Well, most of my knowledge on Linux are self-learned anyway. This is where I do my R&D.

Simply, theory is good. But how do you know whether the theory is practical? What potential pitfalls when you deploy a solution? Especially Free (Libre) and Open Source Solutions? Not to say FLOSS solutions are no good, but in a commercial environment, when paying customers are willing to pay good money to transfer their operational risks to you, you better be sure of the solution that you’re proposing.

FLOSS solutions backed by commercial vendors – eg. Red Hat, is a safe bet. You can propose it to customers and as a fall back, there’s always Red Hat. Problem starts with FLOSS solutions that specifically states – ‘No warranty/guarantee of any kind’ :-P

Not to say they’re no good, mind you. That’s where you as a FLOSS Service Provider comes in. To provide the kind of warranty/guarantee that the customer wants for such FLOSS solutions. The other advantage of FLOSS, if the customer’s not happy with a FLOSS vendor, being FLOSS, you can always go to another vendor. That forces FLOSS vendors to always provide the best service.

Anyway, I’m rambling and digressing -

My guest OSes keep travelling faster than my host OS, sometimes as fast as 2 seconds every 10 seconds. Need to tune the VMware server host a bit -

file – /etc/vmware/config

host.cpukHz = 3400000
hostinfo.noTSC = TRUE
tools.syncTime = TRUE

The first line is to specify the maximum CPU clock rate the system may run.
Second line is to specify that the cpu is not running at a constant clock rate (speedstep, cpufreq or power management is active when idle) and the timestamp counter is inaccurate an to use it as the least.
The last line sets the default to use vmware-tools timesync function.

Well, I hope this is a permanent solution.

Enjoy

Linux NFS Server, AIX NFS Client 31 July 2008

Posted by Maulvi Bakar in : Linux, Unix, Work , 2 comments

Hmmm..

We have a Linux NFS machine to extend the AIX Server’s chronic acute harddisk space shortage syndrome. Somehow, AIX Client could not mount the shared NFS folder from the Linux Server.

Apparently, AIX uses high ports to establish the connectivity to NFS Server. Linux NFS Server requires low ports (below 1024). So, you have to force AIX to use those reserved ports to establish the connection.

nfso -o nfs_use_reserved_ports=1

Then, the normal ‘mount’ should work from AIX after the medicine :-P

Enjoy