LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Laptop and Netbook
User Name
Password
Linux - Laptop and Netbook Having a problem installing or configuring Linux on your laptop? Need help running Linux on your netbook? This forum is for you. This forum is for any topics relating to Linux and either traditional laptops or netbooks (such as the Asus EEE PC, Everex CloudBook or MSI Wind).

Notices


Reply
  Search this Thread
Old 04-23-2011, 07:33 PM   #1
dariusjd
LQ Newbie
 
Registered: Mar 2007
Posts: 16

Rep: Reputation: 0
Is all hope lost?


Okay, I'm not sure if this is in the right section, but if it isn't, I'm sorry. Please move it. Now before we get into this, I will admit that I am a moron for doing this. But okay:

I have an Acer Aspire v5252 laptop. I installed Ubuntu via liveCD and dual booted it with Windows 7. I didn't like it, so I decided to get rid of Linux.
Some guide on the internet told me to delete the Linux partition from within Window's interface in order to get rid of Linux. I was not aware that this would delete my MBR/Grub. Now, I can't boot into Windows and when I start up the computer, I get "grub_rescue>".
I followed some more guides and I ended up booting the liveCD and compiling "ms-sys" to restore my Windows 7 boot record. I believe I used "sudo ms-sys -7 -f /dev/sda3". It told me that everything was done successfully.
I began to pat myself on the back and proceed to reboot the computer, hoping that the computer would now boot into Windows. Nope. Stupid grub_rescue> came up again.
I booted back into the Ubuntu liveCD and went to the Disk Utility and discovered that my partition that once read "Acer" and had all of my Windows files in it, was now gone and that allocated space read "Unknown". I used to be able to browse my Windows installation from within Linux/liveCD, now I cannot. I am assuming that I just f.cked myself, but I'm not sure!

Did I do something stupid and corrupt my Windows 7 installation? Is there anyway to rectify this and go back to my Windows 7 installation? Or am I forever doomed with my liveCD?
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 04-23-2011, 07:50 PM   #2
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
It sounds like Windows is gone. If your computer came with a factory restore disk then you could use that to restore Windows. If you do not have one then you may be able to purchase one from Acer. If that is not available and you still want Windows then you will have to purchase a new Windows installation kit. Keep in mind that a generic Windows installation kit will not have Acer specific drivers. You would need to download those from the Acer web site if they are available.

If none of those options are appealing or available then you can still install Linux or BSD UNIX for free.
 
Old 04-23-2011, 07:54 PM   #3
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
@ Reply

Well not sure if it will recover or not but you can give it a try:

1. Boot the system using Windows 7 CD.
2. It will prompt you whether you want to install Windows 7 or repair.
3. Select the repair option.
4. It will give you couple of options. Don't try any option as of now. Just hit ctrl+F10. This will open up a command prompt.
5. From command prompt try typing C: to see if you are able to get in there. If it is unable to find any C: try with D: and try to do dir.
6. If you are able to see your files in there like: windows, Program Files etc you still have hope.

Try this and let me know how it goes and we can take it from there.
 
1 members found this post helpful.
Old 04-23-2011, 08:01 PM   #4
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
I would say you pretty much destroyed the system, yes.

To start with, simply deleting the Ubuntu partitions is not the appropriate way to remove Linux, as it (as you have found out) still leaves the Linux bootloader in the MBR. With the Linux partition removed, the MBR is unsure how to proceed, so it throws up the problem you were seeing.

You then attempted to use "ms-sys" to repair the MBR, which was a step in the right direction. Unfortunately, it looks like you didn't read the documentation very clearly, or perhaps were not sure about the different components in the bootloader/MBR setup.

The command you ran:

Code:
sudo ms-sys -7 -f /dev/sda3
If we look at the documentation for those two switches:

Code:
Usage:
	ms-sys [options] [device]
Options:
-7, --mbr7      Write a Windows 7 MBR to device
-f, --force     Force writing of boot record
So what you did was tell ms-sys to force writing of an Windows 7 MBR to the third partition of the primary drive. Unfortunately, the MBR is not supposed to be written to a partition, it is meant to be written to the root of the drive itself, in this case, just /dev/sda.

If we check the last line of ms-sys's help, we get a big clue as to what happened:

Code:
Warning: Writing the wrong kind of boot record to a device might
destroy partition information or file system!
Presumably, had you not used the -f option, ms-sys would have refused to write an MBR to the invalid location. But since you told it to go ahead with the operation anyway, it wrote the MBR to the NTFS filesystem and blew it away.

