Prakash Sawarkar: Kernel 3.8 Released, how to Compile in Redhat, CenOS and Fedora..

Kernel 3.8 Released, how to Compile in Redhat, CentOS and Fedora.

Friday, 17 June 2011

25 Facts About GNU/Linux

Linux is a land of excavation, the more you excavate the more you find treasure lies within it. This article tries to uncover some of the lesser known facts about Linux. To keep things simple, easy to read, easy to remember and easy to refer this article will be presented in point-wise fashion.

1. Linux is not an OS, but it is the kernel, GNU Linux is the OS and it comes in several hundred flavours.
2. Linux Kernel was written by a 21 year finnish college student as a part of his hobby. Yup! His name is Linus Torvalds.
3. Torvalds created Linux based on GNU General Public License (GPL). Perhaps Torvalds would have never written his own kernel if GPL would be having it’s own kernel and driver.
4. Major part of today’s Linux kernel is written in C programming language and assembly language and only 2% of today’s kernel contains code written by Torvalds.
5. A Standard Linux Kernel of today has over 10 Million lines of code and it grows at the rate of 10% every year. About 4500 lines of codes are added and 1500 lines of code are changed everyday. Initially in 1991, Linux kernel version 0.01 was released with 10239 lines of code.
6. A guy named William Della Croce Jr. registered the name Linux and demanded royalty for using its name and mark. However he agreed to handover the trademark to Linus, later.
7. The Linux kernel’s official mascot is a penguin named Tux, abbreviation of tuxedo. The idea that Linux had a pet penguin comes from Linus Torvalds himself.
8. The first commercial distribution of GNU / Linux was Yggdrasil (http://en.wikipedia.org/wiki/Yggdrasil_Linux/GNU/X) and was launched in CD format in 1992. Red Hat was one of the first distributions to settle within companies and data centers in 1999.
9. Debian was one of the first GNU / Linux that was constituted and organized as a community of developers. Debian v. 4.0′s source code contains 283 million lines of code, $7.37 billion: projected cost to produce that amount of code in a commercial environment. Debian’s code base remains the foundation for other distros such as Ubuntu, Knoppix and Xandros.
10. 90% of the world’s most powerful supercomputers are using GNU/Linux. Top ten of supercomputers use Linux. 33.8% of the world runs on Linux servers compared to 7.3% running Microsoft Windows operating system.
11. Linux Torvalds has been honoured by naming an astroid after his name.
12. There are over 300 distributions GNU / Linux activities ranging from the well known Debian or Fedora distributions through governmental or educational level. And this list seems to grow with regional and personal distros being added frequently.
13. OK, Now the area of application of Linux – U.S. Department of Defense, U.S. Navy Submarine Fleet, Federal Aviation Administration, Tamil Nadu for education purpose, Japan’s bullet trains, traffic control of San Francisco, the New York Stock Exchange, CERN, many air traffic control systems or control of nuclear reactors of submarines and ships, Russia, Brazil and Venezuela for interoperable management , cost efficient and technologically independence, Google, Cisco, Facebook, Twitter, Linked in, Toyota, TiVo, etc, server hosting the website of the White House (Drupal), federal government of Brazil favours Linux operating systems over all others in its PCs. Is Not Linux kernel the most widely ported operating system, running on a great variety of operating systems.
14. For those who think Linux can’t do Animation – Oscar-winning visual effects of the Titanic by James Cameron came from machines with Linux and Avatar was the last movie completely developed in 3D Applications on Linux platform using Foss Software. Exclaimed!
15. Believe it or not – In 2002, Microsoft had accumulated a $ 421 million cost of fighting the spread of Linux, according to The Register.
16. According to a study funded by the European Union, the estimated cost to redevelop the most recent kernel versions would be at $1.14 billion USD – Amazed.
17. Microsoft Windows and the Linux kernel can run simultaneously in parallel on the same machine using a software called Cooperative Linux (coLinux).
18. IBM choose Linux for what is expected to be the world’s most powerful supercomputer, Sequoia, due in 2011.
19. An unmodified version of the Linux kernel is called – ''Vanilla Kernel''
20. Last year, 75% of Linux code was developed by programmers working for corporations. GOOGLE has contributed about 1.1% of the code in the current Linux kernel.
21. Linux has a strong following in Smart Phones – Palm’s WebOS, Google’s Android and Nokia’s Maemo smart phone operating systems are built on top of the Linux kernel.
22. Android’s Operating System is based off of Linux. The operating system is primarily based off of Linux kernel and Google has made several changes to make it go above and beyond the original basis of Linux kernel. The first Android Smart phone was launched by HTC! Though Samsung has captured much of the Android smart phone sector with its Galaxy series of devices.
23. Google names the code names of Android versions in alphabetical order. These names are not random but names of desserts. Can you guess the next versions of Android now? Android 5.0 K………..?!, Android 6.0 L………….?!!
24. Android mascot was stolen! Google didn’t originally create that mascot. The mascot was adopted from a character named Android! from a game called Gauntlet.
25. As of January 2010, Linux still only has a 1.02% market share within desktops.
This is not the end. You could tell us any other interesting fact about this wonderful project, if you know. Nevertheless you comments are highly appreciated. I will be coming with another article, very soon which you will love to read. Stay Tuned.

Saturday, 19 February 2011

Backup for /etc/passwd , /etc/group , /etc/shadow

/etc/passwd /etc/group /etc/shadow are very essential file systems for Linux. You should not be surprised that linux does do a backup of the /etc/passwd /etc/group /etc/shadow. They are represented by

#  /etc/passwd-
#  /etc/group-
#  /etc/shadow-

So in case your any of your /etc/passwd /etc/group /etc/shadow are corrupted, just do a copy and replace

Note: listed with the appropriate access permissions
  File:             Owner:  Group:  Permissions:
/etc/passwd      root     root   rw- r-- r--
/etc/group root     root   rw- r-- r--
/etc/shadow root     root   rw- --- ---

Sunday, 23 January 2011

KVM Virtual Machine Renaming

Renaming KVM  Virtual Guest Running on Centos 
This below docs covers how to rename  any of the guest  running on  CentOS 5.6 and later KVM+libvirt Host Log in as root on the Host because Most of below virsh  commands require root privileges to run due to the communications channels used to talk to the hypervisor. Running as non root will return an error.
Then run the virsh - management user interface  tool from  the command line
What is virsh?
The virsh program is the main interface for managing virsh guest domains. The program can be used to create, pause, and shutdown domains.
The basic structure of most virsh usage is:
virsh <command> <domain-id> [OPTIONS]
Where command is one of the commands listed below, domain-id is the numeric domain id, or the domain name (which will be internally translated to domain id), and OPTIONS are command specific options. 
The virsh program can be used either to run one command at a time by giving the command as an argument on the command line, or as a shell if no command is given in the command line, it will then start a minimal interpreter waiting for your commands and the quit command will then exit the program.
 After execute the "list" command  it will list all the running guest with Name is the name of the domain.  ID the domain numeric id.  State is the run state .  If you want to list all the guest run "list --all" inside a virsh shell 
 In our next step  we are going to  select the guest we wish to rename in our case its Centos6-prakash with the ID 14 and its in running state.
[root@prakash ~]# virsh 
Welcome to virsh, the virtualization interactive terminal.
Type:  'help' for help with commands
       'quit' to quit
virsh # list 
 Id Name                 State
----------------------------------
  4 RHEVM2.2-Win2k8R2    running
 14 Centos6-prakash            running

virsh # list --all
 Id Name                 State
----------------------------------
  4 RHEVM2.2-Win2k8R2    running
 14 Centos6-prakash           running
  - Win2k3            shut off
  - RHEL-WEB             shut off
virsh # edit 14        (it will open the guest xml file in vi  editor modify the name and save it)
<domain type='kvm'>
  <name>Centos6-prakash</name>        --->change the name from  Centos6-prakash to RHEL6-X86_64_prakash and save it
  <uuid>3a0a2cb7-095a-8ad9-624c-5163cf52692a</uuid>
  <memory>1048576</memory>
  <currentMemory>1048576</currentMemory>
virsh # edit 14
error: operation failed: domain 'Centos6-prakash' is already defined with uuid 3a0a2cb7-095a-8ad9-624c-5163cf52692a
The above error is exactly the expected behavior.  virsh edit does not support changing the name or UUID.  If you want to change either of those, you'll need to the following.
Shut down the vm using the virsh command line or using virt-manager
#virsh shutdown Centos6-prakash
Change to the directory
# cd /etc/libvirt/qemu/
 An easy way to obtain the definition of a pre-existing guest is by using dumpxml command.
# virsh  dumpxml Centos6-prakash  >  CentOS6-X86_64_Prakash.xml
Now Undefine the configuration for an inactive guest (Centos6-prakash)
[root@prakash qemu]# virsh  undefine Centos6-prakash
Domain Centos6-prakash has been undefined
Now edit the new xml file and save it
[root@prakash qemu]# vi Centos6-X86_64_prakash.xml
<domain type='kvm'>
  <name>CentOS6-X86_64_prakash</name>  --> Centos6-prakash was replaced by Centos6-X86_64_prakash
  <uuid>3a0a2cb7-095a-8ad9-624c-5163cf52692a</uuid>
Once you saved it  Define a new  domain from an XML (Centos6-X86_64_Prakash.xml) 
  [root@prakash qemu]# virsh define Centos6-X86_64_prakash.xml
Domain Centos6-X86_64_prakash defined from Centos6-X86_64_prakash.xml
Now go to virt-manager or visrh command line and start the renamed guest.
# virsh start Centos6-X86_64_prakash
[root@prakash qemu]# virsh  list --all
 Id Name                   State
----------------------------------
  4 RHEVM2.2-Win2k8R2          running
  5 Centos6-X86_64_Prakash     running
----------------------------------

Friday, 14 January 2011

Setting up RHEL /CentOS Virtio Drivers for Windows Guest on KVM

Installing VirtIO  Block drivers on Windows Guest System Boot disk on KVM
Virt IO block driver can be used either as a system (boot) or non-system disk. In this section we are going to see how to attach virtio disk for system boot disk new  windows 2008 virtual machine we are going to create on top of RHEL6 KVM Host.
Install the RHEL6 and select Only "Virtual Host" during the Package Selection during the Installation it will  install all the necessary kvm packages to create and manage virtual machines 
Then Register the host With RHN Satellite and subscribe to  RHEL Server Supplementary  Child channel and install the virtio-win using yum.
# yum install virtio-win
or
Even you can download the  virtio-win-1.1.16-0.el6.noarch and install it manually  on the host .
Once you installed you will find all the drivers under /usr/share/virtio-win/ diretcory and you can check it using the simple rpm comand line by typing .
rpm -ql virtio-win-1.1.16-0.el6.noarch.
# ls /usr/share/virtio-win/

drivers/      virtio-win-1.1.16.vfd  virtio-win.vfd  virtio-win-1.1.16.iso  virtio-win.iso
You can Now attach this file virtio-win.iso using cdrom to the windows guest using virt-manager to install either disk or network virt drivers  after the Operating syste installation.
If you want to make your system boot disk to use virtio then you are suppose to use virtio-win-1.1.16.vfd file as a floopy drive and proceed the installation . Installing the tools after the Operating system installation is very straight forward we will see how to use  virtual floppy  drive to load the virtio disk driver during the windows guest installation .
Start the Virt-manager from  the command line or from system tools  .
Create a new virtual machine lets call its as win2k8R2 and Select Media as per you Local Infrastructure , We are using an Local ISO Install image and Select Forward.
Browse the Local ISO Image and Select the Os type to Windows and Version to Microsoft Windows 2008
Select the Required Storage Disk size for your Virtual Machine



Select the Memory and Cpu as per your requirement and Click Forward


You can Expand the Advanced Button to change the Network and MAC Settings and Select "Customize Configuration Before Install " on the final screen and Click Finish.


Click on Add Hardware-->Select Storage-->Forward-->Select Managed or Existing Storage-->Browse for the /usr/share/virtio-win/virtio-win-1.1.16.vfd and Change the Device Type to Floppy 
Disk and Leave Cache Mode to default and Finish.


Now Remove the IDE  disk we attached during the Virtual machine creation 
Add the New storage Disk by selecting Add Hardware and give the disk size and select Device Type to  virtio Disk instead of IDE.
Now we have virtual Floppy disk attached and even we added a New Virtio disk for  windows guest system boot disk .Now it time to close the custom windows , Once you close it your new windows guest installation screen will Pop Up .
Follow the On screen Instruction of windows installation , after you select the Custom Install you will get a below screen to Load drivers for the Virtio Disk .Now Select Load Drivers-->Browse or Rescan , you will find all the drivers attached from the virtual floppy for this windows guest.
Select Red Hat Virtio for Scsi Controller for windows 2008 and Click Next , then you Proceed your windows guest  installation as per on screen instruction.

Sunday, 26 December 2010

RedHat / Centos minimal services

I always disable most of the services witch are activated by a default Centos 5.5 instalation
To disable them, run the following commands:
chkconfig anacron off
chkconfig apmd off
chkconfig atd off
chkconfig autofs off
chkconfig cpuspeed off
chkconfig cups off
chkconfig cups-config-daemon off
chkconfig gpm off
chkconfig isdn off
chkconfig netfs off
chkconfig nfslock off
chkconfig openibd off
chkconfig pcmcia off
chkconfig portmap off
chkconfig rawdevices off
chkconfig readahead_early off
chkconfig rpcgssd off
chkconfig rpcidmapd off
chkconfig smartd off
chkconfig xfs off
chkconfig ip6tables off
chkconfig avahi-daemon off
chkconfig firstboot off
chkconfig yum-updatesd off
chkconfig mcstrans off
chkconfig pcscd off
chkconfig bluetooth off
chkconfig hidd off
And you might consider disable this:
chkconfig sendmail off
chkconfig xinetd off
chkconfig acpid off
chkconfig microcode_ctl off
chkconfig irqbalance off
chkconfig haldaemon off
chkconfig messagebus off
chkconfig mdmonitor off