LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 08-05-2017, 09:22 PM   #1
joboy
Member
 
Registered: Jul 2009
Distribution: Debian, Ubuntu, Puppy, Mint
Posts: 434

Rep: Reputation: 5
How to install for USB booting


Hi there,

I installed Debian 8 on an internal hard drive as usual, and I put the drive in an USB enclosure to transfer data to another PC, I forgot to change the boot sequence which was set to USB boot, and I successfully boot up the OS, it was not my intention but finding, so I decided to install a dedicated USB drive for portable boot and it has become my daily work drive I carry around, this way is far better than install USB flash boot, I can have much more space, at the same time I can use the hard drive for internal boot.

Recently I reinstalled the new Debian 9 the same way, but it won't boot on USB with this error :

"error : file '/boot/grub/i386-pc/normal.mod' not found
Entering rescue mode...
grub rescue>"

I also tried install to USB drive directly but same result, I am sure I installed the grub loader on the correct drive, I wonder if something has changed on the new version to prevent USB booting, I could use the USB flash boot install method but I still want to be able to boot 'both ways', any comment ?

Last edited by joboy; 08-05-2017 at 09:26 PM.
 
Old 08-06-2017, 09:15 AM   #2
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,513

Rep: Reputation: 1003Reputation: 1003Reputation: 1003Reputation: 1003Reputation: 1003Reputation: 1003Reputation: 1003Reputation: 1003
It looks like it could be an architecture conflict. Is one of the machines 32-bit?
 
Old 08-06-2017, 01:55 PM   #3
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian 9 Stretch
Posts: 2,349
Blog Entries: 8

Rep: Reputation: 384Reputation: 384Reputation: 384Reputation: 384
Another possibility is that the Debian installer was used on an EFI boot system, and as such it installed the EFI boot files only (no i386-pc files - thus missing).

I'm not sure how the 32-bit vs 64-bit issue might play out, but...maybe? I mean, when I accidentally try to boot with initrd/vmlinuz mismatched with the main OS, it'll try to boot but a lot of hardware simply won't work - USB devices included. So, I could see some situation where maybe the bootloader wants to use 64-bit mode but...okay, I'm just out of my depth here. I don't know whether this sort of failure mode even makes sense.

Anyway, I'd first look to see if /boot/grub/i386-pc even exists. If not, then copying the files over from /usr/lib/grub/i386-pc may work (if it even exists there)...
 
Old 08-06-2017, 04:01 PM   #4
colorpurple21859
Senior Member
 
Registered: Jan 2008
Location: florida panhandle
Distribution: slackware64-current, puppy, ubuntu
Posts: 2,862

Rep: Reputation: 443Reputation: 443Reputation: 443Reputation: 443Reputation: 443
What is on the prefix= line when
Code:
set
is ran at the grub rescue prompt? Maybe prefix= is pointing to the wrong location.
 
Old 08-07-2017, 11:41 AM   #5
joboy
Member
 
Registered: Jul 2009
Distribution: Debian, Ubuntu, Puppy, Mint
Posts: 434

Original Poster
Rep: Reputation: 5
I put the non booting USB drive on my ThinkPad and it boots normally, although I installed it on a Dell desktop everything worked on the ThinkPad too ! I need to dig deep into the BIOS to see what could have caused the problem on the Dell. My previous install was done on the ThinkPad, and it booted no problem on the Dell, the only difference was the OS version slightly older I can not recall exactly the detail.
 
Old 08-07-2017, 12:29 PM   #6
colorpurple21859
Senior Member
 
Registered: Jan 2008
Location: florida panhandle
Distribution: slackware64-current, puppy, ubuntu
Posts: 2,862

Rep: Reputation: 443Reputation: 443Reputation: 443Reputation: 443Reputation: 443
maybe the disk/boot order of the internal drive and usb changes for some reason
 
Old 08-08-2017, 02:03 AM   #7
joboy
Member
 
Registered: Jul 2009
Distribution: Debian, Ubuntu, Puppy, Mint
Posts: 434

Original Poster
Rep: Reputation: 5
I reinstall the OS on the ThinkPad via USB, when I boot it on the Dell I got different error :

error : invalid arch-independent ELF magic.
Entering rescue mode...
grub rescue>
grub rescue> set
cmdpath=(hd0)
prefix=(hd0,msdos1)/boot/grub
root=hd0,msdos1

I then check the BIOS on the Dell but couldn't find anything that could have caused this problem, it is a Pentium Dual Core E5400, where the ThinkPad is with an i5.
 
Old 08-08-2017, 03:53 AM   #8
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian 9 Stretch
Posts: 2,349
Blog Entries: 8

Rep: Reputation: 384Reputation: 384Reputation: 384Reputation: 384
This error indicates it is related to EFI boot or something like that. The relevant BIOS settings would be to enable MBR booting and/or disable secure boot EFI (at least on USB).

Alternatively, your problem might be fixed by booting up on the ThinkPad and installing grub-efi:
Code:
apt-get install grub-efi
I enable traditional boot on my computers; I think even newer computers generally allow traditional boot at least on USB devices (as a possible setting in the BIOS).

Last edited by IsaacKuo; 08-08-2017 at 08:52 AM.
 
Old 08-08-2017, 06:10 AM   #9
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,513

Rep: Reputation: 1003Reputation: 1003Reputation: 1003Reputation: 1003Reputation: 1003Reputation: 1003Reputation: 1003Reputation: 1003
The problem can be caused by installing Debian on a machine set for UEFI boot, and then booting with the machine set to BIOS boot. So, the problem is probably solved by setting all machines concerned to BIOS boot.

This demonstrates that a portable drive is probably not reliable to boot on all machines without some adjustment.
 
Old 08-09-2017, 03:44 AM   #10
joboy
Member
 
Registered: Jul 2009
Distribution: Debian, Ubuntu, Puppy, Mint
Posts: 434

Original Poster
Rep: Reputation: 5
I installed the portable drive on a ThinkPad T440p with win10 dual boot and secure boot disabled, I do not use grub to dual boot coz it doesn't work, I simple select boot drive via BIOS that worked perfectly. I occasionally boot windows and don't know if it will alter the secure boot, but as far as I can see on the BIOS secure boot stays disabled. I also installed grub-efi as suggested but that didn't change thing, or I need to alter some settings as well please advise. I know portable boot is not reliable I use it only for convenience, I also have a portable flash drive that boots on almost any computer w/o problem, but I did not install it as a hard drive but install with YUMI multi boot.
 
Old 08-10-2017, 04:04 AM   #11
joboy
Member
 
Registered: Jul 2009
Distribution: Debian, Ubuntu, Puppy, Mint
Posts: 434

Original Poster
Rep: Reputation: 5
So can I modify the grub.cfg or something to make it boot properly ?
 
Old 08-10-2017, 08:49 AM   #12
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian 9 Stretch
Posts: 2,349
Blog Entries: 8

Rep: Reputation: 384Reputation: 384Reputation: 384Reputation: 384
Honestly, I have only one computer that can even do secure boot, so I have little experience getting it to work. I simply did what AwesomeMachine suggested ages ago - I disabled secure boot on that one computer, and I just use BIOS boot on all computers.

Looking up EFI and UEFI boot on Debian, it looks really complicated to me and I don't really understand it. I think it would be best to go with AwesomeMachine's suggestion of disabling secure boot on all computers.
 
Old 08-10-2017, 09:32 AM   #13
colorpurple21859
Senior Member
 
Registered: Jan 2008
Location: florida panhandle
Distribution: slackware64-current, puppy, ubuntu
Posts: 2,862

