4
2
I was going to install a completely fresh Linux distribution (Mageia) and I saw it as an opportunity to reorganize my partitions. I wanted all my non-Linux (Windows, restore, etc) partitions at the beginning and my Linux ones at the end so I can more easily create new Linux partitions if I want to test some more distributions.
I used GParted to delete the existing Linux partitions (I backed up the data wanted to preserve) and moved the remaining ones to the front. I would later create the Linux partitions in the Mageia installer.
It took some time but in end GParted finished without problems. Mageia was installed without a hitch too.
When booting into Mageia I had some (unrelated?) issue with the ATI Radeon video card (still unresolved) that leaves me with just the console and when rebooting I saw Error: Can't have overlapping partitions
zipping by.
No problem, I thought, I'll just boot GParted again and fix it. Alas, GParted shows the whole disk as unallocated. OK, back to Linux. Starting parted from command line gives me
[root@localhost ~]# parted
GNU Parted 2.3
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
Error: Can't have overlapping partitions.
fdisk
should give me more info and it did:
[root@localhost ~]# fdisk -l -u /dev/sda
Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x2bd2c32a
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 206847 102400 7 HPFS/NTFS
/dev/sda2 208845 1953520064 976655610 5 Extended
/dev/sda3 950740992 1013655551 31457280 7 HPFS/NTFS
/dev/sda4 1013655552 1015754751 1049600 12 Compaq diagnostics
/dev/sda5 208896 409808895 204800000 7 HPFS/NTFS
/dev/sda6 409810944 950740991 270465024 7 HPFS/NTFS
/dev/sda7 1015757883 1034184374 9213246 82 Linux swap / Solaris
/dev/sda8 1034184438 1953520064 459667813+ 83 Linux
If I sort by partition start it seems that /dev/sda5
and /dev/sda6
should be called /dev/sda3
and /dev/sda4
and vice versa.
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 206847 102400 7 HPFS/NTFS
/dev/sda2 208845 1953520064 976655610 5 Extended
/dev/sda5 208896 409808895 204800000 7 HPFS/NTFS
/dev/sda6 409810944 950740991 270465024 7 HPFS/NTFS
/dev/sda3 950740992 1013655551 31457280 7 HPFS/NTFS
/dev/sda4 1013655552 1015754751 1049600 12 Compaq diagnostics
/dev/sda7 1015757883 1034184374 9213246 82 Linux swap / Solaris
/dev/sda8 1034184438 1953520064 459667813+ 83 Linux
From googling I found that testdisk
can fix this.
- How do I use
testdisk
? The interface is quite confusing. - Can I run it from Linux/Windows or should I boot a live version?
Thanks in advance,
Nick
I followed the instructions in the answer below but it doesn't work.
These partitions I have to re-create:
/dev/sda3 950740992 1013655551 31457280 7 HPFS/NTFS
/dev/sda4 1013655552 1015754751 1049600 12 Compaq diagnostics
This is what happens:
[root@localhost ~]# fdisk /dev/sda
Command (m for help): d
Partition number (1-8): 3
Command (m for help): d
Partition number (1-8): 4
Command (m for help): n
Command action
l logical (5 or over)
p primary partition (1-4)
l
First sector (950743040-1953520064, default 950743040): 950740992
Value out of range.
First sector (950743040-1953520064, default 950743040):
The 1st partition needs to start at 950740992 but the new one may only start at 950743040.
How do I proceed?
It seems possible to migrate a question. How do I do that? – Koohoolinn – 2012-01-29T11:15:09.167
You can either flag it for moderator attention and ask for migration or post to the "Vote to close" chat channel - a migration needs five migration votes from higher-reputation users. – None – 2012-01-29T17:39:01.070