[SOLVED] How to install a universal grub2 to a usb having android x86 lineageos ?
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How to install a universal grub2 to a usb having android x86 lineageos ?
Help a newbie please...Sorry for my Botched English though...
I have installed a latest android_X86 #LineageOS to a USB Drive. I tried Android Live for a while and decided to INSTALL the OS on another PENDRIVE[Lineage-USB] because i want to use android portably.
While installing i did chose the option install GRUB2 to the drive but when i reboot the system at the end of installtion, my pc cant able to boot it. I did a small search and found a live system called SuperGrub2 which is basically a universal Grub capable of booting whatever operating system installed on any connected device.And i've installed the latter on an other usb[SUPERGRUB2-USB].
SUPERGRUB2-USB boots the Lineage-USB successfully on every devices i have and runs like a charm. Its quite ok for a while using two pendrives simultaneously to boot a single OS but later it seems just WIERD. So now all i need is a Similar Grub setup for my Lineage-USB so that i can boot it from any available pc/laptop/sbc etc.
FYI: # Attached Screeshot of SuperGrub2 Menu showing installed bootable Android Os.
# Lineage-USB is in EXT4 file system | GPT | created using Gparted on a linux host
# GRUB folder does present on that Lineage-USB after andoid_x86 installation. That folder has only one file called "grub.cfg".
The list of command inside that grub.cfg file are as follows:-
set timeout=10
While installing i did chose the option install GRUB2 to the drive but when i reboot the system at the end of installtion, my pc cant able to boot it.
What does 'can't boot' mean? You will need to be more specific as to exactly what happens when you try.
When you installed Grub to the pendrive, did you get an option to install to the MBR or the partition on which Android was?
If so, which did you select?
If it is GPT, did you create a BIOS boot partition as part of the install or are you doing an EFI boot?
You indicate there is no Grub folder but that you have a grub.cfg file, where (in what folder) is it?
What does 'can't boot' mean? You will need to be more specific as to exactly what happens when you try.
After installing i tried to boot from USB black screen with a Dash just blinks and bios goes to my host PC's bootloader.
Quote:
Originally Posted by yancek
When you installed Grub to the pendrive, did you get an option to install to the MBR or the partition on which Android was?
If so, which did you select?
No i didnt got any option to choose where to intall grub. But im sure that by default its been installed in my android partition itself
Quote:
Originally Posted by yancek
If it is GPT, did you create a BIOS boot partition as part of the install or are you doing an EFI boot? You indicate there is no Grub folder but that you have a grub.cfg file, where (in what folder) is it?
No i didnt create any seperate BIOS boot Partition. I tried EFI boot.EXT4 is the only partition i created. Grub folder is in android partition itself inside boot folder and thats where grub.cfg file is.
Quote:
Thank you for replying to my post.
What should i do ?
#Do i need to change partition table from GPT to MBR.
#If we need to stick with GPT do i need to create a separate partition for bios boot. If so what file system should i use to create bios boot partiition.
#Then... will the installer automaticaly identifies where to install grub
Last edited by irajeevankumar; 02-05-2018 at 09:07 AM.
No i didnt got any option to choose where to intall grub. But im sure that by default its been installed in my android partition itself
Then you would need to put an entry in the host systems boot menu. If you have an older Legacy system, you have boot code in the MBR which points to the boot menu and from there you make a selection of the OS. If you have an EFI system, you need an EFI entry. If you are using GOT partitioning, you need either a BIOS boot partition or an EFI partition with an EFI entry for your Android. If you want to use Android portable on different computers, you will need boot code in the MBR or a separate EFI partition. I don't have any familiarity with Android so have no idea how it would work.
If you want to use Android portable on different computers, you will need boot code in the MBR or a separate EFI partition. I don't have any familiarity with Android so have no idea how it would work.
I just created a separate VFat partition and flagged that as a Boot and then i reinstalled android again on Ext4 and installer's Grub EFI installs itself on that VFAT partition.
IT WORKS !!!
But i can use the USB only on a UEFI system. As you've mentioned earlier i need the same boot code in MBR to make the USB work in different computers .how to do that ? Any Ideas.
Last edited by irajeevankumar; 02-06-2018 at 06:16 AM.
I've never tried this but you might try installing Grub to the MBR of the pendrive pointing to the /boot/grub directory or wherever the grub.cfg file is. No idea if this will work.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.