I have read the posts and decided to follow it to do it, Change the number of the partition from sda1 to sda2, made by Joao S Veiga. I thought it would be light-risk because renumbering partitions seems doesn't touch my datas but only MBR, though it is warned that it is not a good idea to do it. But now most of my partitions lost (NTFS and ETX4), even restoring MBR to my disk doesn't work. Try to mount one partition mount /dev/sda6 /mnt in the terminal failed and puts an error message: ...wrong fs type, bad option, bad superblock on /dev/sda6, missing codepage or helper program, or other error.

Do I have chance to restore partitions and my datas?

  • 3
    Which "the posts" did you read. I don't know how to solve the problems you might get in Windows after renumbering the partitions. In Linux you have to change all commands or table entries that reference a partition by its number, e.g. replace the 6 in mount /dev/sda6 /mnt to the new partition number after renumbering. If you change all partition numbers back to their original value everything should work as before. – Bodo Feb 18 at 12:51
  • In principle if you know exactly where a partition starts and stops you can just recreate it. Hopefully nothing you have done has corrupted any of your file systems. But you will need to tell us more about what you did (which commands you used) so we can help you undo the damage. – Philip Couling Feb 18 at 13:39
  • @Philip Couling: Restoring MBR is enough for me? fdisk can delete the partition and recreate it, MBR seems simple, why don't work? – maggicmuojet Feb 19 at 5:57
  • @maggicmuojet the most likely thing is that you didn't re-create them with the same size and position as before. You only have get the position one sector out and you will make the partition unreadable. – Philip Couling Feb 19 at 7:53
  • 1
    Note that in MBR partitioning scheme, only partitions 1-4 are primary partitions and so their partition information is in the actual MBR block. Partitions with numbers 5 or greater are "logical partitions", meaning that one of the primary partitions must be used as an "extended partition", which can then be further sub-divided into "logical partitions", each of which will have its own partition information block located just before the beginning of that partition. I guess something is wrong with this chaining/encapsulation scheme. – telcoM Feb 19 at 8:05


In future you might want to backup the first few MB of your hard drive with dd before doing something drastic. That would at least have given you a way back.

Now that you are here, its not great news. To be able to get back you need to know the exact size and position of every partition. Without this you are in real trouble.

What can you do to recover?

If you just lost sizes

You might not need them. You can assume every partition filled up all space up to the next partition. You should be able to calculate a size from that.

Fortunately most file systems don't mind being given extra space. So for example: if you accidentally forgot your swap partition, the ext4 partition before it wouldn't mind being finding itself on a larger partition (absorbing space from the swap partition).

If you lost everything

Your last chance is to try to detect your partitions using their magic number or other similar feature. Each / every file system should have a "magic number" at a predictable position in it's first sector. If you find the details of each file system you use (NTFS, EXT3, etc...) you might be able to scan every sector on your HD looking for one containing the correct magic number. There's no guarantee this won't find other sectors that happen to contain the same sequence in the right place, so it might come to a matter of trial and error.

  • This might mean you have to write your own program to do this.
  • There might be data recovery software you can purchase that would do this for you.
  • Data recovery specialists might be able to take the drive of your hands and do it for you.

Which option you chose will be based on how confident you are doing the work yourself, how valuable the data is and how much you are willing to spend to get it back.

Also double check

You mentioned MBR. Just double check that your actions to renumber your partitions didn't result in a GPT partition table replacing your MBR table. That could have thrown something off when you recreated your partitions.

  • 1
    testdisk can be used to scan the contents of a disk, find the standard structures at the beginning of partitions and so reconstruct a corrupted partition table. – telcoM Feb 19 at 8:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.