Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a Kubuntu 11.10 system with a HDD (sda) and an SSD (sdb). /home and /var and swap are partitions on the HDD and the / partition is the only one on the SSD. All partitions are ext4 (except swap).

Now I shrinked the /home partition a bit to get a /tmp partition onto the HDD, to be gentle to the SSD.

Then I introduced a new line into /etc/fstab where I just copied the line from /var and replaced the UUID and the mount point. I cleaned out /tmp and left its mode drwxrwxrwt.

proc            /proc           proc    nodev,noexec,nosuid 0       0
UUID=0d6e6bb9-ec95-4563-b74e-323aeb51a63d /               ext4    discard,errors=remount-ro 0       1
UUID=78baabf7-d7a6-420d-a992-d4bebb83e2ed /home           ext4    defaults        0       2
UUID=4ebe846f-5fcb-45e8-bad7-2e28d223b183 /var            ext4    defaults        0       2
UUID=ce4aaf1a-3841-4bac-8fa3-31bda839a579 /tmp            ext4    defaults        0       2
UUID=87439ac8-0044-4a54-8b2d-7cefc644b2a6 none            swap    sw              0       0

When I rebooted, I got the following error on a solid blue screen:

error: could not read file

I tried reinstalling GRUB 2, following this German wiki. You can see the commands there, I did them to /dev/sdb.

How can I fix my system, short of reinstalling everything?


Boot priority

The SSD is the second SATA device, the HDD is the first one:

But it is selected as the primary boot device:

Blkid

The output of blkid:

# blkid
/dev/loop0: TYPE="squashfs"
/dev/sda1: LABEL="HP-var" UUID="4ebe846f-5fcb-45e8-bad7-2e28d223b183" TYPE="ext4"
/dev/sda2: LABEL="HP-User" UUID="78baabf7-d7a6-420d-a992-d4bebb83e2ed" TYPE="ext4"
/dev/sda3: LABEL="HP-tmp" UUID="ce4aaf1a-3841-4bac-8fa3-31bda839a579" TYPE="ext4"
/dev/sda4: UUID="87439ac8-0044-4a54-8b2d-7cefc644b2a6" TYPE="swap"
/dev/sdb1: LABEL="SSD" UUID="0d6e6bb9-ec95-4563-b74e-323aeb51a63d" TYPE="ext4"

Boot Info Script

That is what the boot info script gives me:

                  Boot Info Script 0.60    from 17 May 2011


============================= Boot Info Summary: ===============================

 => Grub2 (v1.99) is installed in the MBR of /dev/sda and looks at sector 1 of 
    the same hard drive for core.img. core.img is at this location and looks 
    in partition 1 for ??.
 => Grub2 (v1.99) is installed in the MBR of /dev/sdb and looks at sector 1 of 
    the same hard drive for core.img. core.img is at this location and looks 
    for ?? on this drive.

sda1: __________________________________________________________________________

    File system:       ext4
    Boot sector type:  -
    Boot sector info:  
    Operating System:  
    Boot files:        

sda2: __________________________________________________________________________

    File system:       ext4
    Boot sector type:  -
    Boot sector info:  
    Operating System:  
    Boot files:        

sda3: __________________________________________________________________________

    File system:       ext4
    Boot sector type:  -
    Boot sector info:  
    Operating System:  
    Boot files:        

sda4: __________________________________________________________________________

    File system:       swap
    Boot sector type:  -
    Boot sector info:  

sdb1: __________________________________________________________________________

    File system:       ext4
    Boot sector type:  -
    Boot sector info:  
    Operating System:  Ubuntu 11.10
    Boot files:        /boot/grub/grub.cfg /etc/fstab /boot/grub/core.img

============================ Drive/Partition Info: =============================

Drive: sda _____________________________________________________________________

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes

Partition  Boot  Start Sector    End Sector  # of Sectors  Id System

/dev/sda1         948,477,600   968,944,409    20,466,810  83 Linux
/dev/sda2                  63   938,179,934   938,179,872  83 Linux
/dev/sda3         938,179,935   948,477,599    10,297,665  83 Linux
/dev/sda4         968,960,000   976,771,071     7,811,072  82 Linux swap / Solaris


Drive: sdb _____________________________________________________________________

Disk /dev/sdb: 60.0 GB, 60022480896 bytes
255 heads, 63 sectors/track, 7297 cylinders, total 117231408 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes

Partition  Boot  Start Sector    End Sector  # of Sectors  Id System

/dev/sdb1               2,048   117,229,567   117,227,520  83 Linux


"blkid" output: ________________________________________________________________

Device           UUID                                   TYPE       LABEL

/dev/loop0                                              squashfs   
/dev/sda1        4ebe846f-5fcb-45e8-bad7-2e28d223b183   ext4       HP-var
/dev/sda2        78baabf7-d7a6-420d-a992-d4bebb83e2ed   ext4       HP-User
/dev/sda3        ce4aaf1a-3841-4bac-8fa3-31bda839a579   ext4       HP-tmp
/dev/sda4        87439ac8-0044-4a54-8b2d-7cefc644b2a6   swap       
/dev/sdb1        0d6e6bb9-ec95-4563-b74e-323aeb51a63d   ext4       SSD

================================ Mount points: =================================

Device           Mount_Point              Type       Options

/dev/loop0       /rofs                    squashfs   (ro,noatime)
/dev/sr0         /cdrom                   iso9660    (ro,noatime)


=========================== sdb1/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="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 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='(hd1,msdos1)'
search --no-floppy --fs-uuid --set=root 0d6e6bb9-ec95-4563-b74e-323aeb51a63d
if loadfont /usr/share/grub/unicode.pf2 ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  insmod part_msdos
  insmod ext2
  set root='(hd1,msdos1)'
  search --no-floppy --fs-uuid --set=root 0d6e6bb9-ec95-4563-b74e-323aeb51a63d
  set locale_dir=($root)/boot/grub/locale
  set lang=de_DE
  insmod gettext
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ]; then
  set timeout=-1
else
  set timeout=10
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 0,71,115; then
  clear
fi
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
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, mit Linux 3.0.0-16-generic' --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    set gfxpayload=$linux_gfx_mode
    insmod gzio
    insmod part_msdos
    insmod ext2
    set root='(hd1,msdos1)'
    search --no-floppy --fs-uuid --set=root 0d6e6bb9-ec95-4563-b74e-323aeb51a63d
    linux   /boot/vmlinuz-3.0.0-16-generic root=UUID=0d6e6bb9-ec95-4563-b74e-323aeb51a63d ro   quiet splash vt.handoff=7
    initrd  /boot/initrd.img-3.0.0-16-generic
}
menuentry 'Ubuntu, mit Linux 3.0.0-16-generic (Wiederherstellungsmodus)' --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    insmod gzio
    insmod part_msdos
    insmod ext2
    set root='(hd1,msdos1)'
    search --no-floppy --fs-uuid --set=root 0d6e6bb9-ec95-4563-b74e-323aeb51a63d
    echo    'Linux 3.0.0-16-generic wird geladen …'
    linux   /boot/vmlinuz-3.0.0-16-generic root=UUID=0d6e6bb9-ec95-4563-b74e-323aeb51a63d ro recovery nomodeset 
    echo    'Initiale Ramdisk wird geladen …'
    initrd  /boot/initrd.img-3.0.0-16-generic
}
submenu "Previous Linux versions" {
menuentry 'Ubuntu, mit Linux 3.0.0-15-generic' --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    set gfxpayload=$linux_gfx_mode
    insmod gzio
    insmod part_msdos
    insmod ext2
    set root='(hd1,msdos1)'
    search --no-floppy --fs-uuid --set=root 0d6e6bb9-ec95-4563-b74e-323aeb51a63d
    linux   /boot/vmlinuz-3.0.0-15-generic root=UUID=0d6e6bb9-ec95-4563-b74e-323aeb51a63d ro   quiet splash vt.handoff=7
    initrd  /boot/initrd.img-3.0.0-15-generic
}
menuentry 'Ubuntu, mit Linux 3.0.0-15-generic (Wiederherstellungsmodus)' --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    insmod gzio
    insmod part_msdos
    insmod ext2
    set root='(hd1,msdos1)'
    search --no-floppy --fs-uuid --set=root 0d6e6bb9-ec95-4563-b74e-323aeb51a63d
    echo    'Linux 3.0.0-15-generic wird geladen …'
    linux   /boot/vmlinuz-3.0.0-15-generic root=UUID=0d6e6bb9-ec95-4563-b74e-323aeb51a63d ro recovery nomodeset 
    echo    'Initiale Ramdisk wird geladen …'
    initrd  /boot/initrd.img-3.0.0-15-generic
}
menuentry 'Ubuntu, mit Linux 3.0.0-14-generic' --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    set gfxpayload=$linux_gfx_mode
    insmod gzio
    insmod part_msdos
    insmod ext2
    set root='(hd1,msdos1)'
    search --no-floppy --fs-uuid --set=root 0d6e6bb9-ec95-4563-b74e-323aeb51a63d
    linux   /boot/vmlinuz-3.0.0-14-generic root=UUID=0d6e6bb9-ec95-4563-b74e-323aeb51a63d ro   quiet splash vt.handoff=7
    initrd  /boot/initrd.img-3.0.0-14-generic
}
menuentry 'Ubuntu, mit Linux 3.0.0-14-generic (Wiederherstellungsmodus)' --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    insmod gzio
    insmod part_msdos
    insmod ext2
    set root='(hd1,msdos1)'
    search --no-floppy --fs-uuid --set=root 0d6e6bb9-ec95-4563-b74e-323aeb51a63d
    echo    'Linux 3.0.0-14-generic wird geladen …'
    linux   /boot/vmlinuz-3.0.0-14-generic root=UUID=0d6e6bb9-ec95-4563-b74e-323aeb51a63d ro recovery nomodeset 
    echo    'Initiale Ramdisk wird geladen …'
    initrd  /boot/initrd.img-3.0.0-14-generic
}
menuentry 'Ubuntu, mit Linux 3.0.0-13-generic' --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    set gfxpayload=$linux_gfx_mode
    insmod gzio
    insmod part_msdos
    insmod ext2
    set root='(hd1,msdos1)'
    search --no-floppy --fs-uuid --set=root 0d6e6bb9-ec95-4563-b74e-323aeb51a63d
    linux   /boot/vmlinuz-3.0.0-13-generic root=UUID=0d6e6bb9-ec95-4563-b74e-323aeb51a63d ro   quiet splash vt.handoff=7
    initrd  /boot/initrd.img-3.0.0-13-generic
}
menuentry 'Ubuntu, mit Linux 3.0.0-13-generic (Wiederherstellungsmodus)' --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    insmod gzio
    insmod part_msdos
    insmod ext2
    set root='(hd1,msdos1)'
    search --no-floppy --fs-uuid --set=root 0d6e6bb9-ec95-4563-b74e-323aeb51a63d
    echo    'Linux 3.0.0-13-generic wird geladen …'
    linux   /boot/vmlinuz-3.0.0-13-generic root=UUID=0d6e6bb9-ec95-4563-b74e-323aeb51a63d ro recovery nomodeset 
    echo    'Initiale Ramdisk wird geladen …'
    initrd  /boot/initrd.img-3.0.0-13-generic
}
menuentry 'Ubuntu, mit Linux 3.0.0-12-generic' --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    set gfxpayload=$linux_gfx_mode
    insmod gzio
    insmod part_msdos
    insmod ext2
    set root='(hd1,msdos1)'
    search --no-floppy --fs-uuid --set=root 0d6e6bb9-ec95-4563-b74e-323aeb51a63d
    linux   /boot/vmlinuz-3.0.0-12-generic root=UUID=0d6e6bb9-ec95-4563-b74e-323aeb51a63d ro   quiet splash vt.handoff=7
    initrd  /boot/initrd.img-3.0.0-12-generic
}
menuentry 'Ubuntu, mit Linux 3.0.0-12-generic (Wiederherstellungsmodus)' --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    insmod gzio
    insmod part_msdos
    insmod ext2
    set root='(hd1,msdos1)'
    search --no-floppy --fs-uuid --set=root 0d6e6bb9-ec95-4563-b74e-323aeb51a63d
    echo    'Linux 3.0.0-12-generic wird geladen …'
    linux   /boot/vmlinuz-3.0.0-12-generic root=UUID=0d6e6bb9-ec95-4563-b74e-323aeb51a63d ro recovery nomodeset 
    echo    'Initiale Ramdisk wird geladen …'
    initrd  /boot/initrd.img-3.0.0-12-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='(hd1,msdos1)'
    search --no-floppy --fs-uuid --set=root 0d6e6bb9-ec95-4563-b74e-323aeb51a63d
    linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
    insmod part_msdos
    insmod ext2
    set root='(hd1,msdos1)'
    search --no-floppy --fs-uuid --set=root 0d6e6bb9-ec95-4563-b74e-323aeb51a63d
    linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
if [ "x${timeout}" != "x-1" ]; then
  if keystatus; then
    if keystatus --shift; then
      set timeout=-1
    else
      set timeout=0
    fi
  else
    if sleep --interruptible 3 ; then
      set timeout=0
    fi
  fi
