Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Fresh install, grub rescue: no such disk
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
1clue
Advocate
Advocate


Joined: 05 Feb 2006
Posts: 2549

PostPosted: Mon Aug 13, 2012 5:04 am    Post subject: Fresh install, grub rescue: no such disk Reply with quote

Hi.

Been fighting it all weekend, now I need help.

I have a new install. Grub shows error: no such disk.

I'm pretty much grub challenged, but I tried to ls every combination of drive I actually have using the wiki as a guide and it either can't find the disk or can't find the filesystem.

Here's my disk partitions:

Code:


livecd ~ # fdisk -l /dev/sda   (this is an ssd)

Disk /dev/sda: 240.1 GB, 240057409536 bytes
255 heads, 63 sectors/track, 29185 cylinders, total 468862128 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: 0x1744a0ef

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      526335      262144   83  Linux
/dev/sda2          526336    21497855    10485760   83  Linux
/dev/sda3        21497856   468862127   223682136   8e  Linux LVM



livecd ~ # fdisk -l /dev/sdb (and sdc and sdd, all identical 750g spinning disks, as RAID)

Disk /dev/sdb: 750.2 GB, 750156374016 bytes
255 heads, 63 sectors/track, 91201 cylinders, total 1465149168 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: 0x0001951e

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048   838862847   419430400   fd  Linux raid autodetect
/dev/sdb2       838862848   864028671    12582912   82  Linux swap / Solaris
/dev/sdb3       864028672  1465149167   300560248   fd  Linux raid autodetect



Here's the script I use right after boot to the livecd, called gs1:
Code:

mount /dev/sda2 /mnt/gentoo
mount /dev/sda1 /mnt/gentoo/boot
/bin/cp -f /mnt/gentoo/etc/mdadm.conf /etc/mdadm.conf
mdadm -S /dev/md126
mdadm -S /dev/md127
sleep 2
mdadm -A /dev/md1 --update=super-minor
sleep 2
mdadm -A /dev/md2 --update=super-minor
sleep 2
vgchange -a y

mount /dev/vg5/home          /mnt/gentoo/home
mount /dev/vgssd/opt         /mnt/gentoo/opt
mount /dev/vg0/tmp           /mnt/gentoo/tmp
mount /dev/vgssd/usr         /mnt/gentoo/usr
mount /dev/vg5/usr_portage   /mnt/gentoo/usr/portage
mount /dev/vg5/u_p_distfiles /mnt/gentoo/usr/portage/distfiles
mount /dev/vg5/var           /mnt/gentoo/var
mount /dev/vg5/var_db_pkg    /mnt/gentoo/var/db/pkg
mount /dev/vg0/var_log       /mnt/gentoo/var/log
mount /dev/vg0/var_tmp       /mnt/gentoo/var/tmp

swapon -a
mount -t proc proc /mnt/gentoo/proc
mount --rbind /dev /mnt/gentoo/dev
#cp -L /etc/resolv.conf /mnt/gentoo/etc/
/bin/cp -fL /root/gs2 /mnt/gentoo/
chroot /mnt/gentoo /bin/bash


And here's the one after I chroot, called gs2:
Code:

env-update && source /etc/profile
export PS1="(chroot) $PS1"
alias ll='ls -alh'


Code:

livecd ~ # pvscan
  PV /dev/sda3   VG vgssd   lvm2 [213.32 GiB / 201.32 GiB free]
  PV /dev/md2    VG vg0     lvm2 [859.90 GiB / 831.90 GiB free]
  PV /dev/md1    VG vg5     lvm2 [800.00 GiB / 777.00 GiB free]
  Total: 3 [1.83 TiB] / in use: 3 [1.83 TiB] / in no VG: 0 [0   ]

livecd ~ # lvscan
  ACTIVE            '/dev/vgssd/usr' [8.00 GiB] inherit
  ACTIVE            '/dev/vgssd/opt' [4.00 GiB] inherit
  ACTIVE            '/dev/vg0/tmp' [20.00 GiB] inherit
  ACTIVE            '/dev/vg0/var_tmp' [6.00 GiB] inherit
  ACTIVE            '/dev/vg0/var_log' [2.00 GiB] inherit
  ACTIVE            '/dev/vg5/usr_portage' [4.00 GiB] inherit
  ACTIVE            '/dev/vg5/u_p_distfiles' [4.00 GiB] inherit
  ACTIVE            '/dev/vg5/home' [10.00 GiB] inherit
  ACTIVE            '/dev/vg5/var' [4.00 GiB] inherit
  ACTIVE            '/dev/vg5/var_db_pkg' [1.00 GiB] inherit

livecd ~ # vgscan
  Reading all physical volumes.  This may take a while...
  Found volume group "vgssd" using metadata type lvm2
  Found volume group "vg0" using metadata type lvm2
  Found volume group "vg5" using metadata type lvm2


Here's the mounts as everything is set up right now:
Code:

df -h from outside the chroot

livecd ~ # df -h
df: `/mnt/cdrom': No such file or directory
Filesystem                     Size  Used Avail Use% Mounted on
rootfs                         5.9G   33M  5.9G   1% /
udev                            10M  304K  9.8M   3% /dev
/dev/loop0                     131M  131M     0 100% /mnt/livecd
rc-svcdir                      1.0M   80K  944K   8% /mnt/livecd/lib64/rc/init.d
shm                            5.9G     0  5.9G   0% /dev/shm
tmpfs                          5.9G   13M  5.9G   1% /mnt/livecd/lib64/firmware
tmpfs                          5.9G     0  5.9G   0% /mnt/livecd/usr/portage
/dev/sda2                       10G  373M  9.2G   4% /mnt/gentoo
/dev/sda1                      248M  9.2M  226M   4% /mnt/gentoo/boot
/dev/mapper/vg5-home            10G  280M  9.2G   3% /mnt/gentoo/home
/dev/mapper/vgssd-opt          4.0G  190M  3.7G   5% /mnt/gentoo/opt
/dev/mapper/vg0-tmp             20G  431M   19G   3% /mnt/gentoo/tmp
/dev/mapper/vgssd-usr          8.0G  2.9G  4.8G  38% /mnt/gentoo/usr
/dev/mapper/vg5-usr_portage    4.0G  809M  3.0G  21% /mnt/gentoo/usr/portage
/dev/mapper/vg5-u_p_distfiles  4.0G  914M  2.9G  24% /mnt/gentoo/usr/portage/distfiles
/dev/mapper/vg5-var            4.0G  208M  3.6G   6% /mnt/gentoo/var
/dev/mapper/vg5-var_db_pkg    1022M   97M  874M  10% /mnt/gentoo/var/db/pkg
/dev/mapper/vg0-var_log        2.0G   96M  1.9G   5% /mnt/gentoo/var/log
/dev/mapper/vg0-var_tmp        6.0G  223M  5.5G   4% /mnt/gentoo/var/tmp


And the same thing from inside chroot:

(chroot) livecd / # df -h
df: `/mnt/cdrom': No such file or directory
df: `/mnt/livecd': No such file or directory
df: `/mnt/livecd/lib64/rc/init.d': No such file or directory
df: `/sys/fs/fuse/connections': No such file or directory
df: `/mnt/livecd/lib64/firmware': No such file or directory
df: `/mnt/livecd/usr/portage': No such file or directory
df: `/sys/fs/fuse/connections': No such file or directory
Filesystem                     Size  Used Avail Use% Mounted on
sysfs                           10G  373M  9.2G   4% /sys
udev                            10M  304K  9.8M   3% /dev
tmpfs                           10G  373M  9.2G   4% /
shm                            5.9G     0  5.9G   0% /dev/shm
/dev/sda2                       10G  373M  9.2G   4% /
/dev/sda1                      248M  9.2M  226M   4% /boot
/dev/mapper/vg0-tmp             20G  431M   19G   3% /tmp
/dev/mapper/vg5-var            4.0G  208M  3.6G   6% /var
/dev/mapper/vgssd-usr          8.0G  2.9G  4.8G  38% /usr
/dev/mapper/vg5-home            10G  280M  9.2G   3% /home
/dev/mapper/vgssd-opt          4.0G  190M  3.7G   5% /opt
/dev/mapper/vg0-var_log        2.0G   96M  1.9G   5% /var/log
/dev/mapper/vg0-var_tmp        6.0G  223M  5.5G   4% /var/tmp
/dev/mapper/vg5-usr_portage    4.0G  809M  3.0G  21% /usr/portage
/dev/mapper/vg5-u_p_distfiles  4.0G  914M  2.9G  24% /usr/portage/distfiles
sysfs                           10G  373M  9.2G   4% /sys
udev                            10M  304K  9.8M   3% /dev
shm                            5.9G     0  5.9G   0% /dev/shm
/dev/mapper/vg5-var_db_pkg    1022M   97M  874M  10% /var/db/pkg
tmpfs                          6.0G  223M  5.5G   4% /var/tmp/portage



grub.conf:
Code:

(chroot) livecd / # cat /boot/grub/grub.conf
# This is a sample grub.conf for use with Genkernel, per the Gentoo handbook
# http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=1&chap=10#doc_chap2
# If you are not using Genkernel and you need help creating this file, you
# should consult the handbook. Alternatively, consult the grub.conf.sample that
# is included with the Grub documentation.

