[Solved] Another funny partition table

This forum is dedicated to basic help and support :

Ask here your questions about basic installation and usage of Mageia. For example you may post here all your questions about getting Mageia isos and installing it, configuring your printer, using your word processor etc.

Try to ask your questions in the right sub-forum with as much details as you can gather. the more precise the question will be, the more likely you are to get a useful answer

[Solved] Another funny partition table

Postby turboscrew » Oct 16th, '14, 21:11

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
gparted.jpeg (150.16 KiB) Viewed 1977 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).
.
Last edited by turboscrew on Oct 18th, '14, 11:41, edited 3 times in total.
Mageia 4.1 on GA-B75M-D3H / Intel i3-3220 CPU @ 3.30GHz RAM: 4GB
turboscrew
 
Posts: 75
Joined: Aug 3rd, '14, 11:49
Location: Nokia (town) Finland

Re: Another funny partition table

Postby jiml8 » Oct 16th, '14, 22:31

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.
jiml8
 
Posts: 1254
Joined: Jul 7th, '13, 18:09

Re: Another funny partition table

Postby turboscrew » Oct 17th, '14, 00:16

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.
Mageia 4.1 on GA-B75M-D3H / Intel i3-3220 CPU @ 3.30GHz RAM: 4GB
turboscrew
 
Posts: 75
Joined: Aug 3rd, '14, 11:49
Location: Nokia (town) Finland

Re: Another funny partition table

Postby filip » Oct 17th, '14, 08:51

I had similar problem in the past. I solved it with the help of this GParted documentation.
filip
 
Posts: 478
Joined: May 4th, '11, 22:10
Location: Kranj, Slovenia

Re: Another funny partition table

Postby turboscrew » Oct 17th, '14, 09:09

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.
Mageia 4.1 on GA-B75M-D3H / Intel i3-3220 CPU @ 3.30GHz RAM: 4GB
turboscrew
 
Posts: 75
Joined: Aug 3rd, '14, 11:49
Location: Nokia (town) Finland

Re: Another funny partition table

Postby turboscrew » Oct 17th, '14, 19:45

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.
Mageia 4.1 on GA-B75M-D3H / Intel i3-3220 CPU @ 3.30GHz RAM: 4GB
turboscrew
 
Posts: 75
Joined: Aug 3rd, '14, 11:49
Location: Nokia (town) Finland

Re: Another funny partition table

Postby doktor5000 » Oct 17th, '14, 20:29

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.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18067
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Another funny partition table

Postby turboscrew » Oct 17th, '14, 23:32

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...
Last edited by turboscrew on Oct 18th, '14, 00:55, edited 1 time in total.
Mageia 4.1 on GA-B75M-D3H / Intel i3-3220 CPU @ 3.30GHz RAM: 4GB
turboscrew
 
Posts: 75
Joined: Aug 3rd, '14, 11:49
Location: Nokia (town) Finland

Re: Another funny partition table

Postby jiml8 » Oct 17th, '14, 23:51

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.
jiml8
 
Posts: 1254
Joined: Jul 7th, '13, 18:09

Re: Another funny partition table

Postby turboscrew » Oct 18th, '14, 01:07

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, ...
Mageia 4.1 on GA-B75M-D3H / Intel i3-3220 CPU @ 3.30GHz RAM: 4GB
turboscrew
 
Posts: 75
Joined: Aug 3rd, '14, 11:49
Location: Nokia (town) Finland

Re: Another funny partition table

Postby doktor5000 » Oct 18th, '14, 10:28

You should read viewtopic.php?f=7&t=4255
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18067
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Another funny partition table

Postby turboscrew » Oct 18th, '14, 11:40

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.
Mageia 4.1 on GA-B75M-D3H / Intel i3-3220 CPU @ 3.30GHz RAM: 4GB
turboscrew
 
Posts: 75
Joined: Aug 3rd, '14, 11:49
Location: Nokia (town) Finland

Re: [Solved] Another funny partition table

Postby doktor5000 » Oct 19th, '14, 02:41

Well, it says to backup your data before working on the partitions.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18067
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: [Solved] Another funny partition table

Postby turboscrew » Oct 19th, '14, 02:53

About 20 years of windows/linux dual boots (starting with Win 3.11/Redhat Picasso), and never managed to mess up partitions that bad.
Mageia 4.1 on GA-B75M-D3H / Intel i3-3220 CPU @ 3.30GHz RAM: 4GB
turboscrew
 
Posts: 75
Joined: Aug 3rd, '14, 11:49
Location: Nokia (town) Finland


Return to Basic support

Who is online

Users browsing this forum: No registered users and 1 guest

cron