Page 1 of 1
[Solved] Another funny partition table

Posted:
Oct 16th, '14, 21:11
by turboscrew
I used to have a Windows 2000, and the partition was still left, as well as logical drives in the extended partition.
Then I installed Mageia.
Now I plabnned to install another OS to be dualbooted with mageia, but:

- gparted.jpeg (150.16 KiB) Viewed 1985 times
(Oops, a typo in the text file in the screen capture the latter sda3 should have been sda4)
- Code: Select all
sda1: 63 - 204780554 (ntfs)
sda2: 204780554 - 700112699 (extended)
sda5: 204780618 - 346040099
sda6: 346040163 - 348144614
unallocated: 348144615 - 488398847
sda7: 488398848 - 700112699
sda3: 348145664 - 456396799 (primary ext3 - Mageia - inside unallocated region in sda2)
sda4: 456396799 - 488396799 (primary swap - Mageia - inside unallocated region in sda2)
unallocated: 488396800 - 976773167
gparted-live 0.19.1-4-amd64 yells about overlapping partitions and primary partitions within extended partition.
[edit]
Oh, and the numbers like 63 and 204780554 in "sda1: 63 - 204780554 (ntfs)" are sector numbers to figure out where
the partition actually is and which partitions are overlapping (at least sda3 and sda4 seems to).
.
Re: Another funny partition table

Posted:
Oct 16th, '14, 22:31
by jiml8
So, is there a question here?
Yes, that partition table is screwed up. I suspect you will be able to use it, but pretty much every disk manager will have a problem with it, and I certainly wouldn't try to change it if I were you.
Best choice is to image that drive, then repartition it into something more rational. Then copy data from the image to the appropriate new partitions on the newly partitioned drive.
Re: Another funny partition table

Posted:
Oct 17th, '14, 00:16
by turboscrew
Mageia boots, but gparted complains in every tur, and . fdisk and cfdisk seem to refuse to do anything.
Also Samba shares that relied on mounts in /media are not working even if I didn't touch the partitions in use.
(/media/win_d and /media/win_e)
How could I make sda3 and sda4 non-primary? They are already located within extended partition.
That might fix things. I understand that it involves copying the two last partition table entries from MBR to
extended boot record of the extended partition and then clearing the entries in MBR?
But which program could do it?
Of course I have to do something to the partition overlaps too. Grub2 can be fixed with chrooting.
An alternative is that I remove Mageia partitions (root and swap) and create new ones as logical drives
(using gparted) and reinstall mageia all over again.
For some reason older (still free) partition magic doesn't seem to be able to handle ivy bridge graphics.
Re: Another funny partition table

Posted:
Oct 17th, '14, 08:51
by filip
I had similar problem in the past. I solved it with the help of this
GParted documentation.
Re: Another funny partition table

Posted:
Oct 17th, '14, 09:09
by turboscrew
Thanks! Right to the spot!
Darn, that would have been easy if I didn't create sda7 with Mageia disk manager.
Now it contains about 20 gigs stuff I don't want to lose.
Looks like I have to first deal with the overlaps.
Then I have to remove the swap to get one primary available
then make sda7 a primary (new sda4). Then extend the sda2 (extended) to cover sda3
(it probably becomes new sda7) and a swap-to-be.
I guess that would "uncorrupt" the partition tables and
dual boot OS installation should go normally.
Re: Another funny partition table

Posted:
Oct 17th, '14, 19:45
by turboscrew
Now that I read more carefully: not so simple.
The partition table is really messed up partitions overlapping with unallocated space.
I really have to plan my moves very carefully, and hope that the more valuable data is not already corrupted.
Re: Another funny partition table

Posted:
Oct 17th, '14, 20:29
by doktor5000
turboscrew wrote:How could I make sda3 and sda4 non-primary? They are already located within extended partition.
Huh? IIUC, that's already messed-up. Primary partitions cannot be located inside extended partions. Either you have primary partitions or an extended partition.
Re: Another funny partition table

Posted:
Oct 17th, '14, 23:32
by turboscrew
Yes, there seems to be something wrong with the Mageia disk manager.
Originally there was sda1 and sda2 containing sda5 and sda5. All the same sizes they are now.
They were copied from an old disk using dd to this new disk about twice the size of the old.
sda7 was also made with Mageia disk manager.
Funny that Mageia disk manager doesn't show the extended partition.
What makes it even funnier is that cfdisk refuses to work due to the primaries within extended.
When I remived sda4 with gparted (didn't write changes onto disk), sda4 was left, but sda2 disappeared.
Gparted also refused to grow sda2.
The partition table seems to be too messed up to be repaired with gparted.
Parted-magic CD refuses to boot on my machine. MD5SUM matched and checking of data written on CD returned 'success'.
I'm starting to feel a bit stuck, now that even the Samba shares stopped working...
Re: Another funny partition table

Posted:
Oct 17th, '14, 23:51
by jiml8
I would not be so quick to blame the Mageia disk manager. I've used it for years, and never seen anything like this. More than likely, there was a problem with your partition table before you used the disk manager on it, and the disk manager was therefore deceived about the state of your partitions.
I reiterate my earlier advice to you; image (or backup) that drive to save your data, then reformat the drive and reload it from the image (or backup). No tool is going to bail you out correctly. I, personally, am very good with these partition structures and I don't know if I could save it - and if I could, I would be using a hex editor on the partition table and the partition boot sectors in order to do it. Lots of work, fraught with peril. Much easier and safer to just start over.
Re: Another funny partition table

Posted:
Oct 18th, '14, 01:07
by turboscrew
image (or backup) that drive to save your data
I just don't have a disk onto which I could backup.
Before Mageia there was Linux Mint installed. I removed the partitions before installing Mageia.
So I must have seen the partitions "through the eyes of gparted".
Mint uses gparted.
(Mint couldn't handle my printer at all - after fighting a couple of months, I replaced Mint)
Also, sda3 and sda4 were created in Mageia install, and sda7 was added later (with Mageia disk manager).
If you look into the partition listing with that in mind, ...
Re: Another funny partition table

Posted:
Oct 18th, '14, 10:28
by doktor5000
Re: Another funny partition table

Posted:
Oct 18th, '14, 11:40
by turboscrew
Well, I started Mageia Live-DVD and with the disk manager (who can do it, probably can undo it)I removed sda3 and sda4.
It looked fine so I dared to write the partition table onto the disk.
Then I rebooted with Gparted Live CD, and got no error messages or anything.
The partition table became fixed.
PHOOH! I really lived some moments of horror.
There should be warning in the installer: "If your disk already has partitions not created with diskdrake, don't use diskdrake ".
The same warning could be given when one starts diskdrake from MCC.
Re: [Solved] Another funny partition table

Posted:
Oct 19th, '14, 02:41
by doktor5000
Well, it says to backup your data before working on the partitions.
Re: [Solved] Another funny partition table

Posted:
Oct 19th, '14, 02:53
by turboscrew
About 20 years of windows/linux dual boots (starting with Win 3.11/Redhat Picasso), and never managed to mess up partitions that bad.