Jump to content


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.

Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.


Messed Up Partition Table (fdisk's Fault?)

  • Please log in to reply
3 replies to this topic

#1 KingLear


  • Members
  • 15 posts
  • Location:US
  • Local time:04:21 AM

Posted 31 July 2008 - 10:54 PM

It was recommended to me that, when arranging partitions, some very strict guidelines should be followed. Specifically, the extended partition, should be in the fourth primary partition, and all the device names should correspond to the order of the blocks on the filesystem. The specific tool, written on the forum disk, was using fdisk, with the advanced command "f" (fix partition order). The forum topic was http://forums.virtualbox.org/viewtopic.php...4cb90311b3536f6

Well, my partitions were out of order, so I decided to give it a shot. I ran fdisk, it reordered things, and the new fdisk -l looked pretty good.

I loaded up GParted to do some extra partition editing, and I was quite dismayed to find that Gparted thought that the entire /dev/sda was unallocated! I also checked using cfdisk, and it complained that the partition 3 "ended in the final partial cylinder" and refused to show me my partition table. Only fdisk could read the table... and the operating systems still ran, but my partition tools were useless.

This error has occurred multiple times before, but the usual solution has been to wipe and repartition your disks from scratch, something I am not keen on doing especially with a Vista install. I strongly suspect that fdisk has done something flaky with the partition table, and I suspect fdisk should be able to fix this, but I don't know how. Any suggestions?

BC AdBot (Login to Remove)


#2 machiner


  • Members
  • 56 posts
  • Gender:Male
  • Location:USA, New England
  • Local time:01:21 AM

Posted 01 August 2008 - 09:47 AM

That whole dogmatic extended partition needing to be the 4th one is silly. In fact, if you install Debian and allow it to make partitions for you, it will make the first partition primary and then immediately make an extended one for you in the next partition for all your logicals.

What distro are you using? What filesystem are you/do you want to use? Are you using a Dell box with software RAID? Are you using your SATA drives in 3GB mode or 1.5? Have you checked your partitions for errors?

Using fdisk can be hazardous, as well as cfdisk. Gparted is very reliable but you may not have the right support tools installed. I always boot to system rescue disc and use gparted that way. Never lets me down.

We need more info --

#3 KingLear

  • Topic Starter

  • Members
  • 15 posts
  • Location:US
  • Local time:04:21 AM

Posted 01 August 2008 - 02:15 PM

Thank you for the quick response!

What distro are you using?

Dual-boot with Windows Vista and Ubuntu Gutsy Gibbon.

What filesystem are you/do you want to use?

My two existing Windows partitions (one for the OS/data and one for the recovery disk) are NTFS. My Linux partition(s) reside on the extended partition and are formatted ext3, except for one that is a swapfile.

Are you using a Dell box with software RAID?

I am on a Dell Vostro 1400. I'm using factory default settings, and I'm not sure how to check for RAID, but I don't think it's enabled, since my disk capacity is close to that of the physical limit.

Are you using your SATA drives in 3GB mode or 1.5?

Looking up my device name ST9160823ASG gives me the result that I am in 3GB mode.

Have you checked your partitions for errors?

I have run chkdsk on my Windows partition using the Windows Recovery CD; one bad file was found and fixed, and my C: partition is now in working order. I have not checked my Linux partitions, but they mount and run fine.

Using fdisk can be hazardous, as well as cfdisk.

What is your opinion on sfdisk?

Gparted is very reliable

I have used both a Gparted CD and a System Rescue CD to run the utility, as well as a copy of GParted I installed inside Ubuntu (obviously that copy isn't that useful, since the important filesystems are mounted when it runs). They all report that the drive is allocated.

Some more information after I did some testing:

sfparted reports two errors with my partition setup: the first is that the Windows volumes end and begin in partial cylinders. I believe this was the same way when I installed Windows, since from what I've read it seems not to respect cylinders. This would be, I suspect, the error cfdisk was complaining about. The second error is that the extended partition (/dev/sda4) extends beyond the physical boundary of the disk. This should be something I can easily fix; the last 1.5 GB of this extended partition is unallocated, but I can't figure out how to do an operation like this using the tools I have.

When I run parted, the command-line ncurses equivalent of gparted, it reports that it cannot fulfill all constraints on the partitions, and exits. When I run it and tell it to ignore errors, it gives the same view as Gparted.

As of right now, I've fixed the Grub bootloader so it now displays the menu (since the fdisk reordering changed drive names, grub was looking in the wrong spot for the linux kernel), and Windows and Linux booting works. As it stands:

1. I can read /dev/sda using fdisk (no errors), sfdisk (two errors) and Windows Computer Management (all healthy)
2. I get an empty allocation for /dev/sda using parted, gparted
3. I cannot read /dev/sda with cfdisk
4. Both Windows Vista and Ubuntu boot

Additionally, Sun xVM VirtualBox still reports that my partitions overlap (the original problem that prompted me down this path of partitioning mess).

Are there any other partitioning tools you recommend I look into for getting these problems fixed? Also, if I end up having to repartition my drive from scratch, what would you recommend I use to perform a full backup of my OSes, applications and data? (I would prefer not to have to recompose them from scratch).

I'm currently booted into Vista; shortly I'll boot into Ubuntu and give you the output of fdisk and sfdisk.

#4 raw


    Bleeping Hacker

  • Members
  • 2,577 posts
  • Gender:Male
  • Location:Texas
  • Local time:03:21 AM

Posted 07 August 2008 - 07:29 PM

TestDisk is a powerful free data recovery software! It was primarily designed to help recover lost partitions and/or make non-booting disks bootable again when these symptoms are caused by faulty software, certain types of viruses or human error (such as accidentally deleting a Partition Table).


TestDisk how-to:


 rawcreations.net          @raw_creations

Current systems: WHAT OS, BackTrack-raw, PCLinuxOS, Peppermint OS 6, Kali Linux

and a custom Linux From Scratch server hosting a bunch of top secret stuff.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users