LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices


Reply
  Search this Thread
Old 09-04-2015, 05:55 AM   #1
glukosio
LQ Newbie
 
Registered: Aug 2015
Posts: 14

Rep: Reputation: Disabled
Encountered a problem and dropping me to a shell when boot LFS 7.7


Hello everybody! After a couple of weeks of work I finally managed to (almost) boot my Linux from scratch distribution!
I built it on a USB drive. But when it's booting it arrives at:
Code:
The device /dev/sdb1, which is supposed to contain the root file system, does not exist.
Please fix this problem and exit this shell.

Encountered a problem!

Dropping you to a shell.
And then, after few lines it gives me the shell
Code:
sh-4.3#
in grub2 my config is:
Code:
set root=(hd1,1)
linux /boot/vmlinuz-3.19-lfs-7.7 root=/dev/sdb1 ro
initrd /boot/initrd.img-3.19.0
can anybody help me please?
 
Old 09-04-2015, 01:06 PM   #2
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,152

Rep: Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856
dev numbers for usb disks can change from boot to boot use uuids instead, both in grub and fstab
 
Old 09-04-2015, 01:11 PM   #3
glukosio
LQ Newbie
 
Registered: Aug 2015
Posts: 14

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Keith Hedger View Post
dev numbers for usb disks can change from boot to boot use uuids instead, both in grub and fstab
Thank you for the answer! I will try as soon as new kernel will complete building
 
Old 09-04-2015, 01:54 PM   #4
glukosio
LQ Newbie
 
Registered: Aug 2015
Posts: 14

Original Poster
Rep: Reputation: Disabled
Nothing to do, tried with UUID, with PARTUUID, but nothing changes!
 
Old 09-04-2015, 02:11 PM   #5
Head_on_a_Stick
Senior Member
 
Registered: Dec 2014
Location: London, England
Distribution: Debian stable (and OpenBSD-current)
Posts: 1,187

Rep: Reputation: 285Reputation: 285Reputation: 285
You should post the modified grub.cfg (& fstab).

I think the problem may be that the root device is defined as "(hd1,1)" in grub.cfg

You could add a udev rule to consistently set the block device for your USB stick as /dev/sdb
https://wiki.archlinux.org/index.php...B_flash_device
 
Old 09-04-2015, 03:40 PM   #6
glukosio
LQ Newbie
 
Registered: Aug 2015
Posts: 14

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Head_on_a_Stick View Post
You should post the modified grub.cfg (& fstab).

I think the problem may be that the root device is defined as "(hd1,1)" in grub.cfg

You could add a udev rule to consistently set the block device for your USB stick as /dev/sdb
https://wiki.archlinux.org/index.php...B_flash_device
Now I'll manage to do the udev rule.
The fact also is, that I didn't configurate grub on the usb partition, I'm using grub installed on the hard disk, so the usb is naturally (hd1,1). The problem is that I don't know from where should I take info about USB, from host system or from chrooted LFS environment?
 
Old 09-04-2015, 04:45 PM   #7
glukosio
LQ Newbie
 
Registered: Aug 2015
Posts: 14

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Keith Hedger View Post
dev numbers for usb disks can change from boot to boot use uuids instead, both in grub and fstab
Here is my fstab from chrooted LFS:
Code:
root:/# cat /etc/fstab 
# Begin /etc/fstab

# file system mount-point type options dump fsck order
#

UUID=f7f897da-3c78-491c-a0ab-5554a0194158 / ext4 defaults 11
UUID=f1e28b2e-ed7c-43bc-ba73-b677079af5eb swap swap pri=1 0 0
proc /proc proc defaults 0 0
sysfs /sys sysfs defaults 0 0
devpts /dev/pts devpts gid=4,mode=620 0 0
shm /dev/shm tmpfs defaults 0 0

# End /etc/fstab
and here the grub.cfg (just the main debian boot and actual lfs setting):
Code:
menuentry 'Debian GNU/Linux' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-f2533710-1896-491b-a467-e042978a4d09' {
	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 --hint='hd0,msdos1'  f2533710-1896-491b-a467-e042978a4d09
	else
	  search --no-floppy --fs-uuid --set=root f2533710-1896-491b-a467-e042978a4d09
	fi
	echo	'Caricamento Linux 3.11-2-amd64...'
	linux	/boot/vmlinuz-3.11-2-amd64 root=/dev/sda1 ro  quiet
	initrd  /boot/initrd.img-3.11-2-amd64

}
menuentry "GNU/Linux, Linux 3.19-lfs-7.7"{
	set root=(hd1,1)
	linux /boot/vmlinuz-3.19-lfs-7.7.1 root=UUID=f7f897da-3c78-491c-a0ab-5554a0194158 ro
	initrd /boot/initrd.img-3.19.0.1
}

Last edited by glukosio; 09-04-2015 at 05:00 PM.
 
Old 09-04-2015, 04:58 PM   #8
Head_on_a_Stick
Senior Member
 
Registered: Dec 2014
Location: London, England
Distribution: Debian stable (and OpenBSD-current)
Posts: 1,187

Rep: Reputation: 285Reputation: 285Reputation: 285
I don't think GRUB accepts "set root=UUID=$UUID"
 
Old 09-04-2015, 05:00 PM   #9
glukosio
LQ Newbie
 
Registered: Aug 2015
Posts: 14

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Head_on_a_Stick View Post
I don't think GRUB accepts "set root=UUID=$UUID"
Yes, you're right, I've changed it after it gave me an error, but I didn't save.
Consider it (hd1,1), now I'll edit it
 
Old 09-04-2015, 08:02 PM   #10
moonfrog
Member
 
Registered: Oct 2008
Location: San Diego County, CA
Distribution: LFS, Gentoo
Posts: 64

Rep: Reputation: 23
deleted by moonfrog

Last edited by moonfrog; 09-05-2015 at 05:14 PM.
 
Old 09-05-2015, 08:55 AM   #11
Head_on_a_Stick
Senior Member
 
Registered: Dec 2014
Location: London, England
Distribution: Debian stable (and OpenBSD-current)
Posts: 1,187

Rep: Reputation: 285Reputation: 285Reputation: 285
Quote:
Originally Posted by moonfrog View Post
There's an error in your grub entry

(hd1,1) points to sdb2

If rootfs is on sdb1 change it to (hd1,0)
This is incorrect.

In GRUB2, the drives are counted from zero but the partitions are counted from one.

http://www.gnu.org/software/grub/man...ing-convention
 
Old 09-05-2015, 12:02 PM   #12
glukosio
LQ Newbie
 
Registered: Aug 2015
Posts: 14

Original Poster
Rep: Reputation: Disabled
Yes, it should be (hd1,1), it's the only one avaylable. (hd1) is not considered a bootable partition
 
Old 09-05-2015, 05:21 PM   #13
moonfrog
Member
 
Registered: Oct 2008
Location: San Diego County, CA
Distribution: LFS, Gentoo
Posts: 64

Rep: Reputation: 23
Wow..now I'm giving false info

My apologies

I'll take my grey beard home
 
Old 09-15-2015, 09:53 PM   #14
stoat
Member
 
Registered: May 2007
Distribution: LFS
Posts: 628

Rep: Reputation: 185Reputation: 185
For booting a system on a USB drive, try the rootdelay kernel parameter to allow for the slower response time of the drive. Typically, people say rootdelay=10. I usually get by with rootdelay=5. Another thing to try is to build into the kernel the USB storage stuff such as Host-side USB, USB Mass Storage, EHCI HCD, possibly OHCI HCD or UHCI HCD.
 
Old 09-16-2015, 04:18 AM   #15
glukosio
LQ Newbie
 
Registered: Aug 2015
Posts: 14

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by stoat View Post
For booting a system on a USB drive, try the rootdelay kernel parameter to allow for the slower response time of the drive. Typically, people say rootdelay=10. I usually get by with rootdelay=5. Another thing to try is to build into the kernel the USB storage stuff such as Host-side USB, USB Mass Storage, EHCI HCD, possibly OHCI HCD or UHCI HCD.
Thank you so much, I'm trying to recompile the kernel now with the right USB stuff you said, EHCI and OHCI were set to module..
just rootdelay=10 didn't work, I'll let you know as soon as kernel will compile

ps. @moonfrog don't worry it may happen


EDIT: nothing to do

Last edited by glukosio; 09-16-2015 at 04:59 AM.
 
  


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
[SOLVED] BackTrack 5 R3 boot issue: "/dev/mapper/vg-root does not exist! Dropping to shell!" EStyles Linux - Laptop and Netbook 2 12-07-2012 08:24 PM
Problem booting Jolicloud - Alert! /dev/hda2 does not exist! Dropping to a shell! kitenski Linux - Laptop and Netbook 2 12-24-2010 12:41 AM
adding new hdd results dropping in to shell at boot penduleum Linux - Hardware 5 03-21-2009 03:54 PM
Error encountered in LFS v6.0 Ch. 4 .bash_profile mbreslin1954 Linux From Scratch 2 04-19-2005 09:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 10:36 PM.

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