LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Laptop and Netbook
User Name
Password
Linux - Laptop and Netbook Having a problem installing or configuring Linux on your laptop? Need help running Linux on your netbook? This forum is for you. This forum is for any topics relating to Linux and either traditional laptops or netbooks (such as the Asus EEE PC, Everex CloudBook or MSI Wind).

Notices


Reply
  Search this Thread
Old 04-08-2014, 06:38 PM   #1
seangllghr
LQ Newbie
 
Registered: Apr 2012
Location: Upstate New York
Distribution: As of April 2012, OpenSUSE with KDE4
Posts: 5

Rep: Reputation: Disabled
Partition table and partitioning requirements for GRUB2 UEFI installation to USB?


Hey everyone,

I've been battling with an uncooperative Win8.1/Ubuntu dual-boot setup for most of the last three days. I recently purchased a current-generation Sony Vaio laptop (Flip... 15N? Model# SVf15N26CXB, appears to be Best Buy exclusive) and decided to try setting up a dual-boot system. With SecureBoot and FastBoot disabled, I installed Ubuntu Gnome 13.10 in its own set of partitions, and it worked great. Until I picked Windows from the GRUB menu, that is. At that point, every subsequent reboot launched immediately into Windows 8 - no Go, no $200.

Heeding some advice I got from another thread (or the Ubuntu forums... or somewhere...), I assumed that Windows, in its infinite wisdom, had decided to overwrite my bootloader. So I fired up my live-USB again, installed boot-repair, and ran it. Voila! Now I got the boot menu again. And could boot Linux! Then Windows. And no more boot menu. After some swearing, I tried reinstalling grub manually from the command line, which worked great until I booted into Windows again. At which point it (somewhat predictably) FUBARed my GRUB menu.

After two more days hacking at this problem to no avail, I've decided to throw in the towel. I'd like to install GRUB to a USB stick, with just the Linux entry, then change my system boot preference to default to external media if a boot disk is installed. I did this with a floppy once, years ago, when I wanted to install linux on my father's NT workstation (which I did with somewhat dubious authorization) without replacing the bootloader (which I definitely was NOT authorized to do). I'm pretty sure the following command should install GRUB2 to the USB (I forget where my $ESP is off the cuff, but I might have mounted it at /boot in the installation, so I'll use that here):

Code:
#grub-install --target=x86_64-efi --boot-directory=/dev/sdb1 --bootloader-id=grub --efi-directory=/boot --recheck --debug
Additionally, I'm planning on creating a 512Mb FAT32 partition at the beginning of the (now GPT) USB drive in question, as one might do on the hard drive for a shiny, new efi system partition for installation.

So I'm mostly just checking my work, because after three days of headaches, I'm tired and I really don't want to have to hack at this anymore - learning by trial and error be darned (to Heck). Will the above command and partitioning scheme do what I think it will? Am I including any unnecessary steps or omitting any critical ones? Is there a hidden tick box in Windows that says "Stop Skynet from fouling up my computer" that makes this all unnecessary?

I do apologize if this is long, but I wanted to be sure I included all of the necessary information. Thanks for taking the time to read!

~ Sean

Last edited by seangllghr; 04-09-2014 at 11:31 PM. Reason: Solved - fixing the problem from Windows obviates the need for a workaround.
 
Old 04-09-2014, 01:06 AM   #2
ceyx
Member
 
Registered: May 2009
Location: Fort Langley BC
Distribution: Kubuntu,Free BSD,OSX,Windows
Posts: 342

Rep: Reputation: 59
a very easy method is to install Windoze first, let it think it owns the computer, and THEN install Ubuntu. Gparted ( used during the install process automatically ) will suggest a few things, one of them being dual boot. It will take care of it for you.

I used to do this all the time, (but not with an UEFI drive) - but then got tired of the hassle and simply ran Windoze in VirtualBox.

PS - I have learned tons from things that didn't work, and almost nothing from things that did. If you are patient and figure it out, it will be well worth it. It has taken me sometimes YEARS to get something right, but along the way what I learned is priceless. Perserverence pays.

Last edited by ceyx; 04-09-2014 at 01:07 AM. Reason: clarity
 
Old 04-09-2014, 02:10 AM   #3
seangllghr
LQ Newbie
 
Registered: Apr 2012
Location: Upstate New York
Distribution: As of April 2012, OpenSUSE with KDE4
Posts: 5

Original Poster
Rep: Reputation: Disabled
In about 90% of cases, I'd agree with you - hence my low post count here. I've been using Linux actively for the better part of the last 9 years. If I came crawling to the forums begging for answers every time I ran into a problem, I'd have spent a lot of time waiting for others to answer my questions without learning anything significant from it (especially in the mid- to late-2000's, when I seemed to run into wireless or graphics problems approximately whenever I waggled my fingers the wrong way). I've been struggling to find pertinent information on UEFI, though, and figured that I might as well just ask. If I had years to tinker, I'd be happy to tinker, but I need the system up-and-running as soon as I can manage.

