0

I was trying to install Ubuntu alongside Windows 7. I stupidly ejected the live CD during the installation, and now I cannot boot back into Windows 7. I've browsed some questions on this site, but there are various help directions and I am unsure which ones apply to me. I am currently running on the live CD.

I ran some commands I found and these are the results:

ubuntu@ubuntu:~$ sudo fdisk -l

Disk /dev/sda: 750.2 GB, 750156374016 bytes
255 heads, 63 sectors/track, 91201 cylinders, total 1465149168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x1a3f0dfb

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *          63        2047         992+  42  SFS
Partition 1 does not start on physical sector boundary.
/dev/sda2            2048      409599      203776   42  SFS
/dev/sda3          409600  1434507256   717048828+  83  Linux
/dev/sda4      1434507264  1465147119    15319928   42  SFS

ubuntu@ubuntu:~$ sudo lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL

NAME   FSTYPE     SIZE MOUNTPOINT                                         LABEL
sda             698.7G                                                    
├─sda1 ntfs       199M /media/ubuntu/SYSTEM                               SYSTEM
├─sda2 ext4     683.9G /media/ubuntu/282b0be8-88df-4095-b50e-acb7e1f06094 
├─sda3 ntfs      14.5G                                                    RECOVERY
└─sda4 vfat     102.9M /media/ubuntu/HP_TOOLS                             HP_TOOLS
sr0    iso9660    996M /cdrom                                             Ubuntu 14

I think sda2 is my Windows partition, but when I go to /media/ubuntu/282b0be8-88df-4095-b50e-acb7e1f06094 the folder is empty.

What does that mean? Do my results mean that my "Windows partition" is "mounted?" How do I recover my Windows files? Do I need TestDisk?

3

The (very small piece of) good news: Ejecting the disc early did not cause your problems. Don't beat yourself up over that.

The rest is bad news, I'm afraid. Your hard disk is, in technical terms, a complete and utter mess. :-(

Your /dev/sda1, /dev/sda2, and /dev/sda4 are all of type 0x42. This type is also identified as "SFS" by fdisk, although that acronym actually refers to a use that's no longer common -- it's really a Windows 2000 (and later) dynamic disk (aka logical disk manager, or LDM), which is similar to (but incompatible with) the Linux logical volume manager (LVM).

In any event, my guess is that you started with an LDM configuration in Windows, but either you or the Ubuntu installer didn't correctly identify it as such. Instead, either you or the Ubuntu installer tried to resize the LDM partitions as if they were plain filesystems to make room for Ubuntu. This was a BIG mistake, because it damaged the LDM setup and may have damaged the filesystems contained within it. This resulted in a trashed Windows installation. What's more, your hopes of a full recovery are slim (but not nonexistent).

As a first step, I suggest you back up all your data files that you can actually read. Do this from Linux and/or Windows emergency tools. If you can't find all your files, do a low-level backup of your entire hard disk to another one, as in:

sudo dd if=/dev/sda of=/path/to/big/space/backup.img

You'll obviously need a big disk to hold the backup; in this example it's mounted at /path/to/big/space. If an attempted repair makes matters worse (and there's a double-digit probability that it will), you'll be able to restore things to the current state from the backup.

Once you've got backups, I recommend you boot an emergency disk and delete all your partitions. You can then use TestDisk to try to recover your original NTFS volumes. You may need to fiddle with TestDisk options to get it to recover the right filesystems; do not let it recover any Linux filesystem, since the Linux filesystem may well be overwriting critical NTFS data, and it's the NTFS data you need to recover. This process is unlikely to work completely, but there's a chance that you'll be able to recover at least one filesystem. It may be damaged, though, in which case you'll have to recover it from Windows. Even if you get back a filesystem, some files may be corrupt or lost.

If this process fails, your last-resort recovery effort (assuming you don't have existing backups) is to use PhotoRec or some similar tool to do a file-level recovery. The last I checked, PhotoRec didn't do a good job of recovering filenames, so you'll have to sift through files individually to figure out what they are. This will be tedious. I've seen claims that there are commercial Windows tools that do a better job of recovering filenames from NTFS volumes, so you may want to look into such options instead of PhotoRec. I don't know much about these alternatives, though, so I can't recommend a specific product. You might want to ask about this on a Windows forum.

As a side note, Windows creates LDM configurations without warning when you create more than four partitions on a disk. If your disk had over four "partitions" (really logical volumes) when you started, it had LDM to begin with. If you created new partitions for Linux by using a Windows tool, though, that triggered this whole chain of events. Rule #1 when preparing to install Linux on a system that uses Windows is to not use Windows tools to create Linux partitions. You can use the Windows tools to shrink the Windows partition, but leave that free space unallocated; let the Linux installer create its own partitions in the unallocated space.


EDIT: I just noticed that your fdisk and lsblk outputs are inconsistent about what's what; fdisk suggests that Linux is installed to /dev/sda3, but lsblk suggests it's installed to /dev/sda2. I wrote the above based largely on the fdisk output, but lsblk is probably more trustworthy. Nonetheless, the broad strokes of what I wrote probably still apply.

0

sda1 is your windows partition, sda2 is the partition created to install ubuntu. Reinstall it and finish it properly this time and everything should work. When you reinstall, choose manual partitioning and select sda2 to be formatted as ext4 and mounted as "/".

2
  • so i'm going through installation again, made the changes you said, and i see the following... device---type---mount point---format---size---used---system /dev/sda /dev/sda1---blank---blank---blank---1MB---unknown---windows 7 (loader) /dev/sda2---ext4---/---checked---208MB---unknown---blank /dev/sda3---ext4---blank---blank---734258MB---unknown---Windows recovery environment (loader) /dev/sda4---blank---blank---blank---15687MB---unknown---blank should I click install now? – Simon Mar 13 '15 at 23:10
  • @Simon, oh dear.. as Rod Smith said, you have problems due to dynamic disk, so ignore what I said. – psusi Mar 14 '15 at 17:39

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.