Partition disappeared after shrinking











up vote
9
down vote

favorite
2












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










share|improve this question




















  • 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.
    – Joy
    Nov 26 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
    Nov 26 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
    Nov 26 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
    Nov 27 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
    Nov 30 at 13:45















up vote
9
down vote

favorite
2












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










share|improve this question




















  • 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.
    – Joy
    Nov 26 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
    Nov 26 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
    Nov 26 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
    Nov 27 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
    Nov 30 at 13:45













up vote
9
down vote

favorite
2









up vote
9
down vote

favorite
2






2





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










share|improve this question















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







windows-10 partitioning centos disk-management






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 28 at 6:06

























asked Nov 26 at 3:32









RPK

1,09662038




1,09662038








  • 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.
    – Joy
    Nov 26 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
    Nov 26 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
    Nov 26 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
    Nov 27 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
    Nov 30 at 13:45














  • 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.
    – Joy
    Nov 26 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
    Nov 26 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
    Nov 26 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
    Nov 27 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
    Nov 30 at 13:45








1




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.
– Joy
Nov 26 at 8:12




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.
– Joy
Nov 26 at 8:12




1




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
Nov 26 at 9:16




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
Nov 26 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
Nov 26 at 15:25




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
Nov 26 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
Nov 27 at 4:08




@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
Nov 27 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
Nov 30 at 13:45




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
Nov 30 at 13:45










3 Answers
3






active

oldest

votes

















up vote
1
down vote



accepted










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).






share|improve this answer





















  • Thanks for the excellent answer. Let me try this.
    – RPK
    Nov 27 at 10:28










  • Updated original post. Added screenshots. Please check.
    – RPK
    Nov 28 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
    Nov 28 at 12:45










  • ... simply boot into Windows and reassing a drive letter.
    – Damon
    Nov 28 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
    Nov 28 at 13:11




















up vote
14
down vote













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.






share|improve this answer





















  • No, it is Dell Pentium N5050. I am running Windows 10
    – RPK
    Nov 26 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
    Nov 26 at 3:53












  • Is there any alternative of the old Partition Magic? The other tools I tried are not that comprehensive.
    – RPK
    Nov 26 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
    Nov 26 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.
    – Dan Neely
    Nov 26 at 14:26


















up vote
4
down vote













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.






share|improve this answer



















  • 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.
    – Dan Neely
    Nov 26 at 14:24










  • @DanNeely Not yet installed CentOS.
    – RPK
    Nov 27 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
    Nov 29 at 12:34











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1378362%2fpartition-disappeared-after-shrinking%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























3 Answers
3






active

oldest

votes








3 Answers
3






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
1
down vote



accepted










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).






share|improve this answer





















  • Thanks for the excellent answer. Let me try this.
    – RPK
    Nov 27 at 10:28










  • Updated original post. Added screenshots. Please check.
    – RPK
    Nov 28 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
    Nov 28 at 12:45










  • ... simply boot into Windows and reassing a drive letter.
    – Damon
    Nov 28 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
    Nov 28 at 13:11

















up vote
1
down vote



accepted










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).






share|improve this answer





















  • Thanks for the excellent answer. Let me try this.
    – RPK
    Nov 27 at 10:28










  • Updated original post. Added screenshots. Please check.
    – RPK
    Nov 28 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
    Nov 28 at 12:45










  • ... simply boot into Windows and reassing a drive letter.
    – Damon
    Nov 28 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
    Nov 28 at 13:11















up vote
1
down vote



accepted







up vote
1
down vote



accepted






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).






share|improve this answer












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).







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 27 at 10:18









Damon

3,49531624




3,49531624












  • Thanks for the excellent answer. Let me try this.
    – RPK
    Nov 27 at 10:28










  • Updated original post. Added screenshots. Please check.
    – RPK
    Nov 28 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
    Nov 28 at 12:45










  • ... simply boot into Windows and reassing a drive letter.
    – Damon
    Nov 28 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
    Nov 28 at 13:11




















  • Thanks for the excellent answer. Let me try this.
    – RPK
    Nov 27 at 10:28










  • Updated original post. Added screenshots. Please check.
    – RPK
    Nov 28 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
    Nov 28 at 12:45










  • ... simply boot into Windows and reassing a drive letter.
    – Damon
    Nov 28 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
    Nov 28 at 13:11


















Thanks for the excellent answer. Let me try this.
– RPK
Nov 27 at 10:28




Thanks for the excellent answer. Let me try this.
– RPK
Nov 27 at 10:28












Updated original post. Added screenshots. Please check.
– RPK
Nov 28 at 6:06




Updated original post. Added screenshots. Please check.
– RPK
Nov 28 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
Nov 28 at 12:45




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
Nov 28 at 12:45












... simply boot into Windows and reassing a drive letter.
– Damon
Nov 28 at 12:45




... simply boot into Windows and reassing a drive letter.
– Damon
Nov 28 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
Nov 28 at 13:11






But to assign drive letter, I will have to first create Simple Volume? TestDisk is showing them as Linux partitions. Strange.
– RPK
Nov 28 at 13:11














up vote
14
down vote













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.






share|improve this answer





















  • No, it is Dell Pentium N5050. I am running Windows 10
    – RPK
    Nov 26 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
    Nov 26 at 3:53












  • Is there any alternative of the old Partition Magic? The other tools I tried are not that comprehensive.
    – RPK
    Nov 26 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
    Nov 26 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.
    – Dan Neely
    Nov 26 at 14:26















up vote
14
down vote













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.






share|improve this answer





















  • No, it is Dell Pentium N5050. I am running Windows 10
    – RPK
    Nov 26 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
    Nov 26 at 3:53












  • Is there any alternative of the old Partition Magic? The other tools I tried are not that comprehensive.
    – RPK
    Nov 26 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
    Nov 26 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.
    – Dan Neely
    Nov 26 at 14:26













up vote
14
down vote










up vote
14
down vote









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.






share|improve this answer












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.







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 26 at 3:47









Keltari

49.7k17114166




49.7k17114166












  • No, it is Dell Pentium N5050. I am running Windows 10
    – RPK
    Nov 26 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
    Nov 26 at 3:53












  • Is there any alternative of the old Partition Magic? The other tools I tried are not that comprehensive.
    – RPK
    Nov 26 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
    Nov 26 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.
    – Dan Neely
    Nov 26 at 14:26


















  • No, it is Dell Pentium N5050. I am running Windows 10
    – RPK
    Nov 26 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
    Nov 26 at 3:53












  • Is there any alternative of the old Partition Magic? The other tools I tried are not that comprehensive.
    – RPK
    Nov 26 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
    Nov 26 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.
    – Dan Neely
    Nov 26 at 14:26
















No, it is Dell Pentium N5050. I am running Windows 10
– RPK
Nov 26 at 3:50




No, it is Dell Pentium N5050. I am running Windows 10
– RPK
Nov 26 at 3:50




3




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
Nov 26 at 3:53






@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
Nov 26 at 3:53














Is there any alternative of the old Partition Magic? The other tools I tried are not that comprehensive.
– RPK
Nov 26 at 4:05




Is there any alternative of the old Partition Magic? The other tools I tried are not that comprehensive.
– RPK
Nov 26 at 4:05




1




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
Nov 26 at 5:21




@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
Nov 26 at 5:21




2




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.
– Dan Neely
Nov 26 at 14:26




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.
– Dan Neely
Nov 26 at 14:26










up vote
4
down vote













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.






share|improve this answer



















  • 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.
    – Dan Neely
    Nov 26 at 14:24










  • @DanNeely Not yet installed CentOS.
    – RPK
    Nov 27 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
    Nov 29 at 12:34















up vote
4
down vote













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.






share|improve this answer



















  • 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.
    – Dan Neely
    Nov 26 at 14:24










  • @DanNeely Not yet installed CentOS.
    – RPK
    Nov 27 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
    Nov 29 at 12:34













up vote
4
down vote










up vote
4
down vote









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.






share|improve this answer














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.







share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 29 at 12:22

























answered Nov 26 at 9:55









lurix66

1412




1412








  • 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.
    – Dan Neely
    Nov 26 at 14:24










  • @DanNeely Not yet installed CentOS.
    – RPK
    Nov 27 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
    Nov 29 at 12:34














  • 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.
    – Dan Neely
    Nov 26 at 14:24










  • @DanNeely Not yet installed CentOS.
    – RPK
    Nov 27 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
    Nov 29 at 12:34








2




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.
– Dan Neely
Nov 26 at 14:24




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.
– Dan Neely
Nov 26 at 14:24












@DanNeely Not yet installed CentOS.
– RPK
Nov 27 at 4:09




@DanNeely Not yet installed CentOS.
– RPK
Nov 27 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
Nov 29 at 12:34




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
Nov 29 at 12:34


















draft saved

draft discarded




















































Thanks for contributing an answer to Super User!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1378362%2fpartition-disappeared-after-shrinking%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

If I really need a card on my start hand, how many mulligans make sense? [duplicate]

Alcedinidae

Can an atomic nucleus contain both particles and antiparticles? [duplicate]