Friday, 20 February 2009

Test disaster recovery (MBR curruption) of Redhat AS 4 on vmware workstation 5:

Test disaster recovery of Redhat AS 4 on vmware workstation 5:

Test Disaster Recovery Procedure:
1. Backing up MBR.
2. Currupting the MBR.
3. Booting off the Live CD.
4. Mouting root file system.
5. Restoring MBR from the backup in step 1.


Step 1: Backing up Master Boot Record (MBR)

What is MBR:
The MBR is a 512 byte segment on the very first sector of your hard drive composed of three parts: 1) the boot code which is 446 bytes long, 2) the partiton table which is 64 btyes long, and 3) the boot code signature which is 2 bytes long.

Using dd command we will be backing up the MBR which consists of 512 bytes.

What is DD:
Disk Definition (dd) came from IBM's Job Control Language and became a staple of the low-level UNIX and Linux commands. What dd does is copy bytes from an input source (if) to an output source (of). But dd can also copy raw data as well, which makes it perfect for copying boot sectors. The dd command can handle many tasks including: disk cloning (Note: Target disk must be of equal size or greater than the original disk)disk imaging,partition cloning, restoring from image file.

[root]# dd if=/dev/sda of=/backup_of_mbr bs=512 count=1
1+0 records in
1+0 records out
[root]#


For IDE devices: Its hda, for SCSI devices: its sda, check your scenario.

I have backedup MBR on the root. It's advisable to backup MBR to an external disk such as USB, CD or a differnt drive.


Step 2 : Currupting the MBR.

We will kill the MBR but leave the partition table intact by simply currupting the boot-code of 446 bytes of the total 512 bytes.

[root]# dd if=/dev/zero of=/dev/sda bs=446 count=1
1+0 records in
1+0 records out
[root]#

For IDE devices: Its hda, for SCSI devices: its sda, check your scenario.


Error on the reboot:

The master boot record (MBR) of this virtual machine's hard disk does not contain valid bootstrap code. It is likely that the MBR was corrupted by an incorrect guest operating system installation or some other reason. The virtual machine cannot continue and will now power off.

Step 3 : Booting off the Live CD or from an ISO image of the CD.

If you have a Live CD then simply insert the CD into the Drive and start the vmware machine. Note: make sure vmware has the control of the CD-ROM drive at this momment.

Or,

In case you have ISO image, then click on "VM" on the top menu bar of the vmware panel and select -"settings" | Click on CD-ROM under device | select "use ISO Image" | Browse to the ISO image of the Live CD.

Start the vmware machine.


Step 4: Mouting root file system.

a.You will be presented with redhat linux install options - In the command line Type : linux rescue [Enter]
b. Next sceen will ask you to "choose a language" , select "English" [Enter].
c. Select a keyboard type - choose "US" [Enter]
d. Do you want to start network interface on this system - Its up to you, i said NO b'cos i don't need a network, scope of this test is to Fix the currupted MBR.
e. You will now be presented with "Rescue" screen with following message :

The rescue environment will now attempt to find your linux installation and mount it under the directory /mnt/sysimage. You can then make any changes required to your system. If you want to proceed with this step choose 'continue'. You can also choose to mount your file system 'read-only' instead of read-write by choosing 'read-only'.

From the three options : Continue | Read-Only | Skip , Choose 'Continue', b'cos we want to mount the file system in read-write mode.


In the next screen "Rescue" , following message is displayed : Your system has been mounted under /mnt/sysimage . Press to get a shel. If you would like to make your system the root environment, run the command:

chroot /mnt/sysimage

Press [Enter]



Following message is displayed in the next screen :
Your system in mounted under the /mnt/sysimage directory. when finished please exit from the shel and your system will reboot.

-/bin/sh-3.00# [This is the shel you wil get, enter the following command]
-/bin/sh-3.00# chroot /mnt/sysimage


sh-3.00# [Now you are back in business, just type 'ls' to get the list of items and to see the backup file you created in step1].

sh-3.00# ls [Enter]
backup_of_mbr boot halt lib misc proc selinux tmp
backup dev home lost+found mnt root usr
bin etc initrd media opt sbin sys


You can see the backup file 'backup_of_mbr' up there...

Note: I hope you remember i saved the backup file 'backup_of_mbr' on the root itself that is - "/".

Step 5: Restoring MBR from the backup done in step1.

At the following shel type :

sh-3.00# if=backup_of_mbr of=/dev/sda bs=446 count=1
1+0 records in
1+0 records out
sh-3.00#



Finally, remove the "live cd" or "ISO image" and type "exit" at the shel command, and once again type 'exit' as shown below:

sh-3.00# exit [Enter]
-/bin/sh-3.00# exit [Enter]
logout..
rebooting the system....



That's it - You are back in business, your linux will boot off normally as if nothing happend. This was a very small excercise to demonstrate how to overcome currupt MBR issues as long as you have a proper backup of the same. Iam a beginner in linux hence there may be mistakes which i don't know untill someone points to me but i hope i will learn as i grow further.

Wednesday, 21 January 2009

Free VMware Workstation without the need to create your own virtual machine:

To help you get the most out of your free evaluation of VMware® Workstation, here is the quick easy way to get your first virtual machine up and running.

Try VMware Workstation without the need to create your own virtual machine, you can download a free "virtual appliance" with Linux .

Download a free "virtual appliance: (Linux OS + Firefox browser pre-installed)

http://www.vmware.com/appliances/directory/80?src=EM_08Q4_VMW_OTHER_WORKSTATION-EVAL-CAMPAIGN_EM2&ossrc=EM_08Q4_VMW_OTHER_WORKSTATION-EVAL-CAMPAIGN_EM2&elq=C1416441A8CA488BA692DCEE197DB9BA

Courtesy:VMware

Wednesday, 14 January 2009

What is virtualization ? By, Vmware.

Virtualization is a trend that is sweeping enterprise IT across the globe. Overall 7 million servers are shipped every year world wide. Out of those 6 million servers are Intel Architecture X86 and these are getting deployed in the enterprise data centres world wide. In a traditional environment there are single application running on single OS on a single machine and they are sprawled across the data centres, this leads to a tremendous cost in the number of areas - in terms of Hardware, data centre facility cost, interms of operational maintainance and management cost.


To address this overwhelming pressures, what enterprise IT has found is the most compelling tool called "Virtualization Technology" (VT). Across these millions of single servers the average utilization is just about 5-10%. This indicates they are barely utilized to its capacity. So what VT does it allows you to take advantage of this under utilized resources as well as the fine granined technology to RUN these envrionments side by side on much lower number of PHYSICAL SERVERS. To illustrate this, we take these environments it could be databases, webservers, e-commerce application, business application and you take them and consolidate them into much smaller number of physical servers. Each of these environment now runs side by side on a single machine and each of them is fully isolated and encapsulated.

What that means is - There is a Hardware Layer and top of it is the "Virtualization Layer" that enables all this and on top of this you have each of these environments whether it is databases,webservers ,business applications etc. They all have their separate operating-system (It coud be UNIX, LInux, Windows, Solaris etc) and on top of this runs each of this applications side by side on the single machine. The most facinating this is that - each of this virtual servers has its own CPU, memory, ethernet Nic, disk. They all run in a isolation just as they would run in a physical enviornments.


What all this means to IT companies is - Tremendous savings. Earlier IT organizations use to run 800 servers for various applications are now able to consolidate that down to just 60 servers. ROI is tremendous.

In addition to that, it also completey changes how customers can provision their application, their server environments. For example - How you initiated new server, new applicaiton softwre earlier...? Putting this out into your data center took number of weeks - to procure the hardware, to install the OS and then patch it with service packs, install the application and confifure that. Phew!!!!

Now all these is a software, hence initiating this is a matter of minutes.

Basic's of storage networks (An insight into - How we got to, where we are today..')

Thursday, 3 April 2008

SAN explained in most simplest way.......

There are loads of books on Storage especially Storage Area Network (SAN) but very few can explain SAN in few words that too in a lay man method. Well, i really appreciate Gary for this piece of information, the way he walked through the LAN network , followed by SAN in just 4 odd minutes, brilliant stuff . Even my 'mom' understands what is SAN now.



Thanks, Gary.

Courtesy: Youtube.

All SAN aspirants, a peek inside the server room, check this out.

Usually, its difficult for the fresh IT proffesionals trying to break into SAN career to get inside the server room and play with big toys (machines) unless you are a freelance consultant, or directly employed with the IT company.


This is a cool video for all those who wants to get a feel of SAN technology to start with..



Courtesy: Yotube

Thursday, 29 November 2007

Welcome to the world of virtualization: vmware

Problem: More work on less hardware , with less people and less time.
Solution: Vmware virtulization.

What is virtulization:
The software layer providing the virtualization is called a virtual machine monitor or hypervisor.
Its basically a emulated set of hardware, they just give u virtual hardware environment, you need to install the real operating system and real application. They dont give u packed-up vesion of OS, no, they are not giving you virtual OS, its virtual hardware . Iam here talking about the vmware-workstation product. They just take the existing hardware and present to you as new set of hardware (virtual) , you need to install the real OS and applications on top of it.

Note: Applications & OS are real, only hardware is emulated.

With vmware, you can have multiple applications in your single machine, independent of each other, each application has its own OS and own set of virtual hardware. virutal hardware is identical where ever you go, virtual machine can be moved from machien to machine , b'cos of the hardware independece between the virtual machines.

Virtual hardware:
CPU:CPUS is something they dont emulate, CPU is allocated to different virtual machine, therefore they pass the instruction directly through from guest OS (virtual machine) down to the physical processor.

Memory: Memory is something they don't emulate, , memory is allocated to virtual machine, but the instructions are again sent thru to physical memory but, they do emulate all the other hardware like :Network card, serial & parallel ports, cdrom, floppy drive ,key board, mouse etc.

Now, with vmware , you can have multiple applications on the single host OS, b'cos they have their own virtual hardware, own protected memory and own environment, independent of other virtual machines. They are completely isolated machines, if anything happend to one virtual machine ,it does not affect the other virutal machine or the host OS.

Real world problem : You have a OS, which has complete control over the hardware, which then parcels out the resources to one or more applications. There are two problems with this ,which hurts the management of this system.

Application is completely dependent on OS configuration, different Applications means different service packs, OS service packs, and they can even crash the hardware if they misbehave with the OS, and they could misbehave in terms of driver, service packs, etc. Different applications shares the same hardware, so they can not work well together.

Os is tied to the hardware, thru its driver, kernel, because of its dependence on the hardware, it can not be moved easily, where as vmware virtual machine is basically a "file", therefore it can be moved to another mahine in matter of seconds, b'cos of its hardware indepedence across all hardware platform , across all os, the vmware emulated hardware remains the same.

Feature : Paritioning
1. Run multiple OS on one physical machine.
2. Fully utilze server resources.
3. SCSI reservations enable clustering.


Feature: Isolation & Workload Management
1. Key: Uses CPU harware (Protection)
2. Fault, performance, and security isolation.
3. CPU, RAM, Disk, and network resource controls.

Feature: System Encapsulation
1. Entire state of the VM is encapsulated: (Memory, disk images, I/O
device state)
2. VMs state can be saved to a file: (Checkpointing, aka "suspend/resume"
3. VM state can be transfered thru time and space :(Time: Store in a file, Space: Transfer over a network)


For more information on this cool technology, you can visit: http://www.vmware.com/