Regarding the actual issue - Windows came pre-installed on the machine, as it has on every new laptop I've purchased recently (since the M$ tax seems to roughly line up with their hardware subsidies, the cost of a Linux-preinstalled machine has never seemed justified). Unfortunately, at least in UEFI mode, Ubiquity no longer offers an automagic dual-boot configuration (haven't tried in BIOS-MBR, not currently having hardware that actually runs off BIOS-MBR anymore). Since I maintain a separate /home for data persistence, however, that configuration never really worked for me anyway. Furthermore, Windows appears to overwrite the bootloader on EVERY BOOT. Because it's a d**k.

For the record, I realized afterwards that the command listed above still installs GRUB on /dev/sda. I've now tried including the --removable option and specifying /dev/sdb when running the installer, to no appreciable avail. I'm going to keep tinkering, but I've found a bootable USB image of rEFInd that's a serviceable backdoor in case I can't find a proper answer soon. I'll post here if I find anything.

Last edited by seangllghr; 04-09-2014 at 02:13 AM. Reason: Clarification of the particular Windows quirk that's giving me trouble.
 
Old 04-09-2014, 02:21 AM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,128

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
You'll probably find Win8 is simply making itself the default boot target - if you get to the boot menu, you should still see the ubuntu (maybe "Linux" but not likely) entry you can select. Once booted, install efibootmgr (from Intel) so you can adjust the EFI boot entries. You might have to do this each time after booting Win8, I don't know as I refuse to use it, but it'll save re-installing grub all the time.

Last edited by syg00; 04-09-2014 at 02:23 AM. Reason: typos
 
Old 04-09-2014, 02:37 PM   #5
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,982

Rep: Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626
I doubt windows would correct an issue unless you told it to.

The boot on the usb ought to have grub (for uefi if you don't want to change bios) and have nothing to do with the internal drive.

Boot select via boot sequence in bios or F key at boot.
 
Old 04-09-2014, 11:29 PM   #6
seangllghr
LQ Newbie
 
Registered: Apr 2012
Location: Upstate New York
Distribution: As of April 2012, OpenSUSE with KDE4
Posts: 5

Original Poster
Rep: Reputation: Disabled
syg00: Pah! Technicalities! You're right, of course. That's exactly what Windows was doing. That only makes it slightly less annoying.

jefro, turns out Windows is happy to make changes without explicit instructions. I went into Windows and changed the default boot target from the command prompt with bcdedit, which apparently convinced it that I really did want to boot to GRUB every time.

For anyone who might stumble on this thread in the future, the "Stop Skynet from fouling up my computer" tick box that I mentioned above is the following command:

Code:
bcdedit /set {bootmgr} path \EFI\ubuntu\grubx64.efi
Note that this command should be entered from the Windows Command Prompt (which must be run as an administrator), not the newfangled "Windows Power Shell". Don't ask me why. I know even less about Windows than I do about Linux.
 
1 members found this post helpful.
  


Reply

Tags
grub2, uefi booting, usb boot



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
Grub2 Installation on GPT partition Emrod Slackware 5 06-24-2013 08:59 PM
Slackware and Grub2 - getting a UEFI mb running linuxbird Slackware 16 12-13-2012 08:40 AM
altered partition table, Grub2 will not load, how-to chroot? kyrand0047 Linux - General 11 02-25-2011 04:57 PM
USB flash disk partition disappeared as well as partition table openmind Linux - Newbie 3 02-17-2011 05:20 PM
RH Linux 9.0 installation step "Auto partitioning" not able to read partition table awahab Linux - Newbie 5 05-19-2005 07:53 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Laptop and Netbook

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