1

I tried to install ubuntu to get dual OS but incidentally delete one of the windows' partition in the process...... I can't boot windows or even use the recuse tool to recovery it...

I've backed up my C drive on ubuntu and now I'm wondering if I can somehow recover that partition without having to reinstall as I don't have windows' installation CD/USB

From what I searched online it seems like what I am missing is either the recovery partition or the loader partition? (are there supposed to be 2 loader partitions?) However, I can't really find a solution that's suitable to my situation. right now all I have is a bootable ubuntu USB and I don't have a bootable windows media I'm using sony ultrabook, so there's no cd drive.

I'm just wondering if I know which partition I deleted and I can format the partition in the right form and copy the files there... will it fix my problem....?

I've attached screenshot of my current partition info pic1

pic2

Kaz Wolfe
  • 34,680

2 Answers2

2

Note: This answer came from the OP's original post, which was edited in. I (@KazWolfe) have moved it to Community Wiki status to actually have it in the right section. Without further ado...


Using some information found in the comments, I went to the Data Recovery wiki page, which helped solve my problem.

Anyway, what I did is the following:

sudo swapoff -a
sudo parted /dev/sda
    rescue 1 273

(The 1 came from the 1MB of free space before hitting Delete, and 273 is the current amount of free space in MB)

Parted suggested that my drive was FAT32, and I accepted this information. Upon running "check disk errors" from the Ubuntu ISO, my system worked again.

Kaz Wolfe
  • 34,680
0

I am not sure, if you created/moved/extended some other partitions that now claim the space that previously was your windows partition.

If you did not do such a thing, then the good news is, that your data is still there, but the operating system does not know it.

Therefore, you may have a chance (not a guarantee) to recover your data by following this procedure:

  1. Create a new partition /dev/sda1 on the location where the windows partition should be. In your case, the best guess would be to claim all the free space shown by gparted at the beginning of your hard drive. Do not format the partition!
  2. Set the partition type to NTFS. Apparently, this cannot be done in gparted, but the following may help:

    sudo fdisk /dev/sda
    Command (m for help): t
    Partition number (1-7): 1
    Hex code (type L to list codes): 7
    Command (m for help): w
    
  3. Reboot your machine. Hopefully, the lost data on the partition will reappear.

  4. Backup your windows data!

Do not format the newly created partition! Formatting would basically tell the system to remove all information about where to find the files on the resurrected partition.

Edit:

The partition code 7 is NTFS. If the partition was FAT32, then the code would be c instead of 7. If you enter an uppercase L instead of a partition number, then fdisk will show you the list of possible codes.

Black
  • 188