LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Gentoo
User Name
Password
Gentoo This forum is for the discussion of Gentoo Linux.

Notices


Reply
  Search this Thread
Old 10-05-2014, 05:01 AM   #1
Olaf35
LQ Newbie
 
Registered: Jul 2014
Distribution: Slackware
Posts: 6

Rep: Reputation: Disabled
initramfs don't find my root block device


Hi,

I've got an externel hdd with a gentoo linux. I can plug this hdd to multiple different Laptops and PCs and can use gentoo. On one Laptop I can boot fine, my root block device is detected (UUID=a97c2681-5124-4749-baf0-dc65031460a8) to /dev/sdb1. These Laptop don't have a CD/DVD device. On other Laptops the detection fails. I got the message:

>>Determining root device...
!! Could not find the root block device in UUID=a97c2681-5124-4749-baf0-dc65031460a8
!! Please specify another value or:
!! - press Enter for the same
!! - type "shell" for a shell
!! - type "q" to skip

If I type "shell" and "exit" to exit the shell the system boots from the correct device /dev/sdb1 or (/dev/sdf1 on another PC). The same happens if I type "q".
The differences of these Laptops/PCs are, that they have got a CD/DVD drive.

The system boots with grub2 with an initramfs.

How can I fix it?
 
Old 10-05-2014, 05:49 AM   #2
Drakeo
Senior Member
 
Registered: Jan 2008
Location: Urbana IL
Distribution: Slackware, Slacko,
Posts: 3,716
Blog Entries: 3

Rep: Reputation: 483Reputation: 483Reputation: 483Reputation: 483Reputation: 483
]I think your problem is your bios settings. but it would be nice to see if a f12 or f8 or f10 functions bring up a menu for devices to boot from. and I would check my bios to see where that device is placed. now I have also edited my grub a few times to actually read root=/dev/sdx and then edited my /etc/fstab to be the same.

Why ? so it does not have to scan all it has to do is look for that device not read a blkid.
you can make a few different grub entries some with blkid some with out.

Last edited by Drakeo; 10-05-2014 at 01:11 PM.
 
Old 10-05-2014, 02:41 PM   #3
Olaf35
LQ Newbie
 
Registered: Jul 2014
Distribution: Slackware
Posts: 6

Original Poster
Rep: Reputation: Disabled
Hi Drakeo,

thank you for your reply. On the PC I have to press the F8 key for the boot menu and on a laptop it is the F10 key. In both machines the CD/DVD drive will be prefered in the boot sequence.

By changing the root or real_root entry in grub2 doesn't help.

The message comes from the init script inside my initramfs ramdisk.

...
# Determine root device
good_msg 'Determining root device...'
while true
do
while [ "${got_good_root}" != '1' ]
do
case "${REAL_ROOT}" in
LABEL=*|UUID=*)

ROOT_DEV=""
retval=1

if [ ${retval} -ne 0 ]; then
ROOT_DEV=$(findfs "${REAL_ROOT}" 2>/dev/null)
retval=$?
fi

if [ ${retval} -ne 0 ]; then
ROOT_DEV=$(busybox findfs "${REAL_ROOT}" 2>/dev/null)
retval=$?
fi

if [ ${retval} -ne 0 ]; then
ROOT_DEV=$(blkid -o device -l -t "${REAL_ROOT}")
retval=$?
fi

if [ ${retval} -eq 0 ] && [ -n "${ROOT_DEV}" ]; then
good_msg "Detected real_root=${ROOT_DEV}"
REAL_ROOT="${ROOT_DEV}"
else
prompt_user "REAL_ROOT" "root block device"
got_good_root=0
continue
fi
;;
ZFS*)
if [ "${USE_ZFS}" = '0' ]; then
prompt_user "REAL_ROOT" "root block device"
continue
fi

ROOT_DEV="${REAL_ROOT#*=}"
if [ "${ROOT_DEV}" != 'ZFS' ]
then
if [ "$(zfs get type -o value -H ${ROOT_DEV})" = 'filesystem' ]
then
got_good_root=1;
REAL_ROOT=${ROOT_DEV}
ROOTFSTYPE=zfs
else
bad_msg "${ROOT_DEV} is not a filesystem"
prompt_user "REAL_ROOT" "root block device"
got_good_root=0
continue
fi
else
BOOTFS=$(/sbin/zpool list -H -o bootfs)
if [ "${BOOTFS}" != '-' ]
then

for i in ${BOOTFS}
do

zfs get type ${i} > /dev/null
retval=$?

if [ ${retval} -eq 0 ]; then
got_good_root=1
REAL_ROOT=${i}
ROOTFSTYPE=zfs
break
fi

done;

else
got_good_root=0
fi

fi

if [ ${got_good_root} -ne 1 ]; then
prompt_user "REAL_ROOT" "root block device"
got_good_root=0
fi

continue
;;
esac

if [ "${REAL_ROOT}" = '' ]
then
# No REAL_ROOT determined/specified. Prompt user for root block device.
prompt_user "REAL_ROOT" "root block device"
got_good_root=0

# Check for a block device or /dev/nfs
elif [ -b "${REAL_ROOT}" ] || [ "${REAL_ROOT}" = "/dev/nfs" ]
then
got_good_root=1

else
bad_msg "Block device ${REAL_ROOT} is not a valid root device..."
REAL_ROOT=""
got_good_root=0
fi
done


if [ "${CDROOT}" = 1 -a "${got_good_root}" = '1' -a "${REAL_ROOT}" != "/dev/nfs" ]
then
# CD already mounted; no further checks necessary
break
elif [ "${LOOPTYPE}" = "sgimips" ]
then
# sgimips mounts the livecd root partition directly
# there is no isofs filesystem to worry about
break
else
good_msg "Mounting $REAL_ROOT as root..."

if [ "${ROOTFSTYPE}" = 'zfs' ]
then
if [ "zfs get -H -o value mountpoint ${REAL_ROOT}" = 'legacy' ]
then
MOUNT_STATE=rw
else
MOUNT_STATE=rw,zfsutil
fi
else
MOUNT_STATE=ro
fi

# Try to mount the device as ${NEW_ROOT}
if [ "${REAL_ROOT}" = '/dev/nfs' ]; then
findnfsmount
else
# If $REAL_ROOT is a symlink
# Resolve it like util-linux mount does
[ -L ${REAL_ROOT} ] && REAL_ROOT=`readlink ${REAL_ROOT}`
# mount ro so fsck doesn't barf later
if [ "${REAL_ROOTFLAGS}" = '' ]; then
good_msg "Using mount -t ${ROOTFSTYPE} -o ${MOUNT_STATE}"
mount -t ${ROOTFSTYPE} -o ${MOUNT_STATE} ${REAL_ROOT} ${NEW_ROOT}
else
good_msg "Using mount -t ${ROOTFSTYPE} -o ${MOUNT_STATE},${REAL_ROOTFLAGS}"
mount -t ${ROOTFSTYPE} -o ${MOUNT_STATE},${REAL_ROOTFLAGS} ${REAL_ROOT} ${NEW_ROOT}
fi
fi

# If mount is successful break out of the loop
# else not a good root and start over.
if [ "$?" = '0' ]
then
if [ -d ${NEW_ROOT}/dev -a -x "${NEW_ROOT}${REAL_INIT:-/sbin/init}" ] || [ "${REAL_ROOT}" = "/dev/nfs" ]
then
break
else
bad_msg "The filesystem mounted at ${REAL_ROOT} does not appear to be a valid /, try again"
got_good_root=0
REAL_ROOT=''
fi
else
bad_msg "Could not mount specified ROOT, try again"
got_good_root=0
REAL_ROOT=''
fi
fi
done
# End determine root device
...

The problem is that I need this initramfs because of the multiple PCs and Laptops. I use genkernel to build a new kernel and this initramfs automaticly.

What can I change in the bios tho hide this message? Changing the boot sequence?

My /etc/fstab

/dev/dvd0 /mnt/cdrom auto noauto,ro 0 0
UUID=a97c2681-5124-4749-baf0-dc65031460a8 / jfs noauto,noatime 0 1
UUID=00c1a898-b516-497a-9617-f10d1811eb16 none swap sw 0 0

I've also tried

/dev/dvd0 /mnt/cdrom auto noauto,ro 0 0
/dev/sdb1 / jfs noauto,noatime 0 1
/dev/sdb2 none swap sw 0 0

but it also doesn't help.
 
Old 10-06-2014, 05:16 PM   #4
Drakeo
Senior Member
 
Registered: Jan 2008
Location: Urbana IL
Distribution: Slackware, Slacko,
Posts: 3,716
Blog Entries: 3

Rep: Reputation: 483Reputation: 483Reputation: 483Reputation: 483Reputation: 483
ok Try to explaine this again it seems the bios on that machine do not want to scan for BLKID. so in your grub make another entry just like the one you use to
boot with and title it for (this Laptop)
now were it reads root=UUID=a97c2681-5124-4749-baf0-dc65031460a8 change it to root=/dev/sd?? sda1 sdb1 etc etc. the for here is an example.
Code:
menuentry 'Slackware-14.1 GNU/Linux' --class slackware-14.1 --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-f52adeea-a45c-4dc5-b599-aecadc1709b5' {
	load_video
	insmod gzio
	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  f52adeea-a45c-4dc5-b599-aecadc1709b5
	else
	  search --no-floppy --fs-uuid --set=root f52adeea-a45c-4dc5-b599-aecadc1709b5
	fi
	echo	'Loading Linux 3.10.17 ...'
	linux	/boot/vmlinuz-huge-3.10.17 root=UUID=f52adeea-a45c-4dc5-b599-aecadc1709b5 ro  
	echo	'Loading initial ramdisk ...'
	initrd	/boot/initrd-3.10.17.gz
change to
Code:
menuentry 'Slackware-14.1 Laptop GNU/Linux' --class slackware-14.1 --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-f52adeea-a45c-4dc5-b599-aecadc1709b5' {
	load_video
	insmod gzio
	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  f52adeea-a45c-4dc5-b599-aecadc1709b5
	else
	  search --no-floppy --fs-uuid --set=root f52adeea-a45c-4dc5-b599-aecadc1709b5
	fi
	echo	'Loading Linux 3.10.17 ...'
	linux	/boot/vmlinuz-huge-3.10.17 root=/dev/sda1 ro  
	echo	'Loading initial ramdisk ...'
	initrd	/boot/initrd-3.10.17.gz
you can set your /etc/fstab to this
Code:
/dev/sda1        /                ext4        defaults         1   1
and grub will still find it and for machines that can scan blkid they will load it also.
now use grub entry #1 for all other machines and grub intry #2 for that laptop
let me know if it works.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Blacklist or ignore block device systemd target in dracut initramfs ACiD GRiM Linux - Kernel 0 08-27-2013 12:45 AM
initramfs cannot find lvm root partition mgrant Linux - General 1 01-23-2009 07:12 PM
Kernel 2.6.26.3: VFS cannot open root device, can't find root device dimm0k Linux - Kernel 1 09-21-2008 03:19 PM
Block device /dev/sda3 is not a valid root device.. rincewind Linux - Hardware 7 06-09-2006 04:47 AM
UL 1.0 GRUB: could not find device for /boot: not found or not a block device cma Linux - General 4 12-12-2005 03:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Gentoo

All times are GMT -5. The time now is 06:16 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration