PDA

View Full Version : [ubuntu] Uh oh.... please tell me i didnt



collinge
October 29th, 2009, 10:27 PM
i just installed ubuntu and i tried to do a dual boot with my windows XP but creating a partion - i enabled the "memonry swap" and now i cannot get back to windows.... please tell me i did not delete all of my files on windows... i tried to do F 12 but windows was not there...HELP

Wiebelhaus
October 29th, 2009, 10:33 PM
Boot to live disc and inspect the drive for ntfs partitions.

Good luck mate!

celtic426
October 29th, 2009, 10:36 PM
Memory swap shouldn't have anything to do with it. It depends on how you set up the partitions when you installed ubuntu. If you told the installer to write over windows, then your files are gone. But if you didnt touch the windows partition, then the files are still there, you just have to tell grub where the windows partition

collinge
October 29th, 2009, 10:40 PM
well my aval. memory tells me that the files are still there.... i only have 850 something MB left -- if all files were gone then it would be 32 G.. any idea how to tell the grub where it is??

bribera
October 29th, 2009, 10:43 PM
Can you post a list of all partitions?

To get that information, run this command:


sudo fdisk -l

collinge
October 29th, 2009, 10:59 PM
Disk /dev/sda: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0000675f

Device Boot Start End Blocks Id System
/dev/sda1 * 1 4455 35784756 7 HPFS/NTFS
/dev/sda2 4456 4865 3293325 5 Extended
/dev/sda5 * 4456 4865 3293293+ 83 Linux

Disk /dev/sdb: 255 MB, 255852544 bytes
129 heads, 4 sectors/track, 968 cylinders
Units = cylinders of 516 * 512 = 264192 bytes
Disk identifier: 0x35e9c259

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 968 249597+ e W95 FAT16 (LBA)
Partition 1 has different physical/logical endings:
phys=(973, 128, 4) logical=(967, 56, 3)

bribera
October 29th, 2009, 11:03 PM
Great! That first partition -- /dev/sda1 -- confirms that you didn't delete your Windows partition.

Now let's see what you have listed in GRUB, the default boot loader. Please post the result of:


cat /boot/grub/grub.cfg

collinge
October 29th, 2009, 11:06 PM
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by /usr/sbin/grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s /boot/grub/grubenv ]; then
have_grubenv=true
load_env
fi
set default="0"
if [ ${prev_saved_entry} ]; then
saved_entry=${prev_saved_entry}
save_env saved_entry
prev_saved_entry=
save_env prev_saved_entry
fi
insmod ext2
set root=(hd0,5)
search --no-floppy --fs-uuid --set d52ee6a2-4484-4bf7-bf58-7d8f202b7cc2
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=640x480
insmod gfxterm
insmod vbe
if terminal_output gfxterm ; then true ; else
# For backward compatibility with versions of terminal.mod that don't
# understand terminal_output
terminal gfxterm
fi
fi
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/white
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
menuentry "Ubuntu, Linux 2.6.31-14-generic" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
set quiet=1
insmod ext2
set root=(hd0,5)
search --no-floppy --fs-uuid --set d52ee6a2-4484-4bf7-bf58-7d8f202b7cc2
linux /boot/vmlinuz-2.6.31-14-generic root=UUID=d52ee6a2-4484-4bf7-bf58-7d8f202b7cc2 ro quiet splash
initrd /boot/initrd.img-2.6.31-14-generic
}
menuentry "Ubuntu, Linux 2.6.31-14-generic (recovery mode)" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
insmod ext2
set root=(hd0,5)
search --no-floppy --fs-uuid --set d52ee6a2-4484-4bf7-bf58-7d8f202b7cc2
linux /boot/vmlinuz-2.6.31-14-generic root=UUID=d52ee6a2-4484-4bf7-bf58-7d8f202b7cc2 ro single
initrd /boot/initrd.img-2.6.31-14-generic
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
if [ ${timeout} != -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 ###

celtic426
October 29th, 2009, 11:07 PM
Collinge, you can try typing this in the terminal:

sudo update-grub

collinge
October 29th, 2009, 11:39 PM
Tried that and restarted. Tried to boot from gnu grub loader and the I don't see it.

Thanks for all you guys do.

cariboo
October 30th, 2009, 12:01 AM
Open a terminal and type:


sudo update-grub

That should solve your problem, as fdisk says your windows partition is still there.

collinge
October 30th, 2009, 12:17 AM
you guys got any ideas

bribera
October 30th, 2009, 12:18 AM
Yeah, another poster suggested update-grub and he reported that it didn't work.

Are there any known issues with the 30_os-prober script for grub2? It seems as if it's not finding his Windows installation.

bribera
October 30th, 2009, 12:22 AM
collinge, what version of windows are you running?

Please post the output of:


sudo os-prober

bribera
October 30th, 2009, 12:42 AM
It seems like there are quite a few people having trouble with this; you may need to create a manual menu entry for your windows partition.

Others having this issue:
http://ubuntuforums.org/showthread.php?t=1301111
http://ubuntuforums.org/showthread.php?t=1287490
http://ubuntuforums.org/showthread.php?t=1286846

Still, do post the output of os-prober. That will at least be, uh, probative.

collinge
October 30th, 2009, 01:15 AM
Maybe this will help
http://www.mediafire.com/imgbnc.php/0c21bb41c8c46b47bad0e3f2b73813c74g.jpg

http://www.mediafire.com/imgbnc.php/0c21bb41c8c46b47bad0e3f2b73813c74g.jpg

3esmit
October 30th, 2009, 01:38 AM
This is really scaring... If the linux is threating your NTFS as swap, something gone very wrong during your installation, since swap partition have another type of format then NTFS, and if the system is using it to cache in disk, maybe he is overwriting your files in your NTFS.

You can try using the application called testdisk to inspect for files in the partition, even if you cant mount it. I suggest you downloading the Parted Magic, an aplication Live CD/USB that helps solving this type of problem. This REALLY can help you, its like 60mb of download.
http://partedmagic.com/

You can also download testdisk with 'sudo apt-get install testdisk'.

Once you gain access to the files, make a backup of everything that is important and erase all the disk, re install windows in half of the disk, and left half of the disk for installing the ubuntu (I personally recommends you do install ubuntu in the full disk, and use windows under VMWare)

Attention: Testdisk is a tool that can change the partitioning tables, a lot of things from HD, it can make your ubuntu stop working, but it wont delete your files. Anyway use it with caution, be aware of what your doing.

For make grub recognize your windows you need to go to grub command line, and run some install commands, please read the grub manual. Probably you will need to run the following or like.
root (hdx,y) --- where x is your hd number and y your partition number where GRUB is installed
setup (hdx,y) --- where x is your hd number and y your partition number where WINDOWS is installed
configfile /boot/grub/grub.cfg -- this command makes you go back to grub using this gurb.cfg.


Luck!

bribera
October 30th, 2009, 01:48 AM
It's not that frightening - probably just confusion on the part of palimpsest. The fdisk output he posted earlier lists the partition as HPFS/NTFS.

Please post the output of the following to confirm what's being mounted as swap space (according to the fdisk listing, you don't actually have any...):


cat /etc/fstab

Based on the other grub2/Windows threads I'm seeing, my guess is that you'll simply need to add an entry to /etc/grub.d/40_custom because grub2 isn't detecting your Windows partition for some unknown reason.

I (or anyone else who wants to ;)) will try to help you through it, but first I want to make sure that 3esmit is wrong about your Windows partition being mounted as swap. So post your fstab when you can.

collinge
October 30th, 2009, 02:01 AM
Please post the output of the following to confirm what's being mounted as swap space (according to the fdisk listing, you don't actually have any...):


cat /etc/fstab



collinge@Linix:~$ cat /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 defaults 0 0
# / was on /dev/sda5 during installation
UUID=d52ee6a2-4484-4bf7-bf58-7d8f202b7cc2 / ext4 errors=remount-ro 0 1
# swap was on /dev/sda1 during installation
UUID=23251059-fbb3-48b0-b1ee-fe0b4194d2df none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto,exec,utf8 0 0
collinge@Linix:~$

bribera
October 30th, 2009, 02:09 AM
# swap was on /dev/sda1 during installation
UUID=23251059-fbb3-48b0-b1ee-fe0b4194d2df none swap sw 0 0


Crap. That means 3esmit & Palimpsest were right. Somehow your Windows partition has been set up as the Linux swap space. Chances are HIGH that your Windows installation is gone.

Here's what I'd suggest trying:

Reboot with your Windows CD and see if you can repair the installation. Some things to note:


It's not very likely that you'll be able to recover stuff, but it's worth a try. If you want to try some disk utilities after doing this, don't partition your hard drive and don't use your Linux installation. The more you write to the swap, the more messed up Windows will get.
If you do repair Windows, it'll erase GRUB from your master boot record. You won't be able to log into Linux at this point. I'd suggest reinstalling Linux anyway if you have no files on it; and make sure you don't set the main Windows partition as Swap the second time around ;)


Keep us updated...

3esmit
October 30th, 2009, 02:38 AM
Testdisk application can help you recorverying files that still in the harddrive.
Since it stills on NTFS, proofs that it was not formated by the ubuntu installer, it just made a mount point to it as swap.

What you need to do is ANALYZE this partiton with TESTDISK, I recommend you doing that in Parted Magic, since you will be out of any installed operational system in this machine.
There you will be able to mount partitions, analyze partitions, copy files, backup partition tables, format, erase disk.. Well, can be done everything with Parted Magic. Pay attention with the use of this tool. The main purpose now is using TESTDISK ANALYZE FUNCTION to see the files that still in the disk. By TESTDISK you can copyfiles from this partition to any other disk avaliable. With testdisk you can recreate boot sector, NBR sector, and partition table, this will help you by recorvery the original state of the disk, and making it possible to mount.

Remember that your ubuntu installed are also compromised, you cannot have an NTFS swap of 35 gb and a disk space of 5gb, it runs, but its all screwed, YOU HAVE TO reformat the whole disk, when all files are already backed up.

This maybe could happen becouse you touched some ADVANCED tabs in installer, or the installer had no space to create the swap (maybe a bug in the new 9.10 installer).

Luck.

collinge
October 31st, 2009, 01:07 AM
Thank You! All of you board moderators and just nice people...

3esmit
October 31st, 2009, 03:38 PM
So you recorvered your files? What you used, testdisk as I suggested?

iarenoob
August 26th, 2010, 10:21 PM
If you boot from a live disk, u can turn on Gparted
system>>administration>>Gparted
In Gparted you can right-click your NFTS partition and choose swap off
This will stop linux from further using ur windows partition as swap. Whether or not u can still get ur windows installation to still work after having its partition used as swap is anyone's guess. Though what you probably can do at this point is mount the partition and backup any files that have been left intact.

@3esmit, I don't think his ubuntu installation is totally compromised. Gparted, or Parted Magic if he has it, is perfectly capable of expanding his ubuntu partition and creating a new swap space. Though to do that he would have to shrink the NFTS partition which sometimes messes up the windows installation in which case u can repair the windows installation from a backup disk(but that's not even a problem since his windows installation is screwed already at the moment)