PDA

View Full Version : [other] Installed ubuntu but i need to get back to Windows 7.



luckyluke304
December 17th, 2010, 07:33 AM
i guess ill start with how i had my system setup originally

I had a 1tb HDD and i split it down the middle one half for storage of mixed media and the other Windows 7 with my games etc...

So i decided to try Ubuntu 10.10 so i created a new 35gb partition to install it on when i tried installing it though the advanded setup during the ubuntu install it wouldn't install on it so i decided to try the install side by side and it worked on the newly created partition and after messing around with Ubuntu for the past day and a half i need to go back to my Windows 7 boot and i am unsure how i go about doing that. I have restarted my computer but there is no option to boot into Windows 7 it just starts Ubuntu.

So in short how do i boot into Windows 7?

I kinda need to be on it before 7pm GMT+10 around an hour and a half as of this post to go. :(


(Sorry if this is in the wrong section)

sikander3786
December 17th, 2010, 07:44 AM
Welcome to the forums :-)

Go to Applications > Accessories > Terminal and,


sudo update-grub

Does that list Windows 7? If yes, the issue is solved. If no, follow the step below.

In order to let us see your boot files and setup, boot Ubuntu from your hard disk and post the output of bootinfoscript as per instructions here.

http://bootinfoscript.sourceforge.net

While posting, click the # icon in post menu and paste your text in between the generated code tags.

luckyluke304
December 17th, 2010, 07:58 AM
Boot Info Script 0.55 dated February 15th, 2010

============================= Boot Info Summary: ==============================

=> Grub 2 is installed in the MBR of /dev/sda and looks on the same drive in
partition #1 for (,msdos1)/boot/grub.

sda1: __________________________________________________ _______________________

File system: ext4
Boot sector type: -
Boot sector info:
Operating System: Ubuntu 10.10
Boot files/dirs: /boot/grub/grub.cfg /etc/fstab /boot/grub/core.img

sda2: __________________________________________________ _______________________

File system: Extended Partition
Boot sector type: Unknown
Boot sector info:

sda5: __________________________________________________ _______________________

File system: swap
Boot sector type: -
Boot sector info:

=========================== Drive/Partition Info: =============================

Drive: sda ___________________ __________________________________________________ ___

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes

Partition Boot Start End Size Id System

/dev/sda1 * 2,048 1,941,235,711 1,941,233,664 83 Linux
/dev/sda2 1,941,237,758 1,953,523,711 12,285,954 5 Extended
/dev/sda5 1,941,237,760 1,953,523,711 12,285,952 82 Linux swap / Solaris


blkid -c /dev/null: __________________________________________________ __________

Device UUID TYPE LABEL

/dev/sda1 9b8bd71a-405b-4527-be47-a0f22b75d895 ext4
/dev/sda2: PTTYPE="dos"
/dev/sda5 9bb22c5d-456b-4756-9bc2-6eff6bb41a0b swap
/dev/sda: PTTYPE="dos"

============================ "mount | grep ^/dev output: ===========================

Device Mount_Point Type Options

/dev/sda1 / ext4 (rw,errors=remount-ro,commit=0)


=========================== sda1/boot/grub/grub.cfg: ===========================

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
set have_grubenv=true
load_env
fi
set default="0"
if [ "${prev_saved_entry}" ]; then
set saved_entry="${prev_saved_entry}"
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi

function savedefault {
if [ -z "${boot_once}" ]; then
saved_entry="${chosen}"
save_env saved_entry
fi
}

function recordfail {
set recordfail=1
if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
}

function load_video {
insmod vbe
insmod vga
}

insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set 9b8bd71a-405b-4527-be47-a0f22b75d895
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=640x480
load_video
insmod gfxterm
fi
terminal_output gfxterm
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set 9b8bd71a-405b-4527-be47-a0f22b75d895
set locale_dir=($root)/boot/grub/locale
set lang=en
insmod gettext
if [ "${recordfail}" = 1 ]; then
set timeout=-1
else
set timeout=10
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Ubuntu, with Linux 2.6.35-23-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set 9b8bd71a-405b-4527-be47-a0f22b75d895
linux /boot/vmlinuz-2.6.35-23-generic root=UUID=9b8bd71a-405b-4527-be47-a0f22b75d895 ro quiet splash
initrd /boot/initrd.img-2.6.35-23-generic
}
menuentry 'Ubuntu, with Linux 2.6.35-23-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set 9b8bd71a-405b-4527-be47-a0f22b75d895
echo 'Loading Linux 2.6.35-23-generic ...'
linux /boot/vmlinuz-2.6.35-23-generic root=UUID=9b8bd71a-405b-4527-be47-a0f22b75d895 ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.35-23-generic
}
menuentry 'Ubuntu, with Linux 2.6.35-22-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set 9b8bd71a-405b-4527-be47-a0f22b75d895
linux /boot/vmlinuz-2.6.35-22-generic root=UUID=9b8bd71a-405b-4527-be47-a0f22b75d895 ro quiet splash
initrd /boot/initrd.img-2.6.35-22-generic
}
menuentry 'Ubuntu, with Linux 2.6.35-22-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set 9b8bd71a-405b-4527-be47-a0f22b75d895
echo 'Loading Linux 2.6.35-22-generic ...'
linux /boot/vmlinuz-2.6.35-22-generic root=UUID=9b8bd71a-405b-4527-be47-a0f22b75d895 ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.35-22-generic
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set 9b8bd71a-405b-4527-be47-a0f22b75d895
linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set 9b8bd71a-405b-4527-be47-a0f22b75d895
linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
if [ "x${timeout}" != "x-1" ]; then
if keystatus; then
if keystatus --shift; then
set timeout=-1
else
set timeout=0
fi
else
if sleep --interruptible 3 ; then
set timeout=0
fi
fi
fi
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###

=============================== sda1/etc/fstab: ===============================

# /etc/fstab: static file system information.
#
# Use 'blkid -o value -s UUID' to print the universally unique identifier
# for a device; this may be used with UUID= as a more robust way to name
# devices that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc nodev,noexec,nosuid 0 0
/dev/sda1 / ext4 errors=remount-ro 0 1
/dev/sda5 none swap sw 0 0

=================== sda1: Location of files loaded by Grub: ===================


908.5GB: boot/grub/core.img
738.9GB: boot/grub/grub.cfg
.6GB: boot/initrd.img-2.6.35-22-generic
.9GB: boot/initrd.img-2.6.35-23-generic
908.5GB: boot/vmlinuz-2.6.35-22-generic
908.5GB: boot/vmlinuz-2.6.35-23-generic
.9GB: initrd.img
.6GB: initrd.img.old
908.5GB: vmlinuz
908.5GB: vmlinuz.old
=========================== Unknown MBRs/Boot Sectors/etc =======================

Unknown BootLoader on sda2

00000000 d3 8e 81 29 9b 0b 9f 2b 0d 65 28 6f f4 93 36 41 |...)...+.e(o..6A|
00000010 2c bb 4c d8 2d 14 1f 4f 12 fe 5d 41 5c 7e 4b 64 |,.L.-..O..]A\~Kd|
00000020 1b c5 8e 0e d9 ff ef 22 13 db 26 3f d2 4c 0c d9 |......."..&?.L..|
00000030 de cc 43 34 03 3c 1f 54 f3 01 29 53 74 ae c7 fd |..C4.<.T..)St...|
00000040 5e 32 32 fd 5b af 99 af 93 b2 ac 94 3e 79 d1 84 |^22.[.......>y..|
00000050 04 6a 48 dc 08 74 38 b0 6a 95 fb 99 11 12 d6 4b |.jH..t8.j......K|
00000060 4f 0f d3 98 b7 8e 47 02 79 99 2c 26 ed 66 c9 8f |O.....G.y.,&.f..|
00000070 fb 5a 88 1d 91 3c 19 4c 0e 54 93 ff 8e bc 5c ef |.Z...<.L.T....\.|
00000080 71 d0 b0 2a 28 8e b9 b7 52 19 fa 07 e9 93 10 47 |q..*(...R......G|
00000090 f1 f0 a2 5f 93 7f 1e 88 37 02 99 eb c5 9e c3 15 |..._....7.......|
000000a0 c1 4f a6 4d 7b e6 60 9e 19 7c 8b 5c c8 7d 5c 56 |.O.M{.`..|.\.}\V|
000000b0 95 f9 90 1e d4 1c 4a c9 ce 7a 72 46 c8 2e fc 41 |......J..zrF...A|
000000c0 b2 4f 6f ac fc c8 25 5d f3 61 04 91 4a 4d 60 d1 |.Oo...%].a..JM`.|
000000d0 30 4c 0f fb c3 92 53 bf b8 fd 1c f8 6a 4f 40 00 |0L....S.....jO@.|
000000e0 b3 de bf 1e 6c 83 c1 f7 a1 ba 65 d0 dd 09 2c 28 |....l.....e...,(|
000000f0 2f 1a e7 f9 f8 04 49 db 5f e1 b5 99 69 a0 d6 56 |/.....I._...i..V|
00000100 db 3c 6c b5 bb 51 58 9b 4a 5a 96 cd fa 75 d5 63 |.<l..QX.JZ...u.c|
00000110 c3 02 29 96 c5 c1 dc 43 7d e3 49 be 7a cf dc 3f |..)....C}.I.z..?|
00000120 9c 0a 3f 9a cd 83 ea 76 7a 19 69 19 a9 ae 04 3f |..?....vz.i....?|
00000130 6c bf 1c 2a b0 2a 69 d5 09 ad 0f 5b 93 d5 ac 2e |l..*.*i....[....|
00000140 be 4a ef 0d fb 1d 94 29 38 5b 07 74 92 3b c9 ad |.J.....)8[.t.;..|
00000150 80 3f ee 00 fd bc 38 5d b2 26 d0 d1 e5 9a e5 c5 |.?....8].&......|
00000160 75 27 f4 8d 35 0a fb 80 be 33 b9 35 95 07 29 37 |u'..5....3.5..)7|
00000170 8e d3 5b f1 ea ef d9 f1 15 e0 74 8e c6 66 d5 1b |..[.......t..f..|
00000180 5a fe 64 3a 53 93 c6 2a 58 27 ed 45 54 e4 1d 89 |Z.d:S..*X'.ET...|
00000190 97 9e 16 c4 0a 60 c1 2b c0 f0 39 db 66 75 c8 54 |.....`.+..9.fu.T|
000001a0 c8 0e 49 54 33 7a e6 ef 3f 79 1c 66 5a 7c ae 6a |..IT3z..?y.fZ|.j|
000001b0 b6 7f aa 1b 91 a9 a0 3a ae e1 f7 36 41 6a 00 fe |.......:...6Aj..|
000001c0 ff ff 82 fe ff ff 02 00 00 00 00 78 bb 00 00 00 |...........x....|
000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
00000200



Thought i should just add the terminal output as well


Found linux image: /boot/vmlinuz-2.6.35-23-generic
Found initrd image: /boot/initrd.img-2.6.35-23-generic
Found linux image: /boot/vmlinuz-2.6.35-22-generic
Found initrd image: /boot/initrd.img-2.6.35-22-generic
Found memtest86+ image: /boot/memtest86+.bin


And thank you :D

luckyluke304
December 17th, 2010, 08:41 AM
So how stuffed am i?

Will i be able to get back to my Windows 7 boot?

amsterdamharu
December 17th, 2010, 09:20 AM
I don't want to scare you or anything but it looks like you choose to use the entire disk during installation. But I might be misreading it.

Can you open a file browser (home folder)? When it opens and you don't click on anything it will say in the bottom "... items, Free space: ...GB". Check that to make sure.

luckyluke304
December 17th, 2010, 09:24 AM
849.7 GB of free space

I'm 100% sure i didn't use the entire disk during install. :<

wilee-nilee
December 17th, 2010, 09:27 AM
So how stuffed am i?

Will i be able to get back to my Windows 7 boot?

You overwrote the windows install, do you have a windows install dvd?

/dev/sda1 * 2,048 1,941,235,711 1,941,233,664 83 Linux

That is just under a terrabyte, the rest is the swap.

theasprint
December 17th, 2010, 09:32 AM
Ya, I think you ended up with Ubuntu having to use the whole hard drive.

Do you remember during the installation process having to choose to use the whole hard drive?

Because in a default Ubuntu installation, Ubuntu will have 3 parts, sda1, sda2 and sda5. In default sda1 should be the Ubuntu partition, and sda2 should be your grub and sda5 is a swap partition default in Ubuntu like RAM purposes.

To make sure, try going into Ubuntu and open Disk Utility.

The Disk Utility will give u an "anatomy" of your whole hard drive. If there seems to be no Windows partition and all the space has been used up, I'm afraid that your Windows 7 has been formatted away.

*It's strange that you are unaware of Ubuntu taking up your whole hard drive.

amsterdamharu
December 17th, 2010, 09:35 AM
Ok, there might be a way to recover (allthough unlikely).
Boot up with the live CD and install testdisk see if that one recognizes any old partition tables or anything you can restore.

testdisk is a commandline program so you might need to shutdown the gui.
press control + alt + F1 and type the following commands:

sudo service gdm stop
sudo testdisk

When you've exited testdisk you can use control + alt + delete to restart the computer.

luckyluke304
December 17th, 2010, 12:04 PM
This might be acoincendence but..... while doing a deep analysis of my HDD with testdisk it says this


Linux 0 32 33 120836 85 17 1941233664
HPFS - NTFS 58712 1 1 62144 254 62 55151081
Linux 60330 230 61 181167 28 45 1941233664
Linux 60332 13 34 181168 66 18 1941233664
Linux 60333 246 10 181170 43 57 1941233664
Linux 60335 28 46 181171 81 30 1941233664
HPFS - NTFS 0 32 33 62144 118 54 998348800
HPFS - NTFS 62145 0 1 121600 254 63 955160640 [Backup]
If the far right text "Backup" is drive labels, Backup was one of my partitions which i stored all my media on e.g Movies, TV Shows

And while copying and pasting this i stopped the scan by accident @_@" Dam it, after like an hour+ it was only 54%


So thoughts?
(The above only got to 54% i'm redoing the scan.....)

amsterdamharu
December 17th, 2010, 01:56 PM
Go for it and see what you can recover Windows is gone but testdisk might be able to save some of your files. Don't know how important they are, I would not sit there and watch the process although I never used testdisk it will take a long time to finish.

Installing Windows now would only make it less likely to recover any files (overwrite and overwrite again).

By the way; I am sorry you've lost your Windows, hope this won't completely put you off Ubuntu or Linux. There is always a risk when installing another OS or resizing partitions that it goes wrong. Werther it's something you did wrong or a bug in the program doesn't matter, gone is gone.

owiknowi
December 17th, 2010, 02:07 PM
www.sysresccd.org/ also has a tool to try an recover files.

i had some success with ontrack's cd and with http://www.ultimatebootcd.com/

so give it a try but it can take a long time, especially since some ntfs (windos) is changed into linux (ext file system).

wish you good luck and for the future: always backup your personal stuff to an external drive.

luckyluke304
December 17th, 2010, 02:49 PM
Ok.... after realizing that this thread had gone to a second page and i had been refreshing the first page every now and then for the past 40mins i will check out those two links you provided Cheers.

Also

after TestDisk finished the scan this is what came up, i have not moved from that screenshot yet.

http://oi55.tinypic.com/r7vivs.jpg

Also does TestDisk have some kind of log i could just copy paste into #Code# here?

@amsterdamharu (http://ubuntuforums.org/member.php?u=898154)
Well.... now that i think about it most of it can be replaced over a long period of time but there are some things like my work with 3Ds Max that can't really be replaced :/
[code
http://oi51.tinypic.com/sx16j8.jpg

if i was to guess i would say that the first one is my Windows 7 Boot and "Backup" is my media collection.

So what now?

kansasnoob
December 17th, 2010, 03:31 PM
I'd try PhotoRec to recover data, it's on TestDisk but for some reason ATM I can't get the site to open. Once their site is up and running look for PhotoRec step-by-step.

Site's up now:

http://www.cgsecurity.org/wiki/PhotoRec

kansasnoob
December 17th, 2010, 03:37 PM
Go for it and see what you can recover Windows is gone but testdisk might be able to save some of your files. Don't know how important they are, I would not sit there and watch the process although I never used testdisk it will take a long time to finish.

Installing Windows now would only make it less likely to recover any files (overwrite and overwrite again).

By the way; I am sorry you've lost your Windows, hope this won't completely put you off Ubuntu or Linux. There is always a risk when installing another OS or resizing partitions that it goes wrong. Werther it's something you did wrong or a bug in the program doesn't matter, gone is gone.

Particularly using the "Install alongside" option in the new live installer (aka: ubiquity):

http://ubuntuforums.org/showthread.php?t=1622388

My last rant along with bug report links:

http://ubuntuforums.org/showpost.php?p=10242920&postcount=68

I can't help but wonder how many people will decide that Ubuntu is just not for them after the initial disaster :(

luckyluke304
December 17th, 2010, 03:57 PM
Well it seems like all the files from my media partition are fine i have copied a few and they are working fine, if only i had another HDD i would copy the entire media partition 500gb~ to it.

I tried to list the files on what seems like the Windows 7 boot but it says

"Can't open filesystem. Filesystem seems damaged."

What if i set that to *=Primary Bootable, would it attempt to boot?

and if i didn't what would happen? Would i be stuck with neither a way to get to Linux or Windows 7.

owiknowi
December 17th, 2010, 04:18 PM
Well it seems like all the files from my media partition are fine i have copied a few and they are working fine, if only i had another HDD i would copy the entire media partition 500gb~ to it.

I tried to list the files on what seems like the Windows 7 boot but it says

"Can't open filesystem. Filesystem seems damaged."

What if i set that to *=Primary Bootable, would it attempt to boot?

and if i didn't what would happen? Would i be stuck with neither a way to get to Linux or Windows 7.

ms windos always needs a partition where the flag is set to 'boot'.
you can use a gparted or pmagic cd to set the flag right on the partition where ms windos resides.

changing the partition to primary while it was a logical volume in a extended partition when it was installed, is probably not recommendable or even impossible.

amsterdamharu
December 17th, 2010, 04:29 PM
I have no experience with testdisk myself but did the old partition table restore?
In that case you can just leave it, probably Ubuntu was installed over Windows so that's unrestorable but your backup partition is in tact.

Boot from liveCD and open computer (the file browser) if the backup partition shows up you're half way there. Resize the windows partition so Ubuntu could fit (480G for Windows and 20G for Ubuntu). Make sure Ubuntu is the second partition so Windows can have the first one when you install it. Now when you install Ubuntu on the 2nd 20G partiton you can access your media files and whatever else is there. Later if you install Windows there is 480G available so both Ubuntu and your media partition stay untouched.

Try gparted and see if you can delete the broken Windows partition -> re create a primary partition 480G -> create a second primary partition 20G (both unformatted). When installing Ubuntu you can /dev/sda2, the 20G partition.