LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 06-01-2010, 08:36 AM   #1
mq15
Member
 
Registered: Apr 2009
Location: Pakistan
Distribution: Fedora 9
Posts: 192

Rep: Reputation: 30
Question Rescuing Windows Vista as well as Fedora through bootable USB


My system was a dual-boot with Windows Vista and Fedora 9. During the installation of some updates of Windows vista I powered off the system and since then my Windows Vista gives blue death screen error. I think it as some MBR corruption issue for which I have searched these corrective steps:
Quote:
Step 1:1. Put the Windows Vista installation disc in the disc drive, and then start the computer.
2. Press a key when you are prompted.
3. Select a language, a time, a currency, and a keyboard or another input method, and then click Next.
4. Click Repair your computer.
5. Click the operating system that you want to repair, and then click Next.
6. In the System Recovery Options dialog box, click Startup Repair.
7. Restart the computer.

Step 2: use bootrec.exe to fix MRB and BOOT
1. Put the Windows Server 2008 installation disc in the disc drive(you can use Windows Vista installation disc too), and then start the computer.
2. Press a key when you are prompted.
3. Select a language, a time, a currency, and a keyboard or another input method, and then click Next.
4. Click Repair your computer, and then click Next.
5. In the System Recovery Options dialog box, click Command Prompt.
6. Type bootrec /fixmbr, and then press ENTER.
7. Type bootrec /fixboot, and then press Enter.
8. Restart the computer.
My DVD-ROM does not detect any media I insert into it. So I have created a Windows Vista's USB installation media.

My Problem: At present Fedora boots normally. But when I will fix MBR, what will happen to fedora ? If it removes the grub, I will not be able to boot in fedora. Please suggest something. I think there must be a way to install grub through USB, but I don't know the 'howtos' of that.

Thanks

Last edited by mq15; 06-01-2010 at 08:39 AM.
 
Old 06-01-2010, 10:38 AM   #2
ctkroeker
Senior Member
 
Registered: May 2005
Location: Paraguay
Posts: 1,565
Blog Entries: 1

Rep: Reputation: 50
You would boot a LiveCD after restoring the windows MBR and then do
Code:
grub-install /dev/sda
/dev/sda being the main bootable drive. That should be all you need to do, but you can always search through the hundreds of How-to's on Google if your not comfortable with it. I did this with Windows 7 and Ubuntu a couple of weeks ago. Works great!
 
Old 06-01-2010, 11:11 AM   #3
mq15
Member
 
Registered: Apr 2009
Location: Pakistan
Distribution: Fedora 9
Posts: 192

Original Poster
Rep: Reputation: 30
Ok. Thanks ctkroeker.
So now I have created a Live USB with Fedora-9-i686-Live.iso using liveusb-creator. When I boot with this LiveUSB, I only see four options:
Quote:
- Boot
- Verify and Boot
- Memory Test
- Boot from Local Drive
Non of the choice leads me to a terminal type of environment where I can put the command 'grub-install /dev/sda'
 
Old 06-01-2010, 11:14 AM   #4
ctkroeker
Senior Member
 
Registered: May 2005
Location: Paraguay
Posts: 1,565
Blog Entries: 1

Rep: Reputation: 50
Quote:
Originally Posted by mq15 View Post
Non of the choice leads me to a terminal type of environment where I can put the command 'grub-install /dev/sda'
You can boot the Live CD, then open a terminal once it is completely loaded.
Code:
fdisk -l
will list your drives.
 
Old 06-01-2010, 11:42 AM   #5
mq15
Member
 
Registered: Apr 2009
Location: Pakistan
Distribution: Fedora 9
Posts: 192

Original Poster
Rep: Reputation: 30
Okay I got it. You mean when I am taken to the desktop of fedora through LiveUSB, I can access the terminal and put this command. Right, thanks. Now two questions:

First, you told me the command 'fdisk -l' to view the drives. Is this some kind of a hint ? I mean why I will need to view my drives ? Will not 'grub-install /dev/sda' alone enough?

Second, and very important. I am doing my project in fedora. If something goes wrong, all my project data will be doomed. Consequently, I may be killed by my supervisor !! So do you think everything will be ok ? In fact I want to load myself with the every the information that I may need for this rescue operation.

In fact, I am not only a newbie but also some kind of a dumb as a bonus. So please bear with me.

Thanks

Last edited by mq15; 06-01-2010 at 11:43 AM.
 
Old 06-01-2010, 11:46 AM   #6
linus72
Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: PocketWriter/MinimalX
Posts: 5,084

Rep: Reputation: 336Reputation: 336Reputation: 336Reputation: 336
You need fdisk -l to identify your drives
if say you have windows on /dev/sda and another drive thats /dev/sdb
and you do grub-install /dev/sda
then its gonna install grub to your windowds drive which would be bad

you could use a persistent fedora usb install to back up data to
and could also just compress your datd and place it on usb,etc
before doing anything
you should always back-up stuff
 
Old 06-01-2010, 12:07 PM   #7
mq15
Member
 
Registered: Apr 2009
Location: Pakistan
Distribution: Fedora 9
Posts: 192

Original Poster
Rep: Reputation: 30
Ok. Thanks linus72. I am getting things clearer now but not cristal clear.

Right now I am in fedora 9. So I tested the command fdisk and much worried by getting this:

Quote:
[mq15@localhost ~]$ fdisk -l
bash: fdisk: command not found
Will this command only available when I will log into by using LiveUSB or what ??
 