Rep: Reputation: 443Reputation: 443Reputation: 443Reputation: 443Reputation: 443
Quote:
So can I modify the grub.cfg or something to make it boot properly ?
It depends on if /boot/grub has either i386-pc or x86_64-efi directory and if your booting in efi mode or bios mode. If your booting in bios mode and have the /boot/grub/i386-pc/* directory, you should be able to boot from the grub command prompt . There is a chance that if the correct modules needed to access the partition filesystem that /boot/grub/ resides on are not built into the grub mbr bootloader will cause problems, but that doesn't happen very often. Some distros separate grub into grub-i386-pc and grub-x86_efi packages and will only allow to have one are the other installed on the system at a time.

Last edited by colorpurple21859; 08-10-2017 at 09:34 AM.
 
Old 08-11-2017, 01:22 AM   #14
joboy
Member
 
Registered: Jul 2009
Distribution: Debian, Ubuntu, Puppy, Mint
Posts: 434

Original Poster
Rep: Reputation: 5
I checked the non booting Dell and couldn't find anything related to Secure Boot, and my ThinkPad that used to install the portable drive already disabled Secure Boot. If I install the drive on the Dell w/o secure boot it should boot normally but that's not the case.

Quote:
Originally Posted by colorpurple21859 View Post
It depends on if /boot/grub has either i386-pc or x86_64-efi directory and if your booting in efi mode or bios mode. If your booting in bios mode and have the /boot/grub/i386-pc/* directory, you should be able to boot from the grub command prompt . There is a chance that if the correct modules needed to access the partition filesystem that /boot/grub/ resides on are not built into the grub mbr bootloader will cause problems, but that doesn't happen very often. Some distros separate grub into grub-i386-pc and grub-x86_efi packages and will only allow to have one are the other installed on the system at a time.
 
Old 08-11-2017, 01:24 AM   #15
joboy
Member
 
Registered: Jul 2009
Distribution: Debian, Ubuntu, Puppy, Mint
Posts: 434

Original Poster
Rep: Reputation: 5
I checked the non booting Dell and couldn't find anything related to Secure Boot, my ThinkPad that used to install the portable drive already disabled Secure Boot. If I install the drive on the Dell w/o secure boot it should boot normally on itself but that's not the case, I am referring to USB boot, SATA boot always work.

I checked the drive and find two folders, efi and grub amongst other files, there is nothing on the efi not even hidden files, and a grub.cfg on the grub folder, I wonder if "set root" has anything to do with the booting :

====================================================================================
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
set have_grubenv=true
load_env
fi
if [ "${next_entry}" ] ; then
set default="${next_entry}"
set next_entry=
save_env next_entry
set boot_once=true
else
set default="0"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
menuentry_id_option="--id"
else
menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
set saved_entry="${prev_saved_entry}"
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi

function savedefault {
if [ -z "${boot_once}" ]; then
saved_entry="${chosen}"
save_env saved_entry
fi
}
function load_video {
if [ x$feature_all_video_module = xy ]; then
insmod all_video
else
insmod efi_gop
insmod efi_uga
insmod ieee1275_fb
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
fi
}

if [ x$feature_default_font_path = xy ] ; then
font=unicode
else
insmod part_msdos
insmod ext2
set root='hd4,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd4,msdos1 --hint-efi=hd4,msdos1 --hint-baremetal=ahci4,msdos1 03122b4f-b8a6-4bb4-9560-eec9f6a5d68a
else
search --no-floppy --fs-uuid --set=root 03122b4f-b8a6-4bb4-9560-eec9f6a5d68a
===============================================================================================

Quote:
Originally Posted by colorpurple21859 View Post
It depends on if /boot/grub has either i386-pc or x86_64-efi directory and if your booting in efi mode or bios mode. If your booting in bios mode and have the /boot/grub/i386-pc/* directory, you should be able to boot from the grub command prompt . There is a chance that if the correct modules needed to access the partition filesystem that /boot/grub/ resides on are not built into the grub mbr bootloader will cause problems, but that doesn't happen very often. Some distros separate grub into grub-i386-pc and grub-x86_efi packages and will only allow to have one are the other installed on the system at a time.

Last edited by joboy; 08-11-2017 at 01:47 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Several questions regarding booting (to install) from USB Twan013 Linux - Newbie 2 03-04-2010 10:17 PM
Booting From USB For Install? carlosinfl Red Hat 3 09-13-2007 07:44 AM
Booting from CD, install from USB? klickiedieklack Linux - Newbie 4 09-07-2007 07:25 AM
HDD Install booting from USB rarsa Mandriva 10 08-24-2006 01:14 AM

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

All times are GMT -5. The time now is 08:18 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration