Open window

Think globally, act locally!!

Implementing RAID-1 October 30, 2008

Filed under: Critical — Sheikh Jafar Tarique @ 7:32 am

Here you will find the implementation of RAID level 1 (mirroring) with two different partition of same size on linux host.

First select 2 partition of equal size. If u have free space on your HDD u can create 2 new partition of same size using fdisk command, then run partprobe and create file system for newly created partition using mkfs.

Now install the mdadm package.
If you do not have md and raid1 module already loaded use modprobe to load it:
lsmod |grep raid1/md[to check whether they are loaded]

Load modules at boot time
No we need to make sure that raid kernel modules are loaded at the boot time.
echo raid1 >> /etc/modules
echo md >> /etc/modules
Load modules to the Kernel
modprobe raid1

modprobe md and again check with lsmod command.

N.B. The partition u just created need to be unmounted.

So your partitions are ready and raid1 and md modules also loaded on your kernel and make sure you have rsync installed on your system.

Then run the following command to create the raid device-

mdadm –create –verbose /dev/md0 –level=1 –raid-devices=2 /dev/sda10 /dev/sda11
Create a filesystem on RAID 1 Arrays
mkfs.xfs -f /dev/md0

Then mount the device
Edit mdadm.conf file
cp /etc/mdadm/mdadm.conf /etc/mdadm/mdadm.conf_orig
mdadm –detail –scan >> /etc/mdadm/mdadm.conf
Edit /etc/fstab

As we want to make our system to mount new RAID 1 arrays after reboot we need to edit /etc/fstab file.
/dev/md0 /disk-1 ext3 defaults 0 2
To see the current status of your RAID partition type the following command

mdadm –detail /dev/md0

 

Tricky Trips July 8, 2008

Filed under: Critical — Sheikh Jafar Tarique @ 3:09 pm

To change a user shell

chsh -s /bin/bash <user>

you are login with user tarique and now a you want to run a GUI package with user sheikh

and the GUI fails. what then?

To way to solve this

cd /home/tarique

cp .Xauthority /home/sheikh

OR

xhost +x

export DISPLAY=:0.0

then run the package

 

Building extra apache module July 4, 2008

Filed under: Critical — Sheikh Jafar Tarique @ 5:55 am

apxs -Compile -i proxy.c

apxs -c -i proxy.c mod_proxy_connect.c mod_proxy_http.c proxy_util.c

When u execute this command u must have permission to write to apache installation directory.

 

Installing missing java plugin for firefox in linux May 20, 2008

Filed under: Critical — Sheikh Jafar Tarique @ 10:05 am

Sometime firefox cann’t automatically install the missing java plugins.In that case u have to do manual installation.

First download the missing installer something like jre-6u3-linux-i586.bin file.Then run it as follows

./ jre-6u3-linux-i586.bin

Now open a new tab in your firefox and there type

about:config

and in Filter tab type    java

Then check for following options are valid or not.

java.default_java_location_others /usr/local/jdk

java.java_plugin_library_name libjavaplugin_oji.so

And finally make a soft link as follows

ln -s /usr/local/jdk/jre/plugin/i386/ns7/libjavaplugin_oji.so /usr/lib/iceweasel/plugins/libjavaplugin_oji.so

thats it!Now restart your firefox.

 

Interactive & safe removal May 20, 2008

Filed under: Critical — Sheikh Jafar Tarique @ 9:43 am

In windows when we want to delete a file or something else we were asked before delete.Thats a very useful thing bcoz we again ensure whether we delete it or not.

In linux when we want to delete a file or directory we use rm command.

and the two common switches we use

-r remove directories and their contents recursively(used when we want to delete directory)

-f for force delete (used for file and directory)

But the problem is when we execute a command like

$ rm -r docs (it will delete all the contents of docs without prompt but after delete you think that you need a file there)

$ rm * (what will happen suppose you want to delete all files under /home/david/docs but your pwd is /home/david now and b4 runinng rm cmd you forgot to check your pwd)

So two things you must check b4 delete

1.)Your current working directory (run pwd command)

2.) before delete one thing you must ensure that what exactly you want to delete it (run rm with -i option)

Now what is advantage of -i, suppose u didn’t check your pwd but you used rm -i then at least u will got a prompt asking you the file name either you want to delete or not.

N.B. A very few linux distribution (may be RedHat or Fedora) by default give a prompt when you run rm command.But this article for those distribution where prompt is not given.