Old 06-01-2010, 12:11 PM   #8
linus72
Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: PocketWriter/MinimalX
Posts: 5,084

Rep: Reputation: 336Reputation: 336Reputation: 336Reputation: 336
You gotta be root/admin to run a command like fdisk
any command that can/will potentially destroy your hdd
must be run as root

sudo fdisk -l
 
Old 06-01-2010, 01:15 PM   #9
mq15
Member
 
Registered: Apr 2009
Location: Pakistan
Distribution: Fedora 9
Posts: 192

Original Poster
Rep: Reputation: 30
Humm..thanks linus72.
Let's do it:
Code:
[mq15@localhost ~]$ sudo fdisk -l
[sudo] password for mq15: 
mq15 is not in the sudoers file.  This incident will be reported.
[mq15@localhost ~]$ su -c "fdisk -l"
Password: 
bash: fdisk: command not found
[mq15@localhost ~]$
Now what ?? Let's try logging in as root...and it worked. Here is the result of 'fdisk -l'
Code:
Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x369b369b

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        3990    32049643+   7  HPFS/NTFS
/dev/sda2            3991       13155    73616384    7  HPFS/NTFS
/dev/sda3           13411       14593     9502447+  83  Linux
/dev/sda4           13156       13410     2048287+   5  Extended
/dev/sda5           13156       13410     2048256   82  Linux swap / Solaris

Partition table entries are not in disk order
So now I will put the grub-install as :
Quote:
grub-install /dev/sda3
Right ?
 
Old 06-02-2010, 08:13 AM   #10
mq15
Member
 
Registered: Apr 2009
Location: Pakistan
Distribution: Fedora 9
Posts: 192

Original Poster
Rep: Reputation: 30
I guess, grub.conf will be also needed for this decision:

Code:
[mq15@localhost ~]$ su -c "cat /boot/grub/grub.conf"
Password: 
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You do not have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /, eg.
#          root (hd0,2)
#          kernel /boot/vmlinuz-version ro root=/dev/sda3
#          initrd /boot/initrd-version.img
#boot=/dev/sda
default=2
timeout=5
splashimage=(hd0,2)/boot/grub/splash.xpm.gz
hiddenmenu
title Fedora (2.6.27.25-78.2.56.fc9.i686)
	root (hd0,2)
	kernel /boot/vmlinuz-2.6.27.25-78.2.56.fc9.i686 ro root=UUID=807f9a9d-67bc-4774-81a9-177d6a158e33 rhgb quiet
	initrd /boot/initrd-2.6.27.25-78.2.56.fc9.i686.img
title Fedora (2.6.25-14.fc9.i686)
	root (hd0,2)
	kernel /boot/vmlinuz-2.6.25-14.fc9.i686 ro root=UUID=807f9a9d-67bc-4774-81a9-177d6a158e33 rhgb quiet
	initrd /boot/initrd-2.6.25-14.fc9.i686.img
title Windows Vista 
	rootnoverify (hd0,0)
	chainloader +1
I doubt here, should I use
Quote:
grub-install /dev/sda3
or
Quote:
grub-install /dev/sda5
or
Quote:
grub-install /dev/sda
It's confusing me, please help. Thanks
 
Old 06-02-2010, 09:52 AM   #11
aus9
Guru
 
Registered: Oct 2003
Posts: 5,060

Rep: Reputation: Disabled
hi

your menu is grub-legacy so boot a live cd

open a terminal and

Code:
su
grub
root (hd0,2) (means sda3 in grub-speak)
setup (hd0)
quit
2) I suggest you mount your sda3 partition and remove that hiddenmenu as well

Code:
su
mkdir /z
mount /dev/sda3 /z
(now maybe grub.conf sym links on your distro to /boot/grub/menu.lst lets check

ls -al /z/boot/grub/grub.conf
Anyhows it will be easier to edit that file using a graphical text editor...not sure whats available on your live cd
but put a # in front of hiddenmenu and save the file then reboot and cross your legs
 
1 members found this post helpful.
Old 06-02-2010, 04:39 PM   #12
jefro
Guru
 
Registered: Mar 2008
Posts: 11,965

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
You can use either MS's or Grubs loader for both.
 
Old 06-02-2010, 05:12 PM   #13
mq15
Member
 
Registered: Apr 2009
Location: Pakistan
Distribution: Fedora 9
Posts: 192

Original Poster
Rep: Reputation: 30
Thanks jefro. Yours idea is novice to me. Can you elaborate please??
 
Old 07-08-2010, 03:17 PM   #14
mq15
Member
 
Registered: Apr 2009
Location: Pakistan
Distribution: Fedora 9
Posts: 192

Original Poster
Rep: Reputation: 30
O.K.
Thanks everyone. Windows Vista was not being repaired. I installed Windows 7. After that I followed instructions in post # 11 by aus9 to re-install the grub.

One common error that I would like to share:

Code:
root<space>(hd0,2)
setup<space>(hd0)
I first used these commands without spaces and I got the error:
Code:
Error 27 Unrecognized command
Thanks
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
creating windows 7 bootable usb from linux endertux Linux - Software 17 01-23-2014 09:30 PM
How do I use GRUB to load a windows bootable USB?! asaahi Linux - Laptop and Netbook 1 04-26-2009 06:50 PM
Using GRUB to load a windows bootable USB?! asaahi Linux - Newbie 1 04-26-2009 02:13 AM
Rescuing Fedora Core 4 ethics Fedora 3 07-14-2005 07:28 AM


All times are GMT -5. The time now is 09:09 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration