windows crashing after installing fedora 16

16
2013-10
  • Jor-el

    I have HP dv6 pavilion. I installed fedora 16 in it along with windows. I installed fedora on a separate partition. After installation I booted to windows, but it crashed. It shows a "starting windows screen" and then crashes with a blue screen. On next time of starting windows, it shows a recovery environment, with a message that the "device you wanted to connect was not available". I tried to boot with a windows CD to reinstall windows and remove fedora, but it isn't able to locate hard disk driver and hence of no good at all. In nutshell windows is cannot be restored by fresh installation.

    As far as I read on internet and experience, its a problem with configuring grub. my fdisk -l output look like:

     Disk /dev/sda: 640.1 GB, 640135028736 bytes
        255 heads, 63 sectors/track, 77825 cylinders, total 1250263728 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0xad6d2636
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1              63        2047         992+  42  SFS
    /dev/sda2            2048      409599      203776   42  SFS
    /dev/sda3   *      409600   995420159   497505280   42  SFS
    /dev/sda4       995420160  1250263727   127421784    5  Extended
    /dev/sda5       995422208   996446207      512000   83  Linux
    /dev/sda6       996448256  1250263039   126907392   8e  Linux LVM
    
    Disk /dev/mapper/vg_vikaspc-lv_swap: 8355 MB, 8355053568 bytes
    255 heads, 63 sectors/track, 1015 cylinders, total 16318464 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x00000000
    
    Disk /dev/mapper/vg_vikaspc-lv_swap doesn't contain a valid partition table
    
    Disk /dev/mapper/vg_vikaspc-lv_root: 53.7 GB, 53687091200 bytes
    255 heads, 63 sectors/track, 6527 cylinders, total 104857600 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x00000000
    
    Disk /dev/mapper/vg_vikaspc-lv_root doesn't contain a valid partition table
    
    Disk /dev/mapper/vg_vikaspc-lv_home: 67.9 GB, 67880615936 bytes
    255 heads, 63 sectors/track, 8252 cylinders, total 132579328 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x00000000
    
    Disk /dev/mapper/vg_vikaspc-lv_home doesn't contain a valid partition table
    

    If anybody have faced this problem or have an idea how to fix it, your help will be appreciated.

    UPDATE: /boot/grub2/grub.cfg file looks like:

        # DO NOT EDIT THIS FILE
        #
        # It is automatically generated by grub2-mkconfig using templates
        # from /etc/grub.d and settings from /etc/default/grub
        #
    
        ### BEGIN /etc/grub.d/00_header ###
        if [ -s $prefix/grubenv ]; then
          load_env
        fi
        set default="0"
        if [ "${prev_saved_entry}" ]; then
          set saved_entry="${prev_saved_entry}"
          save_env saved_entry
          set prev_saved_entry=
          save_env prev_saved_entry
          set boot_once=true
        fi
    
        function savedefault {
          if [ -z "${boot_once}" ]; then
            saved_entry="${chosen}"
            save_env saved_entry
          fi
        }
    
        function load_video {
          insmod vbe
          insmod vga
          insmod video_bochs
          insmod video_cirrus
        }
    
        set timeout=5
        ### END /etc/grub.d/00_header ###
                                                                                          UPDATE:
    

    My /etc/grub2.cfg file have the menu entries:

    #
    # DO NOT EDIT THIS FILE
    #
    # It is automatically generated by grub2-mkconfig using templates
    # from /etc/grub.d and settings from /etc/default/grub
    #
    
    ### BEGIN /etc/grub.d/00_header ###
    if [ -s $prefix/grubenv ]; then
      load_env
    fi
    set default="0"
    if [ "${prev_saved_entry}" ]; then
      set saved_entry="${prev_saved_entry}"
      save_env saved_entry
      set prev_saved_entry=
      save_env prev_saved_entry
      set boot_once=true
    fi
    
    function savedefault {
      if [ -z "${boot_once}" ]; then
        saved_entry="${chosen}"
        save_env saved_entry
      fi
    }
    
    function load_video {
      insmod vbe
      insmod vga
      insmod video_bochs
      insmod video_cirrus
    }
    
    set timeout=5
    ### END /etc/grub.d/00_header ###
    
    
    ### BEGIN /etc/grub.d/10_linux ###
    menuentry 'Fedora (3.3.4-3.fc16.x86_64)' --class fedora --class gnu-linux --class gnu --class os {
            load_video
            set gfxpayload=keep
            insmod gzio
            insmod part_msdos
            insmod ext2
            set root='(hd0,msdos5)'
            search --no-floppy --fs-uuid --set=root 3cf7895c-b625-4a20-be2e-aee4192fcf1f
            echo 'Loading Fedora (3.3.4-3.fc16.x86_64)'
            linux   /vmlinuz-3.3.4-3.fc16.x86_64 root=/dev/mapper/vg_vikaspc-lv_root ro rd.md=0 rd.dm=0  KEYTABLE=us quiet SYSFONT=latarcyrheb-sun16 rhgb rd.luks=0 LANG=en_US.UTF-8 rd.lvm.lv=vg_vikaspc/lv_swap rd.lvm.lv=vg_vikaspc/lv_root
            echo 'Loading initial ramdisk ...'
            initrd /initramfs-3.3.4-3.fc16.x86_64.img
    }
    menuentry 'Fedora Linux, with Linux 3.1.0-7.fc16.x86_64' --class fedora --class gnu-linux --class gnu --class os {
            load_video
            set gfxpayload=keep
            insmod gzio
            insmod part_msdos
            insmod ext2
            set root='(hd0,msdos5)'
            search --no-floppy --fs-uuid --set=root 3cf7895c-b625-4a20-be2e-aee4192fcf1f
            echo    'Loading Linux 3.1.0-7.fc16.x86_64 ...'
            linux   /vmlinuz-3.1.0-7.fc16.x86_64 root=/dev/mapper/vg_vikaspc-lv_root ro rd.md=0 rd.dm=0  KEYTABLE=us quiet SYSFONT=latarcyrheb-sun16 rhgb rd.luks=0 LANG=en_US.UTF-8 rd.lvm.lv=vg_vikaspc/lv_swap rd.lvm.lv=vg_vikaspc/lv_root
            echo    'Loading initial ramdisk ...'
            initrd  /initramfs-3.1.0-7.fc16.x86_64.img
    }
    menuentry 'Fedora Linux, with Linux 3.1.0-7.fc16.x86_64 (recovery mode)' --class fedora --class gnu-linux --class gnu --class os {
            load_video
            set gfxpayload=keep
            insmod gzio
            insmod part_msdos
            insmod ext2
    
            set root='(hd0,msdos5)'
            search --no-floppy --fs-uuid --set=root 3cf7895c-b625-4a20-be2e-aee4192fcf1f
            echo    'Loading Linux 3.1.0-7.fc16.x86_64 ...'
            linux   /vmlinuz-3.1.0-7.fc16.x86_64 root=/dev/mapper/vg_vikaspc-lv_root ro single rd.md=0 rd.dm=0  KEYTABLE=us quiet SYSFONT=latarcyrheb-sun16 rhgb rd.luks=0 LANG=en_US.UTF-8 rd.lvm.lv=vg_vikaspc/lv_swap rd.lvm.lv=vg_vikaspc/lv_root
            echo    'Loading initial ramdisk ...'
            initrd  /initramfs-3.1.0-7.fc16.x86_64.img
    }
    ### END /etc/grub.d/10_linux ###
    
    ### BEGIN /etc/grub.d/20_linux_xen ###
    ### END /etc/grub.d/20_linux_xen ###
    
    ### BEGIN /etc/grub.d/30_os-prober ###
    menuentry "Windows 7 (loader) (on /dev/sda2)" --class windows --class os {
            insmod part_msdos
            insmod ntfs
            set root='(hd0,msdos2)'
            search --no-floppy --fs-uuid --set=root BE5EC8485EC7F6E5
            chainloader +1
    }
    menuentry "Windows Recovery Environment (loader) (on /dev/sda3)" --class windows --class os {
            insmod part_msdos
            insmod ntfs
            set root='(hd0,msdos3)'
            search --no-floppy --fs-uuid --set=root A43ADDF33ADDC30A
            drivemap -s (hd0) ${root}
            chainloader +1
    }
    ### 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 ###
    
    ### 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 ###
    
    ### BEGIN /etc/grub.d/41_custom ###
    if [ -f  $prefix/custom.cfg ]; then
      source $prefix/custom.cfg;
    fi
    ### END /etc/grub.d/41_custom ###
    
    ### BEGIN /etc/grub.d/90_persistent ###
    ### END /etc/grub.d/90_persistent ###
    

    After some help, it seems the probable cause is SFS filesystem for the main windows drive. Help on how to convert sfs to ntfs in best possible way without loosing data will be appreciated.

    SOLUTION: It turns out that you have to install linux by creating an extended partition on the hard disk. Which I should have figured out earlier.

    On the new HP laptops its a bit complicated to create an extended partition. TO work through this problem read this.

  • Answers
    Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

    Related Question

    linux - How can I make grub2 boot into Windows 7?
  • Grzenio

    I had Windows 7 installed on my system, then I installed Debian testing with grub2 as its boot manager. Initially I couldn't see windows entry in grub at all, so I ran:

    aptitude install os-prober kcpuload 
    update-grub
    

    Now I can see the entry, but when I select it I get only Win7 system restore, instead of the the real thing. Any ides how to make it work?

    EDIT: I tried the suggested approach to add a new file to /etc/grub.d, which generated an entry in grub.cfg, but it does not appear in the grub menu on boot :(

    I have this:

    grzes:/home/ga# cat /etc/grub.d/11_Windows
    #! /bin/sh -e
    echo Adding Windows >&2
    cat << EOF
    menuentry “Windows 7″ {
            set root=(hd0,2)
            chainloader +1
    }
    

    And I have the following grub.cfg file:

    grzes:/home/ga# cat /boot/grub/grub.cfg
    #                                      
    # 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 $prefix/grubenv ]; then    
      load_env                         
    fi                                 
    set default="0"                    
    if [ ${prev_saved_entry} ]; then   
      set saved_entry=${prev_saved_entry}
      save_env saved_entry               
      set prev_saved_entry=              
      save_env prev_saved_entry          
      set boot_once=true                 
    fi                                   
    
    function savedefault {
      if [ -z ${boot_once} ]; then
        saved_entry=${chosen}     
        save_env saved_entry      
      fi                          
    }                             
    insmod ext2                   
    set root=(hd0,3)              
    search --no-floppy --fs-uuid --set 6ce3ff31-0ef7-41df-a6f5-b6b886db3a94
    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                                                                                                                                                           
    set locale_dir=/boot/grub/locale                                                                                                                             
    set lang=en                                                                                                                                                  
    insmod gettext                                                                                                                                               
    set timeout=5                                                                                                                                                
    ### END /etc/grub.d/00_header ###  
    

  • Related Answers
  • Smar

    First, you'll need to check the config. Its in theee... thee... /etc/grub.d/ ? /etc/grub/?.. somewhere there. Config file names look like this: 00xy, 10linux, 20other ... these are just examples, but the real thing is almost the same. Check them, where is the windows one. Back it up (copy it somewhere). You'll need something like this into the file:

    menuentry "Windows" {
    set root=(hd0,3)
    chainloader +1
    }
    

    If you haven't got any config file like this, just create one. Grub2's config reading is easy-to-understand. It goes incrementally. Like: 00* , 10*, 20*, etc. So your new file should be named 95-windowsfix if you want it to be the last entry, or give it a smaller number (to make it the first entry) than Linux configs have if you want it to be the first.)

    in the 'other' config file. Modify the set root value of course. Determine the hdd by typing: sudo fdisk -l . For example, /dev/sda1 is (hd0,0) if its on the second HDD: /dev/sdb1 >> (hd1,0) ..and so on. You can understand the syntax from this I guess. After you made the modifications, do an update-grub and you can try to boot it.

    I'm aware that this looks like a huge mess. Sorry for that. I don't have any Ubuntu machine near to me with Grub2 so thats why I wrote this much "i guess". If you won't be able to get it work, just ask.

  • Tom Wijsman

    Try this:

    grub-mkconfig -o /boot/grub/grub.cfg