fi
### 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 ###
--------------------------------------------------------------------------------

=============================== sdb1/etc/fstab: ================================

--------------------------------------------------------------------------------
# /etc/fstab: static file system information.
#
# Use 'blkid -o value -s UUID' 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
UUID=0d6e6bb9-ec95-4563-b74e-323aeb51a63d /               ext4    discard,errors=remount-ro 0       1
UUID=ce4aaf1a-3841-4bac-8fa3-31bda839a579 /tmp            ext4    defaults        0       2
UUID=78baabf7-d7a6-420d-a992-d4bebb83e2ed /home           ext4    defaults        0       2
UUID=4ebe846f-5fcb-45e8-bad7-2e28d223b183 /var            ext4    defaults        0       2
UUID=87439ac8-0044-4a54-8b2d-7cefc644b2a6 none            swap    sw              0       0
--------------------------------------------------------------------------------

=================== sdb1: Location of files loaded by Grub: ====================

           GiB - GB             File                                 Fragment(s)

  16.268638611 = 17.468317696   boot/grub/core.img                             1
  16.268650055 = 17.468329984   boot/grub/grub.cfg                             1
   1.716423035 = 1.842995200    boot/initrd.img-3.0.0-12-generic               2
   2.290039062 = 2.458910720    boot/initrd.img-3.0.0-13-generic               2
   2.631473541 = 2.825523200    boot/initrd.img-3.0.0-14-generic               2
  29.821289062 = 32.020365312   boot/initrd.img-3.0.0-15-generic               2
  21.446289062 = 23.027777536   boot/initrd.img-3.0.0-16-generic               2
  14.587322235 = 15.663017984   boot/vmlinuz-3.0.0-12-generic                  1
   0.161544800 = 0.173457408    boot/vmlinuz-3.0.0-13-generic                  1
   1.880294800 = 2.018951168    boot/vmlinuz-3.0.0-14-generic                  2
   3.247486115 = 3.486961664    boot/vmlinuz-3.0.0-15-generic                  3
   2.349048615 = 2.522271744    boot/vmlinuz-3.0.0-16-generic                  1
   2.349048615 = 2.522271744    vmlinuz                                        1
   3.247486115 = 3.486961664    vmlinuz.old                                    3

========= Devices which don't seem to have a corresponding hard drive: =========

sdc sdd sde sdf 

=============================== StdErr Messages: ===============================

To be able to see for which directory Grub2 (v1.99) looks for, install "unlzma".
To be able to see for which directory Grub2 (v1.99) looks for, install "unlzma".
share|improve this question
    
Did you make sure that the SSD is the first in boot priority and did you make sure you ran update-grub? Also the output of sudo blkid might prove to be useful or even a link to a pastebin with the output from Boot Info Script –  nitstorm Feb 17 '12 at 18:47
1  
Okay, I attached all the information. I ran update-grub and it did not complain. –  queueoverflow Feb 17 '12 at 19:18
    
So did update-grub again. I rebooted, did not work. Then I changed to boot from the HDD, it worked! I could not get into KDE, so I fixed the permissions of the /tmp folder. Then I restarted but it did not work. Then I changed back to the SSD and it now worked two times in a row. Then I unplugged the computer and it did not work again, it seems broken again now. –  queueoverflow Feb 17 '12 at 19:52
1  
Now I did another round of update-grub and it works. –  queueoverflow Feb 17 '12 at 22:01
add comment

1 Answer 1

You have GRUB listed twice. Once on sda and again on sdb. This doesn't play well. Which ever drive you make priority in the BIOS you need to have the GRUB on that drive.

If you sudo fdisk -l you will find the Boot "*" partition that GRUB is using. The UUID=0d6e6bb9-ec95-4563-b74e-323aeb51a63d has fragmentation issues and needs cleaning.

If it was me I would want to re-think the format of where I was going with the installation and start fresh.

Since you have separate partitions and /home lives on HDD I would Priority the BIOS to boot from the SSD and install the OS there. Include the SWAP partition.

Use the HDD for my /home /var and /tmp Let the OS handle the rest.

share|improve this answer
    
Could I fix the fragmentation and remove GRUB from the HDD somehow to fix this? How do I do that? –  queueoverflow Feb 17 '12 at 21:01
    
I would use a Live CD/DVD and boot then using the "Disk Utility" repair the HDD issue. Because you cannot "FIX" anything while mounted it will have to be done from a CD. Download "Boot Repair" and set up the proper boot reference. –  Ringtail Feb 17 '12 at 23:55
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.