Home > Enterprise Linux Tips > Administrator > How to fix master boot record partition table problems
Enterprise Linux Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

How to fix master boot record partition table problems


Sander van Vugt, Contributor
Rating: -4.50- (out of 5)

In the last part of this series, you have learned how to recover from problems occurring in your Master Boot Record. It has showed you how to get it back once it has been removed. Here we continue with troubleshooting the partition table of the Master Boot Record. Without a partition table, you cannot access any of the information on your computer's hard drive, so if it gets lost, recovering it is critical.

In general, you can encounter two different kinds of problems in regard to partitions. You may have lost the complete partition table, or you may have a problem with the file system on a partition. Here, you'll learn how to recover the partition table. To do this, you need your rescue CD and to find the exact information about the beginning and end of the partitions on your server's hard disk. Once you've found that, use to recreate the partitions. The following procedure sho...


RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
Heartbeat  (SearchEnterpriseLinux.com)
tty command  (SearchEnterpriseLinux.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary


ws how to do this.

1. Start your server from the rescue CD and make sure that you open a console where you have root permissions.

2. Type to scan your hard drive for all partitions. This may take between five seconds and an hour. Once finished, it will show you partition information:

Evaluate the information that gpart provides carefully, after all, gpart stands for guess partition. It guesses, nothing more, nothing less. On the example server I have swap in a logical parition /dev/sda5. As you can see, gpart found the swap partition with its correct size, beginning and end on disk, but couldn't find that it was a logical partition. Based on this information, you would try to recreate the swap partition on /dev/sda2. Your server would boot with that, but would give errors as well. But, that doesn't really matter because once booted you can check system files like /etc/fstab to find the partition your swap originally was, and repair the partitions.

3. Now that you have found the original partition boundaries, write them down and start fdisk using . This shows you a message about your disk's size, ignore that and type to start the interface to create a new partition. Next, type to create the first primary partition. It asks what partition number you want to assign, type .

4. Next comes the important part: you have to specify where the partition originally started and ended. To find this information, you need the C/H/S line in the gpart output for this partition. Consider the line below:

In this line, the first number between brackets indicates the original starting cylinder, which in this example is cylinder 0. The second series of numbers between brackets tells you where the partition originally ended, in this case that is on cylinder 992. There is one catch though: in fdisk the first cylinder is cylinder 1. That means that all other cylinders as displayed with gpart need to be incremented with 1. So, you have to create a partition now that starts at cylinder 1 and ends on cylinder 993. Repeat steps 3 and 4 to recreate your other partitions as well and then close fdisk using the command. Fdisk probably gives a message now that the new partition table can be used only after a reboot. The example below shows what has happened so far: to get an overview of available partition types, and use to change the type of a partition. Don't forget to reboot after changing your partition table.

So now you have learned how to get back your partitions if they were lost. The next part in this series will teach you how to fix problems with LVM logical volumes.

ABOUT THE AUTHOR: Sander van Vugt is an author and independent technical trainer, specializing in Linux since 1994. Vugt is also a technical consultant for high-availability (HA) clustering and performance optimization, as well as an expert on SLED 10 administration.

Rate this Tip
To rate tips, you must be a member of SearchEnterpriseLinux.com.
Register now to start rating these tips. Log in if you are already a member.




DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



Enterprise Linux Web Server & Application Server
HomeNewsTopicsITKnowledge ExchangeTipsBlogsAsk the ExpertsMultimediaWhite PapersIT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2003 - 2010, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts