9

I am using Windows 10 on an old Pentium Laptop. It had 4 partitions: C,D,E (System Reserved) and F

I wanted to created unallocated space for CentOS.

I used Windows 10 Disk Management to shrink C: and create unallocated space for CentOS. I right-clicked C: and selected "Shrink". Shrink worked fine and created unallocated space. I right-clicked the new unallocated space and formatted and assigned drive letter L:.

After this, the F partition disappeared. In Disk Management and also in Windows explorer, it is showing Unallocated 60 GB.

Where that partition disappeared? Is there a way to recover F partition with data?

Edited: Screenshots below <<

I deleted the new partition and now the structure looks like this on TestDisk and DiskManagement respectively:

enter image description here .. enter image description here

5
  • 1
    Did you checked it with diskpart command line. Try to list disk and list partition to make sure F is still in your disk. As I think it would not disappear if you not delete it by mistake.
    – JoyQiao
    Commented Nov 26, 2018 at 8:12
  • 1
    I find it hard to believe that Windows would do such a thing as to silently (as in, surprise!) drop the last partition in favor of a newly created one. Are you serious? The max-4-primary-partitions thing has been well-known for 30+ years and has been addressed with "only 4 primary, must create secondary" prompt by any software I've ever seen. That being said, the data must still be there, and any half-serious partition tool should be able to re-create the original partition table entry (since both start and end are kinda well-known, shouldn't be an issue).
    – Damon
    Commented Nov 26, 2018 at 9:16
  • This question is on topic here, but people are answering as if you had asked on softwarerecs.stackexchange.com Maybe you ought to have?
    – Mawg
    Commented Nov 26, 2018 at 15:25
  • @Damon Yes I am serious. While shrinking and creating new partition, it didn't give any warning that the last partition would disappear. Now in Disk Management it is showing as unallocated which was F partition previously.
    – RPK
    Commented Nov 27, 2018 at 4:08
  • While this may or may not be the cause, it is something to keep in mind: BIOS/MBR only supports a max of 4 primary partitions. In order to get around this, you'd have to utilize one of the four primary partitions to create and extended [logical] partitions (LVM on Linux)
    – JW0914
    Commented Nov 30, 2018 at 13:45

3 Answers 3

1

The good news is that the data is still there and that doesn't change (unless you explicitly do something). If the data is still there, it can be recovered.

My approach would be to boot into a rescue disk (there are many options, one such thing would be the tell-tale SystemRescueCD. Then use parted (or gparted if you don't like command line) and rm the newly created partition there. That will leave you with 3 partition slots, one being free so you can re-create the lost one. Now run testdisk and hope for the best.
In the best case, pressing "Simple scan" will bring up both the just-deleted new partition and the one you want to recover within one second. In the not-so-good case, you will need to do a deep scan, which can take a while.
If testdisk, against all odds, doesn't find the partition, still all is not lost.

The partition was the last one, and it was located at the end of the disk, and of course it still is. There's no way it could have moved or gone away. As the end of E: is known, there's not a lot of guessing where formerly-F can be found (well there's possibly alignment to consider but that's no biggie, most likely you've used the default anyway, and almost certainly the partition tool will get it right anyway).

So, firing up any partition tool (even fdisk would do, but why not use parted if we have it!) and creating a new partition from the beginning of unallocated space at the end to "end of disk" (which pretty much every tool can do automatically) will do the trick. Only important thing to look out is to create the partition but not to format it, which some tools/commands may do automatically for convenience. Obviously, formatting or creating a file system will destroy your data, which is not what you want.
For parted the correct command for that would be mkpart (see documentation).

If anything short of accidentially formatting or the disk mysteriously exploding goes wrong, you can still always remove the partition and re-create it again. No sweat. The data in the partition is not affected, you're only tampering with the "container".

A more correct and safer approach would be to first create a mirror backup of the complete disk, and then perform the above. Though, seeing as actually not much can go wrong, I would personally be too lazy for that. If you are about to install CentOS, this suggests you're reasonably Linux-savy, so you might as well dd the disk (part of it) to an image, and work on the image instead. That, too, is safer.
Or, well, just go the real men road, which isn't the recommended way, but much faster and will work fine either way. It just depends on how vitally important that data is, I guess. If you aren't going to die in case the 0.01% that can go wrong do go wrong, well... you know.

Once the partition is restored, copy all files to another disk (preferrably two disks), then delete the partition and let parted move the D: and E: partitions further up so the hole from shrinking C: disappears. Lastly, create an extended partition filling all available space, and then two secondary partitions inside that one, of which one will finally hold CentOS and the other will hold the once-and-future drive F: (to which you then have to copy files again).

6
  • Thanks for the excellent answer. Let me try this.
    – RPK
    Commented Nov 27, 2018 at 10:28
  • Updated original post. Added screenshots. Please check.
    – RPK
    Commented Nov 28, 2018 at 6:06
  • So it seems testdisk isn't happy with it. Did you try parted? Typing print free will show all partitions including free space. You should see something like 260GB 320GB 60GB Free Space as the last entry. That tells you the proper numbers you need for mkpart. When asked for type, you give "primary", for start you give whatever the first number was including "GB", so something like "260GB" and so on... if there's alignment constraints it will tell you "closest we can do is... are you happy with that?" and then it creates the partition. With any luck (99% sure) you can then...
    – Damon
    Commented Nov 28, 2018 at 12:45
  • ... simply boot into Windows and reassing a drive letter.
    – Damon
    Commented Nov 28, 2018 at 12:45
  • But to assign drive letter, I will have to first create Simple Volume? TestDisk is showing them as Linux partitions. Strange.
    – RPK
    Commented Nov 28, 2018 at 13:11
14

You say it is a "Pentium laptop." However, that cant be accurate, as Windows 10 will not run on a Pentium CPU. I assume the laptop is far newer, but still old. And there lies your problem. Older non-EFI drives cannot have more than 4 primary partitions.

As for recovering your partition, there are many utilities out there that might be able to recover it. You should stop using that computer and remove the drive. Then attach the drive to another computer internally, or by an external method, such as USB. Then you can attempt to recover the partition with one of these utilities. The longer you use the drive with the missing partition, the more likely you are to lose data or the entire partition.

13
  • No, it is Dell Pentium N5050. I am running Windows 10
    – RPK
    Commented Nov 26, 2018 at 3:50
  • 3
    @RPK ah, just looked it up. its a more modern CPU (but still old), just called a Pentium. Strange. However, everything I said hold true.
    – Keltari
    Commented Nov 26, 2018 at 3:53
  • Is there any alternative of the old Partition Magic? The other tools I tried are not that comprehensive.
    – RPK
    Commented Nov 26, 2018 at 4:05
  • 1
    @RPK I would do a bit for bit image backup first. Once that is done, you can try any and all recovery methods, as you can restore the drive from the image. As for which is better, I havent has to recover a partition in ages. I have used TestDisk most recently. However once you have the image backup, you can try any or all of them.
    – Keltari
    Commented Nov 26, 2018 at 5:21
  • 2
    Beyond that, Intel is still using the Pentium and Celeron brands for its low end CPUs. AFAIK it tried to kill them off at one point, but pushback from OEMs resulted in them being revived and used for chips below the i3 feature binning. Commented Nov 26, 2018 at 14:26
4

As you say you are trying to install CentOs I assume you will be able to boot another o.s.

I would suggest you to try Parted. It can rescue partitions quite easily. A normal Ubuntu bootable image has parted included. I don't know of CentOs but it is quite reasonable that its installation image includes it too.

3
  • 2
    if the OP doesn't have CentOs installed yet, or just doesn't feel comfortable with CLI tools GParted might be a better option. It's a basic GUI around Parted, and is available in live images. Commented Nov 26, 2018 at 14:24
  • @DanNeely Not yet installed CentOS.
    – RPK
    Commented Nov 27, 2018 at 4:09
  • I mentioned an installation disk because it will let you do the search without mounting i.e. modifying your hard drive at all, and before installing CentOs or anything else. Similarly @DanNeely, GParted is a frontend and I'm not sure whether it gives the full rescue functionalities available through the cli.
    – lurix66
    Commented Nov 29, 2018 at 12:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .