LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-17-2017, 11:36 AM   #1
Wayne Sallee
Member
 
Registered: Jun 2011
Location: Florida
Distribution: The one that I built. (lfs)
Posts: 269

Rep: Reputation: 17
Grub2 Boot Multiple/Second/USB/External/Change Drive


I build a LFS system that I use, that works well. It boots up nicely in any 64 bit computer.

If I put it in a USB enclosure it will boot up as long as there is no other hard drive in the computer.

But If there is a second hard drive it will not boot up. It kernel panics.

I've been fighting this for some time, and can't get it to boot up when there's another hard drive in the kernel. It books up looking like it's going to work, but then it kernel panics.

This problem only happens when using a USB connection.

Wayne Sallee
Wayne@WayneSallee.com
http://www.WayneSallee.com
 
Old 02-17-2017, 03:08 PM   #2
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,993

Rep: Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628
Boot order in bios is my guess. Grub may be set to use drives in some order as opposed to uuid or other naming.

https://wiki.archlinux.org/index.php..._device_naming for example maybe.
 
Old 02-18-2017, 08:37 AM   #3
Wayne Sallee
Member
 
Registered: Jun 2011
Location: Florida
Distribution: The one that I built. (lfs)
Posts: 269

Original Poster
Rep: Reputation: 17
Quote:
Originally Posted by jefro View Post
Boot order in bios is my guess. Grub may be set to use drives in some order as opposed to uuid or other naming.

https://wiki.archlinux.org/index.php..._device_naming for example maybe.
Yes, I've been trying to use UUID for this, but no sucess.

Wayne Sallee
Wayne@WayneSallee.com
http://www.WayneSallee.com
 
Old 02-20-2017, 05:50 AM   #4
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,826
Blog Entries: 1

Rep: Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068
If the "other" HD has an empty boot sector rather than boot code and partition table, does it make any difference?

I don't think any Grub version was ever designed to control other than from a specific drive position. When you make it work as a #1 drive, I doubt it can be expected to function correctly as some other.

Note that most (all?) distros intended for boot from removable media use Syslinux, not Grub.

If you have a bootloader on the system HD, and install bootloader on each USB distro's / filesystem, then you can chainload to an installation on USB from the HD, or load the installation's kernel and initrd directly either by preconfiguring to do so, or using the Grub shell instead of any Grub menuitem.

UUIDs were intended for scripts, not humans. Give your filesystems recognizable memorable labels, and refer to those instead of UUIDs in your bootloaders and fstabs if you want life to be easier.

Multiboot is complicated. It helps to simplify wherever possible. Avoiding dependence on scripts to anticipate every possibility helps. On MBR machines, Grub works for me because its Grub shell is easy to use. It does not depend on scripts to configure or anticipate.
 
Old 02-20-2017, 03:20 PM   #5
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,993

Rep: Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628
From that link I posted.

What I think is going on ..

"Non-persistent device naming using the /dev path format, in this example /dev/sdr1 is the root partition.

root=/dev/sdr1
"


What needs to be going on...
"
Persistent device naming using label and the /dev path format, in this example root_myhost is the label of the root partition.

root=/dev/disk/by-label/root_myhost

Persistent device naming using label and the LABEL= format.

root=LABEL=root_myhost

Persistent device naming using UUID and the UUID= format, in this example 1234-5678 is the UUID of the root partition

root=UUID=1234-5678

Persistent device naming using the PARTUUID and the PARTUUID= format.

root=PARTUUID=1234-5678
"


Or set bios so that the usb is now the first order in "hard drive" order in bios. NOT usb order.

Last edited by jefro; 02-20-2017 at 03:21 PM.
 
Old 02-21-2017, 10:40 AM   #6
Wayne Sallee
Member
 
Registered: Jun 2011
Location: Florida
Distribution: The one that I built. (lfs)
Posts: 269

Original Poster
Rep: Reputation: 17
Here is my what my config file looks like. I have been trying a variety of methods with no success.

Code:
# Begin /boot/grub/grub.cfg
set default=1
set timeout=10
# set rootdelay=10

insmod ext2
set root=(hd0,2)

menuentry "Property of WayneSallee.com" {
        linux   /boot/vmlinuz-3.19-lfs-7.7 root=/dev/sda2 ro resume=/dev/sda3 rootdelay=10
}
menuentry "GNU/Linux, Linux 3.19-lfs-7.7" {
        linux   /boot/vmlinuz-3.19-lfs-7.7 root=/dev/sda2 ro resume=/dev/sda3 rootdelay=10
}
menuentry "GNU/Linux, Linux 3.14.50-lfs-7.7" {
        linux   /boot/vmlinuz-3.14.50-lfs-7.7 root=/dev/sda2 ro resume=/dev/sda3 rootdelay=10
}
menuentry "Test Setup 3.19" {
        linux   /boot/vmlinuz-3.19-lfs-7.7 root=UUID=50d2e935-4f21-4b1f-9363-d14c8226aa7f ro resume=dbd84ad6-9774-42d7-914c-ee8f028a3dc7 rootdelay=10
        initrd /boot/initrd.img-3.19.0
}
menuentry "Test2 Setup 3.14.50" {
        linux   /boot/vmlinuz-3.14.50-lfs-7.7 root=UUID=50d2e935-4f21-4b1f-9363-d14c8226aa7f ro resume=dbd84ad6-9774-42d7-914c-ee8f028a3dc7 rootdelay=10
        initrd /boot/initrd.img-3.14.50
}
menuentry "GNU/Linux, Linux 4.4.45-lfs-7.7" {
        linux   /boot/vmlinuz-4.4.45-lfs-7.7 root=/dev/sda2 ro resume=/dev/sda3 rootdelay=10
}
menuentry "Test3 Setup 4.4.45" {
        linux   /boot/vmlinuz-4.4.45-lfs-7.7 root=UUID=50d2e935-4f21-4b1f-9363-d14c8226aa7f ro resume=dbd84ad6-9774-42d7-914c-ee8f028a3dc7 rootdelay=10
        initrd /boot/initrd.img-4.4.45
}
menuentry "Test by lable Linux 4.4.45" {
        linux   /boot/vmlinuz-4.4.45-lfs-7.7 root=LABEL=LFS_Drive rootdelay=10
}

Wayne Sallee
Wayne@WayneSallee.com
http://www.WayneSallee.com


(edit) I figured it out. In the above I had "initrd" misspelled. I corrected the spelling on the computer, and corrected the spelling above.

Last edited by Wayne Sallee; 02-21-2017 at 11:53 AM.
 
Old 02-21-2017, 03:08 PM   #7
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,993

Rep: Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628
Thanks for the update and solution.

It's a stupid word anyway.
 
Old 02-21-2017, 06:31 PM   #8
Wayne Sallee
Member
 
Registered: Jun 2011
Location: Florida
Distribution: The one that I built. (lfs)
Posts: 269

Original Poster
Rep: Reputation: 17
Well, I had to revert a bit, as, while using the UUID method, I could no longer resume from hibernate.

So now my /boot/grub/grub.cfg is:

Code:
# Begin /boot/grub/grub.cfg
set default=1
set timeout=10
# set rootdelay=10

insmod ext2
set root=(hd0,2)

menuentry "Property of WayneSallee.com" {
        linux   /boot/vmlinuz-3.19-lfs-7.7 root=/dev/sda2 ro resume=/dev/sda3 rootdelay=10
        initrd /boot/initrd.img-3.19.0
}
menuentry "GNU/Linux, Linux 3.19-lfs-7.7 sda setting" {
        linux   /boot/vmlinuz-3.19-lfs-7.7 root=/dev/sda2 ro resume=/dev/sda3 rootdelay=10
        initrd /boot/initrd.img-3.19.0
}
menuentry "GNU/Linux, Linux 3.19-lfs-7.7" {
        linux   /boot/vmlinuz-3.19-lfs-7.7 root=UUID=50d2e935-4f21-4b1f-9363-d14c8226aa7f ro resume=UUID=dbd84ad6-9774-42d7-914c-ee8f028a3dc7 rootdelay=10
        initrd /boot/initrd.img-3.19.0
}
menuentry "GNU/Linux, Linux 3.14.50-lfs-7.7" {
        linux   /boot/vmlinuz-3.14.50-lfs-7.7 root=UUID=50d2e935-4f21-4b1f-9363-d14c8226aa7f ro resume=UUID=dbd84ad6-9774-42d7-914c-ee8f028a3dc7 rootdelay=10
        initrd /boot/initrd.img-3.14.50
}
menuentry "GNU/Linux, Linux 4.1.33-lfs-7.7" {
        linux   /boot/vmlinuz-4.1.33-lfs-7.7 root=UUID=50d2e935-4f21-4b1f-9363-d14c8226aa7f ro resume=UUID=dbd84ad6-9774-42d7-914c-ee8f028a3dc7 rootdelay=10
        initrd /boot/initrd.img-4.1.33
}
The UUID method boots fine, but I can't return from hibernate when I use the UUID method.

I'm actually doing this with this system, and a cloned system that is slightly different. For example one system has a 4.133 kernel, and the the other has a 4.45 kernel. So I'm really not crazy when I post slightly different setups. :-)

Wayne Sallee
Wayne@WayneSallee.com
http://www.WayneSallee.com

Last edited by Wayne Sallee; 02-21-2017 at 06:37 PM.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Peppermint CD boots off external USB CD drive, but is ignored if put in internal CD drive and selected as the boot device Ulysses_ Linux - Hardware 4 05-09-2016 05:22 PM
duel-boot using a usb external hard drive without usb boot option Cabtech Linux - Newbie 4 04-22-2012 05:15 PM
Can i mount USB external drive as R/W for multiple users andycorpes Linux - General 4 01-17-2010 02:33 PM
Boot from USB external drive, from laptop without USB boot support. darirod Linux - Newbie 2 12-19-2006 10:00 AM
Mounting USB external drive with multiple partitions, USB bluetooth mouse xmeson Slackware 7 12-17-2006 09:00 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:35 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