1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: Ubuntu can't able to boot

Discussion in 'Linux and Unix' started by vicke4, Feb 8, 2013.

Thread Status:
Not open for further replies.
Advertisement
  1. vicke4

    vicke4 Thread Starter

    Joined:
    Aug 9, 2012
    Messages:
    41
    Hi all,I did some modifications in my partitions that made ubuntu unbootable.What I did was i merged my four ntfs partition and I shrunk and move linux partitions along partition table.Output of fdisk -l is:

    Code:
    [email protected] ~ $ sudo fdisk -l
    
    Disk /dev/sda: 320.1 GB, 320072933376 bytes
    255 heads, 63 sectors/track, 38913 cylinders, total 625142448 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: 0xf7db3a0a
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1   *        2048      206847      102400    7  HPFS/NTFS/exFAT
    /dev/sda2          206848   126035967    62914560    7  HPFS/NTFS/exFAT
    /dev/sda3   *   126036030   625141759   249552865    f  W95 Ext'd (LBA)
    /dev/sda5       126040064   576909311   225434624    7  HPFS/NTFS/exFAT
    /dev/sda6       576911360   595785727     9437184   83  Linux
    /dev/sda7       595786653   616751414    10482381   83  Linux
    /dev/sda8       616755200   625141759     4193280   82  Linux swap / Solaris
    
    Disk /dev/sdb: 1000.2 GB, 1000204885504 bytes
    255 heads, 63 sectors/track, 121601 cylinders, total 1953525167 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: 0x7f108dd3
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sdb1              63  1953520127   976760032+   7  HPFS/NTFS/exFAT
    
    Disk /dev/sdc: 3974 MB, 3974103040 bytes
    70 heads, 5 sectors/track, 22176 cylinders, total 7761920 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
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sdc1   *        8192     7761919     3876864    b  W95 FAT32
    
    Here sda6 is my root partition and sda7 is home partition.
    And /etc/fstab file is as follows:

    Code:
    # /etc/fstab: static file system information.
    #
    # Use 'blkid' to print the universally unique identifier for a
    # device; this may be used with UUID= as a more robust way to name devices
    # that works even if disks are added and removed. See fstab(5).
    #
    # <file system> <mount point>   <type>  <options>       <dump>  <pass>
    proc                                       /proc        proc  nodev,noexec,nosuid                0  0  
    # / was on /dev/sda10 during installation
    UUID=0770e53c-47df-49bd-b9a4-dc309c160d74  /            ext4  errors=remount-ro                  0  1  
    # /home was on /dev/sda11 during installation
    UUID=48e299e2-fbcd-47e3-a5c7-f7aa871ea3dd  /home        ext4  defaults                           0  2  
    # swap was on /dev/sda8 during installation
    UUID=38470f15-f978-4ec8-aa17-cac4d2d80a75  none         swap  defaults                           0  0  
    /dev/sda2                                  /media/sda2  ntfs  nls=iso8859-1,umask=000            0  0  
    /dev/sda1                                  /media/sda1  ntfs  nls=iso8859-1,ro,noauto,umask=000  0  0  
    /dev/sda6                                  /media/sda6  ntfs  nls=iso8859-1,umask=000            0  0  
    /dev/sda5                                  /media/sda5  ntfs  defaults                           0  0  
    /dev/sda7                                  /media/sda7  ntfs  defaults                           0  0  
    /dev/sda9                                  /media/sda9  ntfs  defaults                           0  0  
    
     
  2. saikee

    saikee

    Joined:
    Jun 11, 2004
    Messages:
    3,887
    Have you still got Grub?

    Press C to get a Grub prompt.

    In a Grub prompt you might be able to fire up the Linux by these commands
    Code:
    set root=(hd0,6)
    linux /vmlinuz ro root=/dev/sda6
    initrd /initrd.img
    boot
    Your UBuntu doesn't boot because Grub boots a Linux by hard-coding its hard disk address. IN you case it was sda10. Since you has changed the partition label and physically moved the Ubuntu partition's position so when Grub goes back to the old location it cannot find its stage2 files. If my prediction is right you should still have Grub and the MS system in sda1 should still work.

    If you manage to fire up Ubuntu manually as suggested above you can restore Grub as follow (after firing up Ubuntu and selecting a terminal)
    Code:
    sudo grub-install /dev/sda
    If you haven't got Grub I will give you other commands to repair it. Your Linux data should be safe as long as you do not format or destroy sda6 & sda7.
     
  3. vicke4

    vicke4 Thread Starter

    Joined:
    Aug 9, 2012
    Messages:
    41
    I can't get grub prompt by hitting "C".I'm using Ubuntu 12.04 LTS.it uses grub2.

    Yes,it's working without any flaws.I can able to boot into Ubuntu but can't reach login screen.I see Ubuntu logo and the following error:

    "An error while mounting \"

    press s to skip mounting and m for manual mounting.
     
  4. saikee

    saikee

    Joined:
    Jun 11, 2004
    Messages:
    3,887
    Manually booting up Ubuntu is the best approach but that needs a Grub prompt.

    A Grub prompt is one of the features of any Grub menu, c for grub prompt, e to edit the booting instruction etc.

    If you can't get a Grub prompt you need to edit the /etc/fstab and /boot/grub/grub.cfg in the sda6. If you donot know what to do with them post the following after booting up with the Ubuntu Live CD and mount /dev/sda6 on /mnt/sda6

    (1) sudo cat /mnt/sda6/etc/fstab
    (2) sudo cat /mnt/sda6/boot/grub/grub.cfg
    (3) ls /dev/disk/by-uuid

    Remember after booting up a Live CD the filing system in the memory is from the Live CD. The sda6 filing system is the one you mount on /mnt/sda6. Here are the instructions to mount device sda6 with a Livd CD terminal
    Code:
    sudo mkdir /mnt/sda6
    sudo mount /dev/sda6  /mnt/sda6
     
  5. vicke4

    vicke4 Thread Starter

    Joined:
    Aug 9, 2012
    Messages:
    41
    Here are the outputs:

    Code:
    [email protected] ~ $ sudo cat /mnt/sda6 /etc/fstab
    cat: /mnt/sda6: Is a directory
    overlayfs / overlayfs rw 0 0
    tmpfs /tmp tmpfs nosuid,nodev 0 0
    /dev/sda8 swap swap defaults 0 0
    

    Code:
    [email protected] ~ $ sudo cat /mnt/sda6/boot/grub/grub.cfg
    #
    # DO NOT EDIT THIS FILE
    #
    # It is automatically generated by 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
      set have_grubenv=true
      load_env
    fi
    set default="4"
    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 recordfail {
      set recordfail=1
      if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
    }
    
    function load_video {
      insmod vbe
      insmod vga
      insmod video_bochs
      insmod video_cirrus
    }
    
    insmod part_msdos
    insmod ext2
    set root='(hd0,msdos10)'
    search --no-floppy --fs-uuid --set=root 0770e53c-47df-49bd-b9a4-dc309c160d74
    if loadfont /usr/share/grub/unicode.pf2 ; then
      set gfxmode=auto
      load_video
      insmod gfxterm
      insmod part_msdos
      insmod ext2
      set root='(hd0,msdos10)'
      search --no-floppy --fs-uuid --set=root 0770e53c-47df-49bd-b9a4-dc309c160d74
      set locale_dir=($root)/boot/grub/locale
      set lang=en_US
      insmod gettext
    fi
    terminal_output gfxterm
    if [ "${recordfail}" = 1 ]; then
      set timeout=-1
    else
      set timeout=5
    fi
    ### END /etc/grub.d/00_header ###
    
    ### BEGIN /etc/grub.d/05_debian_theme ###
    set menu_color_normal=white/black
    set menu_color_highlight=black/light-gray
    if background_color 44,0,30; then
      clear
    fi
    ### END /etc/grub.d/05_debian_theme ###
    
    ### BEGIN /etc/grub.d/10_linux ###
    function gfxmode {
        set gfxpayload="${1}"
        if [ "${1}" = "keep" ]; then
            set vt_handoff=vt.handoff=7
        else
            set vt_handoff=
        fi
    }
    if [ "${recordfail}" != 1 ]; then
      if [ -e ${prefix}/gfxblacklist.txt ]; then
        if hwmatch ${prefix}/gfxblacklist.txt 3; then
          if [ ${match} = 0 ]; then
            set linux_gfx_mode=keep
          else
            set linux_gfx_mode=text
          fi
        else
          set linux_gfx_mode=text
        fi
      else
        set linux_gfx_mode=keep
      fi
    else
      set linux_gfx_mode=text
    fi
    export linux_gfx_mode
    if [ "${linux_gfx_mode}" != "text" ]; then load_video; fi
    menuentry 'Ubuntu, with Linux 3.2.0-34-generic' --class ubuntu --class gnu-linux --class gnu --class os {
        recordfail
        gfxmode $linux_gfx_mode
        insmod gzio
        insmod part_msdos
        insmod ext2
        set root='(hd0,msdos10)'
        search --no-floppy --fs-uuid --set=root 0770e53c-47df-49bd-b9a4-dc309c160d74
        linux    /boot/vmlinuz-3.2.0-34-generic root=UUID=0770e53c-47df-49bd-b9a4-dc309c160d74 ro   quiet splash $vt_handoff
        initrd    /boot/initrd.img-3.2.0-34-generic
    }
    menuentry 'Ubuntu, with Linux 3.2.0-34-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
        recordfail
        insmod gzio
        insmod part_msdos
        insmod ext2
        set root='(hd0,msdos10)'
        search --no-floppy --fs-uuid --set=root 0770e53c-47df-49bd-b9a4-dc309c160d74
        echo    'Loading Linux 3.2.0-34-generic ...'
        linux    /boot/vmlinuz-3.2.0-34-generic root=UUID=0770e53c-47df-49bd-b9a4-dc309c160d74 ro recovery nomodeset 
        echo    'Loading initial ramdisk ...'
        initrd    /boot/initrd.img-3.2.0-34-generic
    }
    ### END /etc/grub.d/10_linux ###
    
    ### BEGIN /etc/grub.d/20_linux_xen ###
    ### END /etc/grub.d/20_linux_xen ###
    
    ### BEGIN /etc/grub.d/20_memtest86+ ###
    menuentry "Memory test (memtest86+)" {
        insmod part_msdos
        insmod ext2
        set root='(hd0,msdos10)'
        search --no-floppy --fs-uuid --set=root 0770e53c-47df-49bd-b9a4-dc309c160d74
        linux16    /boot/memtest86+.bin
    }
    menuentry "Memory test (memtest86+, serial console 115200)" {
        insmod part_msdos
        insmod ext2
        set root='(hd0,msdos10)'
        search --no-floppy --fs-uuid --set=root 0770e53c-47df-49bd-b9a4-dc309c160d74
        linux16    /boot/memtest86+.bin console=ttyS0,115200n8
    }
    ### END /etc/grub.d/20_memtest86+ ###
    
    ### BEGIN /etc/grub.d/30_os-prober ###
    menuentry "Windows 7 (loader) (on /dev/sda1)" --class windows --class os {
        insmod part_msdos
        insmod ntfs
        set root='(hd0,msdos1)'
        search --no-floppy --fs-uuid --set=root 5C325D54325D346C
        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/41_custom ###
    if [ -f  $prefix/custom.cfg ]; then
      source $prefix/custom.cfg;
    fi
    ### END /etc/grub.d/41_custom ###
    

    Code:
    [email protected] ~ $ ls /dev/disk/by-uuid
    01CC0E41E0B197E0                      5C325D54325D346C
    0770e53c-47df-49bd-b9a4-dc309c160d74  6aee8442-f62d-4696-b0e8-69a426cc99fe
    445C064F5C063C64                      DACE-470F
    48e299e2-fbcd-47e3-a5c7-f7aa871ea3dd
    
     
  6. saikee

    saikee

    Joined:
    Jun 11, 2004
    Messages:
    3,887
    You have added an extra space (in front of /etc) in displaying the "sudo cat /mnt/sda6 /etc/fstab".

    However in Post #1 you have already showed us the /etc/fstab. The three partitions the kernel has been instructed to to mount are
    Code:
    UUID=[COLOR="Red"]0770e53c-47df-49bd-b9a4-dc309c160d74[/COLOR]  /            ext4  errors=remount-ro                  0  1  
    # /home was on /dev/sda11 during installation
    UUID=[COLOR="Blue"]48e299e2-fbcd-47e3-a5c7-f7aa871ea3dd[/COLOR]  /home        ext4  defaults                           0  2  
    # swap was on /dev/sda8 during installation
    UUID=[COLOR="DarkOrchid"]38470f15-f978-4ec8-aa17-cac4d2d80a75[/COLOR]  none         swap  defaults  
    The Live CD Linux now says the detected partition confirmed by
    Code:
    [email protected] ~ $ ls /dev/disk/by-uuid
    01CC0E41E0B197E0                      5C325D54325D346C
    [COLOR="Red"]0770e53c-47df-49bd-b9a4-dc309c160d74[/COLOR]  [COLOR="Green"]6aee8442-f62d-4696-b0e8-69a426cc99fe[/COLOR]
    445C064F5C063C64                      DACE-470F
    [COLOR="Blue"]48e299e2-fbcd-47e3-a5c7-f7aa871ea3dd[/COLOR]
    It appears you might have deleted the previous swap and recreated it again resulting the original uuid reference 38470f15-f978-4ec8-aa17-cac4d2d80a75 changed to 6aee8442-f62d-4696-b0e8-69a426cc99fe. This does not stop the booting process but you need to correct the /etc/fstab eventually to
    Code:
    UUID=0770e53c-47df-49bd-b9a4-dc309c160d74  /            ext4  errors=remount-ro                  0  1  
    # /home was on /dev/sda11 during installation
    UUID=48e299e2-fbcd-47e3-a5c7-f7aa871ea3dd  /home        ext4  defaults                           0  2  
    # swap was on /dev/sda8 during installation
    [B][COLOR="Purple"]/dev/sda8[/COLOR][/B]  none         swap  defaults  
    You could elect to use UUID reference again but the old /dev/sda8 is still supported and a lot simpler if you know the partition number, otherwise change the above last line to
    Code:
    UUID=[COLOR="Green"]6aee8442-f62d-4696-b0e8-69a426cc99fe[/COLOR]  none         swap  defaults
    . Ubuntu can function without a swap but having one permanently is more efficient operational wise.

    In conclusion the bit that stops your booting up Ubuntu is the grub configuration file in /boot/grub subdirectory as it got one error showend in red here.

    The relevant part (or the 1st relevant part) of your /mnt/sda6/boo/grub.grub.cfg is
    Code:
    menuentry 'Ubuntu, with Linux 3.2.0-34-generic' --class ubuntu --class gnu-linux --class gnu --class os {
        recordfail
        gfxmode $linux_gfx_mode
        insmod gzio
        insmod part_msdos
        insmod ext2
        set root='(hd0,[COLOR="Red"]msdos10[/COLOR])'
        search --no-floppy --fs-uuid --set=root 0770e53c-47df-49bd-b9a4-dc309c160d74
        linux    /boot/vmlinuz-3.2.0-34-generic root=UUID=0770e53c-47df-49bd-b9a4-dc309c160d74 ro   quiet splash $vt_handoff
        initrd    /boot/initrd.img-3.2.0-34-generic
    }
    so just change this line to
    Code:
    set root='(hd0,[COLOR="Red"]msdos6[/COLOR])'
    in every occurence in /boot/grub/grub.cfg and you Ubuntu should boot from now on.
     
  7. vicke4

    vicke4 Thread Starter

    Joined:
    Aug 9, 2012
    Messages:
    41
    I did all i was instructed to do.but there i saw the same error.I was in a quandary and after a contemplation I edited the fstab line as follows:

    Code:
    UUID=0770e53c-47df-49bd-b9a4-dc309c160d74  /            ext4  [COLOR="Red"]errors=remount-ro[/COLOR]                  0  1  
    I put defaults for the red coloured line.Now my problem solved.Anyway thank you for such a great help ;)

    I am learning how to use linux and its commands in a prosperous way.I really like this.Now i'm gonna to try multiboot using your guides.

    I think i have been annoying you to get help.From today I'll try to solve my own problem.

    Finally,what is your name dear saikee? :D
     
  8. saikee

    saikee

    Joined:
    Jun 11, 2004
    Messages:
    3,887
    Glad you got the problem solved.

    We can all learn from each other so I get something out of offering advice. This way I keep myself up to date.

    Linux is something for a PC user who like to understand what's going on. If you like to think you can find out many things in Linux just by reasoning it out.

    Saikee is the nickname my son gave me when he was about 2 years old. Most people just call me Sam.
     
  9. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1088733

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice