Tuesday, June 24, 2014

Breaking things is a disease

Breaking things is a disease. Mostly found in humans till he self creates it and knows and pays the exact cost. 


Love sharing 
Amit Chopra 

Sunday, June 15, 2014

Reducing Root LV EXT3 + Linux

Dear Friends,

Had worked on reducing the root file system some days back. So sharing the experience of the same.

A. Our Aim is to reduce the root file system, which is in EXT3. We also have other file systems, need to be reduced to free the space, but they are not allowing us to reduce the same online. All File systems are in EXT3.
B. Name of the file systems are /home, /var, /opt, and root i.e. / .
C. All of the above are not allowing us to unmount them.


 /dev/mapper/VolGroup-LogVol00
 /dev/mapper/VolGroup-LogVol02
 /dev/mapper/VolGroup-LogVol04
 /dev/mapper/VolGroup-LogVol06


Request you to please note down the name of the file system on paper as we may not be able to recall the complete path in RESCUE MODE.

E. Once checked, We can again check status using umount /opt, etc. It will say the message.

FILE SYSTEM/MOUNT POINTS are busy cannot umount.

or

umount: /: device is busy
umount: /var: device is busy
umount: /home: device is busy

F. Now to reduce them, take proper Downtime of the server, Take complete backup of the server. if in case things goes wrong. Then we will be having plan B.

G. Once all done,  We are given approvals Get Set go to reduce the mount points in RESCUE MODE.

H. TO go into RESCUE MODE, We should have a Boot Able DVD, or Boot Able USB.

I. Insert the DVD, Reboot the system, once installation screen appears, press F5.

J. Write LINUX RESCUE on the prompt.
the system will start booting to rescue mode, I have experienced some times the server/system doesn't go in rescue mode in one go. so friends don't panic. Boot up the system again using CTRL+ALT+DEL.
and follow step I and J again.

K. Once server start booting, it will show blue screen Asking for Language selection, {at the same time it will show the heading as LINUX RESCUE also, Friends as it is DVD part which is booting up, not the Hard disk}.
 It will show next screen for switching on NFS {skip this step/NO},
Now it will ask for whether File system to be mounted. Select NO.
 Server/System will bring to the prompt  #, at the same time.

L. Now we can run commands like, df -hT, e2fsck -y, lvm, etc. those we need.

M. Now run commands,

#LVM
#lvm vgchange -a y VolGroup00 ----  It will show VG is active state now.

Now run

#e2fsck -y /dev/mapper/VolGrooupLogVol00

It will do five checks. Once all done successfully.

#resize2fs "name of the file system" "Size need to be set"

Now run lvreduce

#lvm lvreduce -L "size need to be set" "name of the file system"

example :- #lvm lvreduce -L 10G /dev/mapper/VolGroupLvol00

Similar process to reduce other file systems. Do these steps carefully as extension of LV doesn't harm but reduction of the same can corrupt the file system and can also cause Data lose.

* I have tried to reduce the /opt and /home in single user mode or init 1. they were successfully reduced from there. You can also do the same from rescue mode.

once all done, reboot.

The system will be up and running with the desired reduced size.

Precaution :-

a. Take backup of the server/system. Complete backup/Snap shot will be best option in case of VM.
b. Note down the name of the File systems need to be reduced so that no confusion occurs at the time of activity.
c. Never run the command lvreduce without unmouting and running e2fsck, resize2fs before. If you have done this then we have to bring the same size back to earlier size, we can check the same from file ----------- /etc/lvm/backup/VolGroup00. extend the file system using "lvextend -L ....."  and then run resize2fs /dev/mapper/VolGroup-LogVol##. Then again reduce the same using proper steps.
d. Try to reduce to a specific figure till where you feel safe "For those who are starting working new on LVM.
e. Also request you to keep in mind the Logical extents of the logical Volume.
f. There is a way we can check using command "tune2fs -l "name of the filesystem" " whether the file system can be reduced online or in multiple user mode i.e. init 3.
else We can also check with un-mounting the File system after following proper way and process. 

tune2fs -l /dev/mapper/VolGroup-LogVol00

tune2fs -l  /dev/mapper/VolGroup-LogVol02

tune2fs -l /dev/mapper/VolGroup-LogVol04

tune2fs -l /dev/mapper/VolGroup-LogVol06



Please do correct me and if need to edit some steps.... All comments are welcome as learning is our goal. 




Thanks & Love Sharing
Amit Chopra






Thursday, May 29, 2014

Problem in using GUI due to haldaemon LINUX

Dear Friends,

Today, came across a situation and learned a new thing, when my GUI console i.e. int 5 was showing me hung keyboard and hung mouse. seemed like some GUI or XMANAGER problem has come. System was not at all responding at the GUI console. tried to crash and generate the kdump using key combinations "CTRL+ALT+PRINT SCREEN+Key C" the dump generated and system crashed and rebooted.
Next stopped the system on selecting the kernel and booting with other kernel. The system booted up in init 5 but still the mouse and keyboard were not working. so you can say without these not able to access the system. (Yes we could try with taking putty of the machine). so to check the same booted the system to single user mode and booted the system from there to init 3 run level. System booted up and mouse, keyboard started working. Went to the services, there is a daemon called "HALDAEMON" i.e. Hardware Abstraction Layer. this is for  recognizing various type of hardware attached to the system. It enables them to work and making them accessible.
This issue seemed to me creating problem at console only, but not at the putty, need to check this.

Now made this service enable to run at run level 5 using :-

#chkconfig --level 5 haldaemon on

This was done at run level 3, as we enable the services to run on other run level from one run level as defined above. After enabling the haldaemon to work on run level 5. booted the system to jump on run level 5 using init 5 from # prompt. Issue resolved. My keyboard and ouse started working on run level 5.



Thanks for the visit & Love sharing
Amit Chopra


Tuesday, May 27, 2014

Gautam Buddha's Sayings

Hi Friends,

There are lot to experience in and for this life. Buddha's thoughts take to us to internal journey. We need to know ourselves before heading towards any other person, thing, etc.

---He Said :-

* "Chaos is inherent in all compounded things, Strive on with diligence."

* "You will not be punished for your anger, you will be punished by your anger".



Love Sharing
Amit Chopra


Thursday, May 22, 2014

It is very difficult to be yourself

If we love someone, we become like him.
If we hate someone, We become like him,
If we have a strong enemy, Sometimes We think, act and react like him,
All these leads us to be like others,
But very few people success in knowing themselves, As we study less about ourselves.
So we need to give time to study ourselves first.


Love Sharing and Learning
Amit Chopra