LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Rescuing Windows Vista as well as Fedora through bootable USB (http://www.linuxquestions.org/questions/linux-newbie-8/rescuing-windows-vista-as-well-as-fedora-through-bootable-usb-811462/)

mq15 06-01-2010 07:36 AM

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

ctkroeker 06-01-2010 09:38 AM

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!

mq15 06-01-2010 10:11 AM

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'

ctkroeker 06-01-2010 10:14 AM

Quote:

Originally Posted by mq15 (Post 3988758)
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.

mq15 06-01-2010 10:42 AM

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

linus72 06-01-2010 10:46 AM

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

mq15 06-01-2010 11:07 AM

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 ??

linus72 06-01-2010 11:11 AM

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

mq15 06-01-2010 12:15 PM

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 ?

mq15 06-02-2010 07:13 AM

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

aus9 06-02-2010 08:52 AM

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

jefro 06-02-2010 03:39 PM

You can use either MS's or Grubs loader for both.

mq15 06-02-2010 04:12 PM

Thanks jefro. Yours idea is novice to me. Can you elaborate please??

mq15 07-08-2010 02:17 PM

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


All times are GMT -5. The time now is 08:43 PM.