You are not logged in.

#1 2016-01-11 00:09:54

Zatura
Member
Registered: 2016-01-10
Posts: 3

Portable Arch Linux Legacy/UEFI Hybrid exists?

I'm in a quest for installing arch in a pendrive, I finally made a successful UEFI install with GRUB, but unfortunatelly it doesn't boot in Legacy-only computers.

Here are my devices:
Computer 1: UEFI-only boot support
Computer 2: Legacy-only boot support
Computer 3: UEFI/Legacy boot support (changeble in motherboard settings)

Does GRUB can handle a Universal Pen-Drive that could boot anywhere independently of the boot or partition(MBR/GPT) system of the Device that's booting the Pen Drive?

Is there a way I could install two boot systems? one for Legacy and on for UEFI and use the same persitent storage?

How do I proceed?

******Other information*************************************************************************************************************************************************************************************
Commands I used to install arch linux in my pen drive:
1.partitions

cgdisk /dev/sdb

for boot: EF00
for root: default

2.

mkfs.fat -F32 /dev/sdb1
mkfs.ext4 /dev/sdb2
mount /dev/sdb2 /mnt
mkdir /mnt/boot
mkdir /mnt/boot/efi
mount /dev/sdb1 /mnt/boot/efi

3.install the base system

pacstrap /mnt base vim

4.Generate the file system tab

genfstab -U -p /mnt >> /mnt/etc/fstab

4.1. Verify the configuration:

cat /mnt/etc/fstab

n. EFIVARS:

mount -t efivarfs efivarfs /sys/firmware/efi/efivars
findmnt /boot/efi
efivar -l
efibootmgr -c -d /dev/sdb -p 1 -l /EFI/refind/refind_x64.efi -L "rEFInd"

5.Change root for the new system

arch-chroot /mnt
echo usbarch > /etc/hostname
passwd

6.Set the correct time zone

ln -sf /usr/share/zoneinfo/Brazil/East
cd /etc/

6.1 correct the time

vim locale.gen
-uncomment the location you want
locale-gen
vim /etc/mkinitcpio.conf
-"write "block" before autodetect and remove the other "block""
mkinitcpio -p linux

installing GRUB:

pacman -S grub
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=grub --removable --recheck
grub-mkconfig -o /boot/grub/grub.cfg

7. enable dhcp

systemctl enable dhcpcd
unmount -R /mnt

Last edited by Zatura (2016-03-02 03:40:48)

Offline

#2 2016-01-11 08:16:23

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,732
Website

Re: Portable Arch Linux Legacy/UEFI Hybrid exists?

Simply create a BIOS boot partition (type EF02 in gdisk) and run the GRUB install command for non-UEFI systems (you have already installed the UEFI GRUB loader):

# grub-install --target=i386-pc --recheck /dev/sdX

https://wiki.archlinux.org/index.php/Gr … ll_to_disk

I'm curious, why have you created a custom NVRAM entry for a rEFInd .efi loader?

Offline

#3 2016-01-15 21:35:01

Zatura
Member
Registered: 2016-01-10
Posts: 3

Re: Portable Arch Linux Legacy/UEFI Hybrid exists?

Head_on_a_Stick wrote:

Simply create a BIOS boot partition (type EF02 in gdisk) and run the GRUB install command for non-UEFI systems (you have already installed the UEFI GRUB loader):

# grub-install --target=i386-pc --recheck /dev/sdX

Hi, Head_on_a_Stick, I Tried your solution different ways and it didn't work.
Firstly, I did exactly what you did, it boots normally in my Legacy-only notebook, however when I try to boot in my surface pro 3(UEFI-only) it just show a lot of error messages.

I kept using my google search skills and I found something called DUET that looks like it's a solution.
Will it work if i install in my pen drive? if so, is there any good tutorial that could make my life easier installing this DUET?
Thank you for replying!

Last edited by Zatura (2016-03-02 00:26:54)

Offline

#4 2016-01-15 21:40:00

tom.ty89
Member
Registered: 2012-11-15
Posts: 897

Re: Portable Arch Linux Legacy/UEFI Hybrid exists?

What's "lot of error messages" anyway?

Isn't DUET the thing that "introduce" UEFI to a BIOS-only system...?

Offline

#5 2016-01-15 21:42:06

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,553

Re: Portable Arch Linux Legacy/UEFI Hybrid exists?

I do this all the time. Just install booloaders for both setups.

Offline

#6 2016-01-15 22:00:54

TheSaint
Member
From: my computer
Registered: 2007-08-19
Posts: 1,523

Re: Portable Arch Linux Legacy/UEFI Hybrid exists?

let us see

# efibootmgr -v
# mount /dev/sdb1 /mnt
# tree /mnt

What is necessary to know it is about where the boot loader is pointed to. Also if it is grub, it should be addressed to the same grub.cfg for both ways of booting (MBR or UEFI)
Grub, in MBR mode, mostly needs the first Mb gap at the beginning of the media volume.

It would be much appreciated if you put tags to your post

Last edited by TheSaint (2016-01-15 22:03:02)


do it good first, it will be faster than do it twice the saint wink

Offline

#7 2016-01-19 21:01:53

Zatura
Member
Registered: 2016-01-10
Posts: 3

Re: Portable Arch Linux Legacy/UEFI Hybrid exists?

I made 3 partitions:
/dev/sdb1 (EFI    FAT32 fs) EF00   200M
/dev/sdb2 (BIOS EXT4 fs) EF02    200M     
/dev/sdb3 (root   EXT4 fs) default   6G         <---ROOT

Do i really need separeted partitions for BIOS and EFI?

This is what i did

grub-install --target=x86_64-efi  --efi-directory=/boot/efi --bootloader-id=grub --removable --recheck
grub-install --target=i386-pc --boot-directory=/boot --bootloader-id=grub --removable --recheck /dev/sdb         (/dev/sdb?? is it right?? it shouldn't be /dev/sdb2 ?)
grub-mkconfig -o /boot/grub/grub.cfg

what am i making wrong? it seems that some files get messed up after this, and that's why things are not working

Last edited by Zatura (2016-03-02 03:39:53)

Offline

#8 2016-01-19 21:09:26

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,732
Website

Re: Portable Arch Linux Legacy/UEFI Hybrid exists?

Zatura wrote:
/dev/sdb2 (BIOS EXT4 fs) EF02  200M

BIOS boot partitions are not supposed to have filesystems.

How did you create it?

What is the full output of:

# parted -l

EDIT: Also, a BIOS boot partition only needs to be ~1MiB in size (maybe even less) so 200MiB is far too big. This isn't a problem per se but I don't like it tongue

EDIT2: to answer your question, you only need a BIOS boot partition to boot GRUB in a non-UEFI system from a GPT disk.

It is possible to use syslinux to boot in both UEFI and non-UEFI modes without a BIOS boot partition, there was even a thread about it here if your search fu is up to it wink

Last edited by Head_on_a_Stick (2016-01-19 21:20:22)

Offline

#9 2016-01-19 22:11:28

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,525
Website

Re: Portable Arch Linux Legacy/UEFI Hybrid exists?

TheSaint wrote:

It would be much appreciated if you put tags to your post

Zatura, it is possible to edit your posts to add the proper code tags - that would be nice, but not necessarily required/expected.  But it is expected that once instructed on how to post well that you do so - yet on the very next post after this was suggested you completely ignored it.  Please use code tags properly.  If you are unsure how, see the "BBCode" link right under every post text-entry box.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

Board footer

Powered by FluxBB