Now, if there is any good news, it is that the MBR is a very small bit of data. So all that got written into the Windows 7 partition was a few bytes. Just enough, apparently, to smash up the filesystem, but it shouldn't have been enough to delete much of the actual content. You should be able to use data recovery software to get your data off of the drive intact, though I would say that repairing the filesystem and Windows itself would take more time than it is worth. I would suggest getting the data off of it, and then simply reinstalling Windows.
 
2 members found this post helpful.
Old 04-23-2011, 08:07 PM   #5
jthill
Member
 
Registered: Mar 2010
Distribution: Arch
Posts: 211

Rep: Reputation: 67
All hope is not lost.

/dev/sda3 is the third partition on your drive. You wrote a master boot record for the whole disk into your windows partition's boot slot. You wanted 'ms-sys -7 /dev/sda'.

http://www.ntfs.com/boot-sector-damaged.htm says you can run FIXBOOT from a Windows install disk's repair/rescue environment to copy a safety mirror of the partition boot record from its hiding place elsewhere in the partition. ms-sys's doc says it can write proper partition boot records with '-p', like 'ms-sys -p /dev/sda3', but it also warns there are differences in how Windows and Linux see partitions so this can cause problems.

Good luck.
 
1 members found this post helpful.
Old 04-23-2011, 08:10 PM   #6
dariusjd
LQ Newbie
 
Registered: Mar 2007
Posts: 16

Original Poster
Rep: Reputation: 0
Thank you all for your replies. And yes, MS3FGX, you are correct, I did not read the documentation thoroughly. Instead, I was being a moron and skimming the guide that I had looked up. There drive only consist of some mp3s and a few documents. If I can get those documents back, I wouldn't be beat up about this. Three questions:
  1. Can I run some kind of data recovery software from the Ubuntu liveCD? I was thinking that I could recover the data via the liveCD, upload it to my file server and proceed with reinstalling Windows. At this moment, the former Windows partition is just sitting there, labeled as "Unknown" and unmountable - will data recovery software even recognize it?
  2. If I did decide to attempt to repair the Windows installation with the disc, would the Windows disc even recognize the installation?
  3. When that master boot record was -forced- to be written, how exactly does that destroy the entire drive? Haha, I just don't understand that for some reason. But okay.


ADDITION: I forgot to mention: I do have a partition that was created by Windows remaining. It is labeled as "PQ Service". It has a "bootmgr" file, a "System Volume Information" folder and something else (I have to reboot the liveCD to check) in it. This was used by Windows Restore, I think. Is this of any use?

Last edited by dariusjd; 04-23-2011 at 08:17 PM.
 
Old 04-23-2011, 08:36 PM   #7
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
1. I don't know if the Ubuntu-CD has it already installed, but you should be able to install testdisk even in the live environment, it is not so large. Testdisk contains the photorec-program, which is exactly what you need.
2. I would just give it a try, after you have rescued your data.
3. I don't know.
 
1 members found this post helpful.
Old 04-23-2011, 08:46 PM   #8
nicolasjengler
Member
 
Registered: Apr 2011
Location: /dev/null
Distribution: Debian, Ubuntu, Arch, OpenSUSE, Puppy, Feather, DSL, DeLi, SliTaz, Bodhi, PCLinuxOS, Crunchbang,etc.
Posts: 74

Rep: Reputation: 9
Quote:
Originally Posted by TobiSGD View Post
1. I don't know if the Ubuntu-CD has it already installed, but you should be able to install testdisk even in the live environment, it is not so large. Testdisk contains the photorec-program, which is exactly what you need.
2. I would just give it a try, after you have rescued your data.
3. I don't know.
That's it. The problem now is that photorec recovers documents but "doesn't know" where they start and where the should finish so you may have to check out every document in order to see if everything's alright. Also photorec recovers the documents but not their name, only their extension. So if you had document.doc it will now be file00001.doc or something like that.
 
Old 04-23-2011, 08:52 PM   #9
dariusjd
LQ Newbie
 
Registered: Mar 2007
Posts: 16

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by TobiSGD View Post
1. I don't know if the Ubuntu-CD has it already installed, but you should be able to install testdisk even in the live environment, it is not so large. Testdisk contains the photorec-program, which is exactly what you need.
2. I would just give it a try, after you have rescued your data.
3. I don't know.
Quote:
Originally Posted by nicolasjengler View Post
That's it. The problem now is that photorec recovers documents but "doesn't know" where they start and where the should finish so you may have to check out every document in order to see if everything's alright. Also photorec recovers the documents but not their name, only their extension. So if you had document.doc it will now be file00001.doc or something like that.
Can testdisk fix my Windows partition by any chance? I was reading up on it's documentation and it says that it repairs drives.
Also, photorec says it only for photos. It recovers documents too?
And lastly, can these programs from the Ubuntu liveCD? I keep running out of space when I try it.
 
Old 04-23-2011, 09:08 PM   #10
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,120

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
I don't know what you're reading but you'd be better off at the homepage.
Quote:
Originally Posted by testdisk
It was primarily designed to help recover lost partitions and/or make non-booting disks bootable again
Quote:
Originally Posted by photorec
file data recovery software designed to recover lost files including video, documents and archives from hard disks, CD-ROMs, and lost pictures (thus the Photo Recovery name) from digital camera memory
They will run from the liveCD fine, but may be recovering to the (in-storage) current directory. Not much use.
To save all the guesswork, go here and do as it says.
 
Old 04-23-2011, 09:16 PM   #11
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
When using photorec from a live-CD you have to either use a external drive or a mounted network share. Didn't you say that you want to use your file-server for that?

And, as syg00 already stated, the first places for getting information about software are the manpages, the documentation in /usr/share/doc and the website of the developer. Keep in mind that 'some guide on the internet' in the first place caused your problem.
 
Old 04-23-2011, 09:33 PM   #12
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,841

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Boot ubuntu live-cd and see if you still have your pq service.
You can restore from there.
 
Old 04-23-2011, 10:39 PM   #13
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
Quote:
Originally Posted by dariusjd View Post
  1. Can I run some kind of data recovery software from the Ubuntu liveCD? I was thinking that I could recover the data via the liveCD, upload it to my file server and proceed with reinstalling Windows. At this moment, the former Windows partition is just sitting there, labeled as "Unknown" and unmountable - will data recovery software even recognize it?
  2. If I did decide to attempt to repair the Windows installation with the disc, would the Windows disc even recognize the installation?
  3. When that master boot record was -forced- to be written, how exactly does that destroy the entire drive? Haha, I just don't understand that for some reason. But okay.
1. It looks like the previous posts have covered this pretty well already, but yes, that would be the general idea. Use the live CD to run any number of data recovery tools, and get it onto a server or removable device. Even though the partition is showing up as unknown right now, the recovery tools are designed to ignore that and deal with the raw data on the disk itself.

2. Probably not. If I had to guess, I would say that the Windows install CD will see that there is a partition there, but not recognize it as a valid Windows installation. As such, you probably won't even get the option to use the repair functions. But I could be wrong, it has been a long time since I installed Windows, perhaps the installer has gotten smarter since then.

3. It didn't, really. But it blew away the data at the very beginning of the partition, which happens to be a very important bit. Basically, writing the MBR to the partition overwrote the part of the partition which explains what kind of filesystem is on it, so the OS (Windows, Linux, whatever) doesn't know how to read it.
 
Old 04-24-2011, 01:25 AM   #14
dariusjd
LQ Newbie
 
Registered: Mar 2007
Posts: 16

Original Poster
Rep: Reputation: 0
Okay guys. You have all been a tremendous help and I thank every last one of you!

I just put in a Windows 7 disc and I ran the repair process. Miraculously, Windows recognized my previous Windows 7 installation. I ran a system restore and the regular "Repair this Installation" option. I rebooted the computer and still got the stupid "grub rescue>" thing. Even though the Windows disc is recognizing my installation, should I just forget about it and reinstall?
I do have access to the command prompt.

EDIT: Actually, I was about to access all of my files via the command prompt. This is incredible; I thought all of my files were gone. However, I am still missing my MBR and I cannot boot into the OS. I have a Windows 7 disc and a Ubuntu LiveCD. I am contemplating going into Ubuntu and trying ms-sys again, but I'm afraid of losing my files for good. Any ideas guys?

Last edited by dariusjd; 04-24-2011 at 01:36 AM.
 
Old 04-24-2011, 01:34 AM   #15
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,120

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Read this technet note.
Use /fixmbr and maybe /fixboot.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Last hope :( ozbolt Linux - Hardware 17 08-15-2008 07:30 AM
last hope tizwaz Linux - Newbie 65 09-06-2007 01:30 PM
no hope for the X-Fi? Jason711 Linux - Hardware 3 04-20-2006 12:41 AM
Hope 10 is better then 9.2 /home/kyle General 3 03-12-2004 05:34 AM
You all are my last hope..... Cap'n Ahab Linux - Newbie 8 07-19-2003 11:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Laptop and Netbook

All times are GMT -5. The time now is 10:00 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration