1.How to take the backup and restore MBR? Why do you require to take the backup of your MBR?
Ans : MBR (Master Boot Recorder) is a vital part of your hard disk which contains booting information, without it its difficult to boot the system. Suppose you have windows and Linux duel boot on your machine and as you know windows is more prone to virus attacks. So it’s always better to backup your MBR to be in safe place.
2. How to take backup of your MBR?
Ans : Using dd command (dataset definition). Here are the steps to take backup of you MBR and keep it in safe place to restore your system if it get corrupted.
#dd if=/dev/hdx of=/safe/location bs=512 count=1
Let me explain the above command how it will work.
“If” in the command is nothing but to specify Input File, here we are specifying our input file as hard disk(if the hard disk is /dev/hda it is primary master, so for general purpose I given 'x'). “of” in the command is nothing but to specify Output File, here we are specifying our output file as /safe/location. Then “bs” this is nothing but block size to write in to hard disk. And then “count” nothing but how many times you want to write date this many block sizes. Here in this example count=1 that means first 512 bytes of the hard disk is copied to the specified location.
3.How to restore the MBR?
#dd if=/safe/location of=/dev/hdx bs=512 count=1
Note : Please replace “hdx” with your hard disk name.
This is bit complex, Is there any other way to restore MBR?
Yes, if you have Linux or Windows bootable CD, we can easily restore your MBR if you forgot to take backup(And this method is very much easy to do restoration of MBR when compared to previous method).
Method1 : With Redhat Linux bootable CD.
For this you have to boot your system to rescue mode, then mount your file system to rescue mode and execute below command to restore your MBR
#grub-install /dev/hdx
Note : Please replace hdx with your hard disk name. After that you just reboot your system. Your system will be live and working.
Method2 : With Windows XP bootable CD.
Step1 : Boot the system with XP bootable cd
Step2 : Press f8 to go to repair mode in Windows
Step3 : Once you got the c drive prompt just type below command
Fixmbr
This command will fix the MBR record.
Some FAQ’s
1. What is the MBR size?
Ans : MBR size is just 512 bytes.
2.What MBR conations?
Ans : Mainly MBR can be divided in two parts
a.Boot loader information block(which is of 448 bytes)
b. Partition table information(which is of just 64 bytes)
3.How many partition we can create on a hard disk?
Ans : Totally we can create four partitions as below
a.Four primary parathions.
b.Three primary and one extended partition.
c.Two primary and one extended parathion.
d.One primary and one extended parathion.
Note : In extended parathion we can create logical partitions up to 24 in number.
4.Why we cannot create more then 4 partition as mention above?
Ans : In MBR, the partition table info is just stored in 64 bytes, and one parathion information to store in MBR requires 16 bytes of space. So at most you can create only 4 partitions as mention above.
Please Comment your thoughts regarding this post:-)
How To Take The Backup Of MBR(Master Boot Recorder)
2 comments 11/13/2009 07:53:00 AM Posted by Meghana M BhombhoreLabels: Administration, Basic-Security, Basics, Boot Troubleshooting, How-To's
10 Commandments !! U like it for sure!!
0 comments 6/23/2009 03:56:00 AM Posted by Surendra Kumar AnneLabels: Basic-Security, Boot Troubleshooting, Desktop, Disk Troubleshooting
This is a guest post by Praveen
10 COMMANDMENTS !! U LIKE IT FOR SURE !!=>1 People are illogical, unreasonable, and self-centered. Love them anyway.
=>2 If you do good, people will accuse you of selfish, ulterior motives. Do good anyway.
=>3 If you are successful, you will win false friends and true enemies. Succeed anyway.
=>4 The good you do today, will be forgotten tomorrow. Do good anyway.
=>5 Honesty and frankness make you vulnerable. Be honest and frank anyway.
=>6 The smallest men and women with the smallest minds can shoot down the biggest men and women with the biggest ideas. Think big anyway.
=>7 People favor underdogs, but follow only top dogs. Fight for a few underdogs anyway.
=>8 What you spend years building may be destroyed overnight. Build anyway.
=>9 People really need help, but may attack you if you do help them. Help people anyway.
=>10 Give the world the best you have and you’ll get kicked in the teeth. Give the world the best you have anyway.
Monitoring users - I
0 comments 6/21/2009 04:54:00 AM Posted by Surendra Kumar AnneLabels: Administration, Boot Troubleshooting, User-Mgmt
MONITORING USERS-I
User-management is always one of the basic tasks for Linux administrators, here we are going to see some basics user related "Monitoring Commands".
1) "finger" is a command which will give full details about user properties such as name, login, shell what he is using etc.
Syntax:
#finger username
Example:
[root@localhost ~]# finger root
Login: root Name: root
Directory: /root Shell: /bin/bash
On since Sat Jun 6 19:20 (EDT) on tty1 4 hours 12 minutes idle
On since Sun Jun 7 02:18 (EDT) on pts/0 from :0.0
On since Sun Jun 7 03:48 (EDT) on pts/1 from :0.0
16 minutes 9 seconds idle
New mail received Sun Jun 7 04:02 2009 (EDT)
Unread since Sat Jun 6 22:17 2009 (EDT)
No Plan.
Here you can see so many user related information
one security information you can see is when he loged in last time and from where he loged in etc.
2)"id" is one more command which will show the user details such as his primary group and his secondary group.
Syntax:
#id username
Example:
[root@localhost ~]# id root
uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel) context=root:system_r:unconfined_t:SystemLow-SystemHigh
[root@localhost ~]#
3)"chage" is one more command which is used to see user related "threshold details" such as user disable time etc.
Syntax:
#chage -l username
Example:
[root@localhost ~]# chage -l root
Last password change : Jun 06, 2009
Password expires : never
Password inactive : never
Account expires : never
Minimum number of days between password change : 0
Maximum number of days between password change : 99999
Number of days of warning before password expires : 7
[root@localhost ~]#
4)"who" is one more command to see who other people logged in and from where they logged in.
Syntax:
#who
Example:
[root@localhost ~]# who
root tty1 2009-06-06 19:20
root pts/0 2009-06-07 02:18 (:0.0)
root pts/1 2009-06-07 03:48 (:0.0)
[root@localhost ~]#
5)"w" is one more command which is similar to "who" command but will give some more details.
Example:
[root@localhost ~]# w
06:36:49 up 11:23, 3 users, load average: 0.54, 0.38, 0.42
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
root tty1 - 19:20 4:27m 0.69s 0.69s -bash
root pts/0 :0.0 02:18 0.00s 0.16s 0.02s w
root pts/1 :0.0 03:48 31:25 0.10s 0.10s bash
[root@localhost ~]#
6)"groups" is one more wonderful command which will show which user belongs to what groups, we can say its a subset of id command
Syntax:
#groups username
Example:
[root@localhost ~]# groups root
root : root bin daemon sys adm disk wheel
[root@localhost ~]#
7)"users" is one more monitoring command to see which users loged in at present in to the system
Example:
[root@localhost ~]# groups root
root : root bin daemon sys adm disk wheel
[root@localhost ~]#
Please add if you know some other user related monitoring commands.