default 0
timeout 20
#splashimage=(hd0,0)/boot/grub/splash.xpm.gz

#title Gentoo Linux 2.6.24-r5
#root (hd0,0)
#kernel /boot/kernel-genkernel-x86-2.6.24-gentoo-r5 root=/dev/ram0 real_root=/dev/sda3
#initrd /boot/initramfs-genkernel-x86-2.6.24-gentoo-r5


title Gentoo Linux 3.3.8-gentoo
root(hd0,0)
kernel /boot/kernel-3.3.8-gentoo root=/dev/ram0 real_root=/dev/sda2
initrd /boot/initramfs-genkernel-x86_64-3.3.8-gentoo


# vim:ft=conf:


Thanks.
Back to top
View user's profile Send private message
1clue
Advocate
Advocate


Joined: 05 Feb 2006
Posts: 2549

PostPosted: Tue Aug 14, 2012 1:32 am    Post subject: Reply with quote

Bump.
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7071

PostPosted: Tue Aug 14, 2012 2:23 am    Post subject: Reply with quote

don't ask ls or fdisk, you will see how the current kernel is seeing your disk, not how grub is seeing them when booting.
fire grub and in its shell ask grub directly
enter root (hd and hit tab key so grub autocomplete all disks showing you who is who)

because livecd showing your ssd as sda isn't a proof another kernel/boot compo won't see it as sdb
Back to top
View user's profile Send private message
1clue
Advocate
Advocate


Joined: 05 Feb 2006
Posts: 2549

PostPosted: Tue Aug 14, 2012 4:54 am    Post subject: Reply with quote

OK thanks so far, but didn't work as planned.

First, I tried root(hd<tab> but it didn't work. Then I tried
Code:
ls
and all 4 disks show as (hd0) (hd0,msdos3) (hd0,msdos2) (hd0,msdos1) (hd1)...

All four disks have 3 partitions, all four look identical. It doesn't say anything about partition types or any of that. It doesn't mark any partition as bootable.

Is there an immutable way to do this? Like for example UUID?

I tried root(hd1,0) but grub doesn't understand root.
Back to top
View user's profile Send private message
Ulven101
n00b
n00b


Joined: 06 Mar 2010
Posts: 10

PostPosted: Tue Aug 14, 2012 10:28 am    Post subject: Reply with quote

What you get if you run
Code:
grep -v /proc/mounts > /etc/mtab

before re-installing grub?
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7071

PostPosted: Tue Aug 14, 2012 10:44 am    Post subject: Reply with quote

it's root<space>(hdbhablahbalh) else it's not a grub command.

now you can redo with root (hd0, and tab and this time it will list partition type.

or just use the grub find command
Code:
find /boot/grub/stage1

And grub will tell you what disk/partition have the file
Back to top
View user's profile Send private message
1clue
Advocate
Advocate


Joined: 05 Feb 2006
Posts: 2549

PostPosted: Wed Aug 15, 2012 12:35 am    Post subject: Reply with quote

krinn wrote:
it's root<space>(hdbhablahbalh) else it's not a grub command.

now you can redo with root (hd0, and tab and this time it will list partition type.

or just use the grub find command
Code:
find /boot/grub/stage1

And grub will tell you what disk/partition have the file



Only it doesn't. I tried with one space, two spaces, no spaces, spaces after the parenthesis, everything. No tab completion.

I tried guessing at a root based on what I know there to be, and that doesn't work either.

Is it possible that I have a bad grub compile? I didn't see any errors when it compiled but it was late so I might have missed it.
Back to top
View user's profile Send private message
1clue
Advocate
Advocate


Joined: 05 Feb 2006
Posts: 2549

PostPosted: Wed Aug 15, 2012 12:57 am    Post subject: Reply with quote

I really don't get it. I've had Gentoo on this box before. It never had problems finding /boot before. I don't see how just compiling a new kernel would cause the drives to change order, and if it does it's a bug.

I thought that the SATA cables going into the ports on the board determined drive numbering. In fact, when I was trying to get my SSD to become sda I changed cables around and it worked.

There has GOT to be a way to make grub always take a specific drive.
Back to top
View user's profile Send private message
1clue
Advocate
Advocate


Joined: 05 Feb 2006
Posts: 2549

PostPosted: Wed Aug 15, 2012 1:30 am    Post subject: Reply with quote

Ulven101 wrote:
What you get if you run
Code:
grep -v /proc/mounts > /etc/mtab

before re-installing grub?


Code:


(chroot) livecd / # grep -v /proc/mounts /etc/mtab
proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
udev /dev devtmpfs rw,nosuid,relatime,size=10240k,nr_inodes=1536571,mode=755 0 0
devpts /dev/pts devpts rw,relatime,gid=5,mode=620 0 0
tmpfs / tmpfs rw,relatime 0 0
/dev/sr0 /mnt/cdrom iso9660 ro,relatime 0 0
/dev/loop0 /mnt/livecd squashfs ro,relatime 0 0
rc-svcdir /mnt/livecd/lib64/rc/init.d tmpfs rw,nosuid,nodev,noexec,relatime,size=1024k,mode=755 0 0
fusectl /sys/fs/fuse/connections fusectl rw,relatime 0 0
shm /dev/shm tmpfs rw,nosuid,nodev,noexec,relatime 0 0
tmpfs /mnt/livecd/lib64/firmware tmpfs rw,relatime 0 0
tmpfs /mnt/livecd/usr/portage tmpfs rw,relatime 0 0
usbfs /proc/bus/usb usbfs rw,nosuid,noexec,relatime,devgid=85,devmode=664 0 0
/dev/sda2 / ext4 rw,relatime,user_xattr,acl,barrier=1,data=ordered 0 0
/dev/sda1 /boot ext2 rw,relatime,errors=continue 0 0
/dev/mapper/vg5-home /home ext4 rw,relatime,user_xattr,acl,barrier=1,stripe=256,data=ordered 0 0
/dev/mapper/vgssd-opt /opt ext4 rw,relatime,user_xattr,acl,barrier=1,data=ordered 0 0
/dev/mapper/vg0-tmp /tmp ext4 rw,relatime,user_xattr,acl,barrier=1,stripe=384,data=ordered 0 0
/dev/mapper/vgssd-usr /usr ext4 rw,relatime,user_xattr,acl,barrier=1,data=ordered 0 0
/dev/mapper/vg5-usr_portage /usr/portage ext4 rw,relatime,user_xattr,acl,barrier=1,stripe=256,data=ordered 0 0
/dev/mapper/vg5-u_p_distfiles /usr/portage/distfiles ext4 rw,relatime,user_xattr,acl,barrier=1,stripe=256,data=ordered 0 0
/dev/mapper/vg5-var /var ext4 rw,relatime,user_xattr,acl,barrier=1,stripe=256,data=ordered 0 0
/dev/mapper/vg5-var_db_pkg /var/db/pkg ext4 rw,relatime,user_xattr,acl,barrier=1,stripe=256,data=ordered 0 0
/dev/mapper/vg0-var_log /var/log ext4 rw,relatime,user_xattr,acl,barrier=1,stripe=384,data=ordered 0 0
/dev/mapper/vg0-var_tmp /var/tmp ext4 rw,relatime,user_xattr,acl,barrier=1,stripe=384,data=ordered 0 0
proc /proc proc rw,relatime 0 0
udev /dev devtmpfs rw,nosuid,relatime,size=10240k,nr_inodes=1536571,mode=755 0 0
devpts /dev/pts devpts rw,relatime,gid=5,mode=620 0 0
shm /dev/shm tmpfs rw,nosuid,nodev,noexec,relatime 0 0
Back to top
View user's profile Send private message
1clue
Advocate
Advocate


Joined: 05 Feb 2006
Posts: 2549

PostPosted: Wed Aug 15, 2012 1:57 am    Post subject: Reply with quote

Let me clarify something:

If I'm in the chroot environment per the handbook instructions, right around the point where you're supposed to do grub things, all the commands you guys have been saying work.

If I try to reboot, I fail and drop into 'grub rescue' prompt. That's where the commands don't work.

FWIW I've been googling around for grub documentation and nothing seems to work in that shell at all.

I just tried recompiling grub and that doesn't work either.

Is there some reason why Gentoo amd64 doesn't use grub2?

Thanks.
Back to top
View user's profile Send private message
1clue
Advocate
Advocate


Joined: 05 Feb 2006
Posts: 2549

PostPosted: Wed Aug 15, 2012 10:42 pm    Post subject: Reply with quote

I obviously missed something important while trying to install from the handbook, the raid+lvm page and the ssd page all at once.

When I get off the train I will scrape it off and start over.
Back to top
View user's profile Send private message
1clue
Advocate
Advocate


Joined: 05 Feb 2006
Posts: 2549

PostPosted: Fri Aug 17, 2012 4:16 am    Post subject: Reply with quote

I did everything again. Didn't get any further.

On a lark I just downloaded xubuntu 12.04 and installed it. I swear it was 5 minutes from start to finish.

It boots fine. The hardware is good.

My fiancee is cranky because it's been taking so long to install the box again. I'm leaving xubuntu on for now, let her play with it and see if she wants it on her laptop.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum