Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 14
windows obviously corrupt my mbr, but how can I change back? I boot my computer with my "suse cd", use rescue mode, in the rescue login, I enter "root" to ...
  1. #1
    Just Joined!
    Join Date
    Dec 2006
    Posts
    60

    what can I do when I install windows after linux

    windows obviously corrupt my mbr, but how can I change back?

    I boot my computer with my "suse cd", use rescue mode, in the rescue login, I enter "root"
    to be a root user, then I type in "grub-install /dev/hda", the err message is :
    -----------------------------------------------------------------------
    mkdir: cannot create directory '/boot/grub': Read-only file system
    --------------------------------------------------------------------------


    Then I use my "live cd" to go in the linux system, In terminal, I type "grub-install /dev/hda" again, then the err message is:
    ------------------------------------------------------------------------
    Probing devices to guess BIOS drives. This may take a long time.
    sed: can't read /boot/grub/device.map: No such file or directory
    grep: /boot/grub/device.map: No such file or directory
    /dev/hda does not have any corresponding BIOS drive.
    --------------------------------------------------------------------------


    I really don't want to re-install my linux system, I have many precious files in it,
    can anyone give me a suggestion?

    Many Thanks~~~~~

  2. #2
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,316
    boot up through LiveCD and check if device.map and menu.lst file exists in SuSe /boot/grub folder. post the output of 'fdisk -l' here.








    Casper
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  3. #3
    Just Joined!
    Join Date
    Jan 2007
    Posts
    44
    First of all don't go into rescue mode, just go through the process of installing SUSE and select install boot loader, i recently did it on my suse 10 after installing windows.

    I'm not quite sure where it is but i believe if you were to do that it would work, don't mind the blank answer, my memory fails me. Post your result.

  4. #4
    Just Joined!
    Join Date
    Dec 2006
    Posts
    60
    linux@linux:~> ls -a /boot/grub/
    . ffs_stage1_5 reiserfs_stage1_5 vstafs_stage1_5
    .. iso9660_stage1_5 stage1 xfs_stage1_5
    e2fs_stage1_5 jfs_stage1_5 stage2
    fat_stage1_5 minix_stage1_5 ufs2_stage1_5

    so I don't have device.map and menu.lst file

    and the output of "fdisk -l" is
    --------------------------------------------------------------------------
    linux:/home/linux # fdisk -l

    Disk /dev/sda: 80.0 GB, 80026361856 bytes
    255 heads, 63 sectors/track, 9729 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes

    Device Boot Start End Blocks Id System
    /dev/sda1 * 1 3824 30716248+ 7 HPFS/NTFS
    /dev/sda2 3825 7648 30716280 7 HPFS/NTFS
    /dev/sda3 7649 9729 16715632+ f W95 Ext'd (LBA)
    /dev/sda5 7649 7743 763056 82 Linux swap / Solaris
    /dev/sda6 7744 9344 12860001 83 Linux
    /dev/sda7 9345 9729 3092481 83 Linux
    -------------------------------------------------------------------------------------

    Thanks all~~~~

  5. #5
    Linux Newbie
    Join Date
    Jan 2007
    Posts
    110
    You want to rescue a Linux, right?

    You have to use another Linux that you can boot up to carry out the rescue operation, right?

    This boot up Linux can come from the installation CD using its rescue mode (thereby stopping it to do an installation) or any Linux Live CD.

    Suse uses Grub and Grub can be restored either

    (1) Outside the unbootable Suse

    When you are in any boot-up Linux, either from Suse installation CD rescue mode or any Linux Live CD, you can invoke a Grub shell, tell Grub the root of the Linux is in sda6. Grub calls a hard disk by a number and always count from zero. Thus sda6 to Grub is (hd0,5) because you have only one disk. Thus the commands to ask Grub to restore itself in the MBR of disk sda in a Grub shell are
    Code:
    sudo grub
    root (hd0,5)
    setup (hd0)
    quit
    (2) Inside the unbootable Suse

    For this you must first create a temporary directory say call it /mnt/temp, mount Suse's root partition in the /mnt/temp directory of the filing system of the boot-up Linux. You then "change root" into the unbootable Suse and issue the grub-install command to restore Grub in the device sda. You then exit from the unbootable Suse back to the boot-up Linux and reboot.

    Code:
    sudo mkdir /mnt/temp
    sudo mount /dev/sda6 /mnt/temp
    sudo chroot /mnt/temp
    grub-install /devb/sda
    exit
    reboot
    The above will restore Grub back into the MBR.

    To make Grub to boot Windows you add these lines in /bootgrub/menu.lst of the now-bootable Suse
    Code:
    title My Windows bootable in sda1
    root (hd0,0)
    chainloader +1
    You can try any other suggestion but the above is the envelope of what it takes. You will benefit from it if you understand what each step means.

    The second solution in particular is "the" method of rescuing any unbootable Linux with any Linux Live CD.

    I have reason to believe your Suse partition is in sda6 but it is possible you have a /boot partition in sda7, so if sda6 doesn't work try sda7. Or if you want to know how Grub can help the in a Grub shell you can ask Grub to tell you which partition has /boot/grub/menu.lst by
    Code:
    find /boot/grub/menu.lst
    Grub will report to you the partition reference like :
    Code:
    (hd0,5)
    Adjust the above if it is (hd0,6).

  6. #6
    Just Joined! Quillz's Avatar
    Join Date
    Jan 2007
    Location
    Los Angeles, CA
    Posts
    13

    Smile

    For future reference, it's usually better to install Windows first, as it's much easier to simply partition your hard drive and add Linux later.

  7. #7
    Linux Newbie
    Join Date
    Jan 2007
    Posts
    110
    Quote Originally Posted by Quillz
    For future reference, it's usually better to install Windows first, as it's much easier to simply partition your hard drive and add Linux later.
    I disagree. It may be easier but technically there is nothing to stop us doing it in any other.

    I added Vista as the 5th Windows (after Win3x, Win9x, Win2k and xp) when there are already over 100 Linux in the box.

  8. #8
    Just Joined!
    Join Date
    Dec 2006
    Posts
    60
    thanks!!! I'll try it now!!

  9. #9
    Just Joined!
    Join Date
    Dec 2006
    Posts
    60
    That works!!

    greeting from linux^_^

  10. #10
    Linux Guru gogalthorp's Avatar
    Join Date
    Oct 2006
    Location
    West (by God) Virginia
    Posts
    3,105
    Quote Originally Posted by saikee
    I disagree. It may be easier but technically there is nothing to stop us doing it in any other.

    I added Vista as the 5th Windows (after Win3x, Win9x, Win2k and xp) when there are already over 100 Linux in the box.
    Good lord do you actually use all those or are you just a collector

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...