2

I installed Debian Jessie on a new hard disk, and wanted to boot from this new disk. At the end of Debian setup, I choosed setup Grub also. But when booting, Grub falls into rescue mode with a File not found error. I tried several guides I found around to try to have it up again, with no success.

Here is my configuration (I booted on a live Knoppix distro)

knoppix@Microknoppix:~$ lsblk -f
NAME   FSTYPE  LABEL        MOUNTPOINT

sda                         
└─sda1 ext4                 
sdb                         
├─sdb1 ext4                 
├─sdb2                      
└─sdb5 swap                 
sdc                         
└─sdc1 ntfs    Stock        
sdd                         
├─sdd1 ext4    Debian       
├─sdd2                      
└─sdd5 swap                 
sdh                         
└─sdh1 ntfs    My Passport  
sr0    iso9660 KNOPPIX      /mnt-system
sr1    udf     WD SmartWare 
zram0  swap                 [SWAP]
cloop0 iso9660 KNOPPIX_FS   /KNOPPIX

blkid

 /dev/cloop0: LABEL="KNOPPIX_FS" TYPE="iso9660" 
 /dev/zram0: UUID="770d53d4-32d4-4810-988a-ffb80edecc8f" TYPE="swap" 
 /dev/sda1: UUID="2a0bdecf-9074-40de-8d23-bcaf01af17bb" TYPE="ext4" 
 /dev/sdb1: UUID="a4eaeb3b-27d1-4285-a364-fcdfa601fb82" TYPE="ext4" 
 /dev/sdb5: UUID="76381585-358a-46a1-bc16-feb51b08fe90" TYPE="swap" 
 /dev/sdc1: LABEL="Stock" UUID="A2904C19904BF1F9" TYPE="ntfs" 
 /dev/sdd1: LABEL="Debian" UUID="c45c0acc-f414-4c3e-a4ba-b3c1a33c3cbd"    TYPE="ext4" 
 /dev/sdd5: UUID="2f0c8892-f4a8-4312-bc19-1e8d72f23e6c" TYPE="swap" 
 /dev/sr0: LABEL="KNOPPIX" TYPE="iso9660" 
 /dev/sdh1: LABEL="My Passport" UUID="325220A852207331" TYPE="ntfs" 
 /dev/sr1: LABEL="WD SmartWare" TYPE="udf" 

parted

(parted) print all                                                  
Model: ATA Maxtor 7V250F0 (scsi)
Disk /dev/sda: 251GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End    Size   Type     File system  Flags
 1      1049kB  251GB  251GB  primary  ext4         boot

Model: ATA Maxtor 7V300F0 (scsi)
Disk /dev/sdb: 300GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End    Size    Type      File system     Flags
 1      1049kB  284GB  284GB   primary   ext4
 2      284GB   300GB  16.1GB  extended
 5      284GB   300GB  16.1GB  logical   linux-swap(v1)

...

The grub.cfg file contains thism which looks correct

### BEGIN /etc/grub.d/10_linux ###
function gfxmode {
    set gfxpayload="${1}"
}
set linux_gfx_mode=
export linux_gfx_mode
menuentry 'Debian GNU/Linux' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-2a0bdecf-9074-40de-8d23-bcaf01af17bb' {
    load_video
    insmod gzio
    if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
    insmod part_msdos
    insmod ext2
    set root='hd0,msdos1'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  2a0bdecf-9074-40de-8d23-bcaf01af17bb
    else
      search --no-floppy --fs-uuid --set=root 2a0bdecf-9074-40de-8d23-bcaf01af17bb
    fi
    echo    'Loading Linux 3.16.0-4-amd64 ...'
    linux   /boot/vmlinuz-3.16.0-4-amd64 root=UUID=2a0bdecf-9074-40de-8d23-bcaf01af17bb ro  quiet
    echo    'Loading initial ramdisk ...'
    initrd  /boot/initrd.img-3.16.0-4-amd64
}

Note that the .mod files are in a seperate directory /boot/grub/i386-pc Is it usual?

Thank you for helping me understand what is wrong and how to solve this?

0

The line set root='hd0,msdos1' in your grub configuration tells grub that the root of your filesystem you want to work with is in the first partition of the first disk, which is the same as /dev/sda1.

Your parted output shows that /dev/sda1 has its bootable flag set, but a different partition, /dev/sdd1, is the one labeled "Debian" and I'm assuming your root filesystem lives there. If that's true you will need to edit your grub.cfg so grub is working with the right disk.

I would recommend making a backup of your grub.cfg and then changing the set root='hd0,msdos1' line to set root='hd3,msdos1' and repeating that change anywhere you see hd0 mentioned. Then use parted to set the bootable flag for /dev/sdd1 and try to boot Debian. Best of luck!

  • Actually, Debian is a former install. hd0 is the disk referenced in fstab, where is /dev/sda1. Switching to hd3 returns the same error! – user1185081 Apr 22 '15 at 21:08
  • Huh, I don't know what's wrong then. Everything about your configuration looks identical to the one I use, and same for the location of the .mod files. Is your grub folder where you expect it to be? – ivor-c Apr 22 '15 at 21:20
  • Yes, they are targeting the actual files in boot/ ... I ll try again from grub rescue ... – user1185081 Apr 22 '15 at 21:25
  • If all your files are where they belong and still can't be found your best bet may be to update-grub... Good luck – ivor-c Apr 22 '15 at 21:30
  • Well, digging with Grub rescue shows one thing: /dev/sda is pointing to hd3. The Grub I start with may not be the one I am trying to configure! I shall start from BIOS boot order to make sure of which disk I am booting on ... – user1185081 Apr 23 '15 at 7:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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