You are not logged in.

#1 2018-07-13 20:01:19

pfdint
Member
Registered: 2013-11-18
Posts: 43

[SOLVED] Questions about a two drive, windows/archlinux UEFI install

What I have:

A single box with 2 drives:
nvme0n1    --(An M.2 drive currently booting windows 10 UEFI)
├─nvme0n1p1 :: 499MiB :: NTFS :: probably windows recovery partition
├─nvme0n1p2 :: 100MiB :: FAT32 :: EFI system partition
├─nvme0n1p3 :: 16MiB :: microsoft reserved whatever
└─nvme0n1p4 :: 953.27GiB :: NTFS :: windows 10 home
sda    --(A SATA SSD currently unformatted)

What I envision:

* Use UEFI
* M.2 drive boots windows 10 [done.]
* SSD drive boots archlinux
* I use motherboard's UEFI firmware to select which OS to boot.
* One or the other will boot automatically and without delay.
* Neither drive/OS knows about the other. (Bootwise).

What I used to do:

* I had a single archlinux drive of 3 partitions: /, /boot, /home (of ext4, ext2, ext4)
(I am open to changing the model if people have advice)

Questions I have:

A) Each drive should have its own EFI partition, right?
B) How is the old /boot partition conceptually related to the new EFI partition archlinux will have? Will I still have the same partition setup and /boot will just have EFI stuff instead of grub stuff?
C) At the time it was mandated that /boot partitions be ext2. Is that still the case? What should it be instead?

Most importantly,

What will the SSD Arch install look like?

Will it look like this?:
sda
├─sda1 :: 128MiB :: ext2 :: /boot
├─sda2 :: 100MiB :: FAT32 :: EFI system partition
├─sda3 :: 64GiB :: ext4 :: /
└─sda4 :: 936GiB :: ext4 :: /home

Last edited by pfdint (2018-07-14 02:13:55)

Offline

#2 2018-07-13 21:24:38

circleface
Member
Registered: 2012-05-26
Posts: 639

Re: [SOLVED] Questions about a two drive, windows/archlinux UEFI install

A) No, you only need one EFI partition on the entire computer.  It can be on either drive.
B) I'm not sure about Grub, but from what I read it seems that the grub files should be mounted to /boot/efi, which can be a separate partition from /boot.  /boot still needs to hold the linux kernel and linux initramfs, so make sure it is large enough.  (Please understand I have very little knowledge about Grub so I might be wrong here).
C) The EFI partition, which could be mounted to /boot or /boot/efi, needs to be FAT32, unless your motherboard's firmware supports another filesystem.

Please wait for someone more experienced with grub to answer before you follow my advice, since I have never used Grub and don't really understand it.  I always use systemd-boot which in my opinion is much simpler to use, though not as "pretty" as grub can be.

Offline

#3 2018-07-13 21:40:26

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

Re: [SOLVED] Questions about a two drive, windows/archlinux UEFI install

Slight comment on the above: while it is possible to have a separate boot and efi partition it is generally best not to: the efi partiton should be your boot partition.

I second the above in that point that you should have just one efi partition that can quite readily be shared between windows and linux.  I'm not sure it is possible to have two (functional) efi partitions on the same computer - I think one would just be ignored.  So is the 100% separation on the two drives really a requirement?  Or can you just keep using the existing EFI partition and mount it at /boot for your new linux system?  If so, the SSD will just have / and /home partitions (and /boot will be the existing efi partition on the other drive).

Last edited by Trilby (2018-07-13 21:52:43)


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

Offline

#4 2018-07-13 21:47:10

pfdint
Member
Registered: 2013-11-18
Posts: 43

Re: [SOLVED] Questions about a two drive, windows/archlinux UEFI install

Hm, thanks.

If only one EFI partition is required for the whole computer, why do they need it at all? Why didn't they just put it on the motherboard? Is that really the case, that I could remove the drive with the EFI partition and the other drive will still boot?

I didn't mean to imply I'd be using grub. The impression I have is that we ought to be moving away from it? But I have to find out what the alternatives are. It's been a long time since I last installed.
But I do see you saying there definitely needs to be a /boot partition, that makes sense.

I think I also hear you saying there *does* need to be an EFI partition, and mounted to /boot or /boot/efi. Is it really possible to mount 2 partitions to /boot? That doesn't sound right. So there would be a _boot partition mounted to /boot and an EFI partition mounted to /boot/efi...

I'm still very confused, unfortunately. But given the information I'm hearing here, the second drive might still look like this?:

sda
├─sda1 :: 128MiB :: ext2 :: /boot
├─sda2 :: 100MiB :: FAT32 :: EFI system partition
├─sda3 :: 64GiB :: ext4 :: /
└─sda4 :: 936GiB :: ext4 :: /home

Offline

#5 2018-07-13 21:50:09

pfdint
Member
Registered: 2013-11-18
Posts: 43

Re: [SOLVED] Questions about a two drive, windows/archlinux UEFI install

I hear Trilby saying that the _boot and EFI partition are one and the same under best practices.
So perhaps the SSD will look like this:
sda
├─sda1 :: 256MiB :: FAT32 :: /boot + EFI system partition
├─sda2 :: 64GiB :: ext4 :: /
└─sda3 :: 936GiB :: ext4 :: /home

Yes the 100% independence is very important to me.

Offline

#6 2018-07-13 21:53:03

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] Questions about a two drive, windows/archlinux UEFI install

You can have a second EFI, to use as a backup if the other drive fails, but you would need to have completely separate conf files in the boot manager to reference them.

Just mount your EFI to /boot, it will be simpler.

Ulitmately, though, you are best off trying a couple of different approaches and working out for yourself what suits you. If one of them doesn't work, it is trivial to fix from a chroot and you will learn exactly how it all works in the process.


Moving to NC...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#7 2018-07-13 22:01:04

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

Re: [SOLVED] Questions about a two drive, windows/archlinux UEFI install

pfdint wrote:

If only one EFI partition is required for the whole computer, why do they need it at all? Why didn't they just put it on the motherboard?

That is theoretically possible.  But in a sense that'd just be yet another drive ... but the size would be fixed and predetermined: how much storage should hardware manufacturers put on this built in storage?  It's really just easier to have users create a partition of whatever size they want.

pfdint wrote:

Is that really the case, that I could remove the drive with the EFI partition and the other drive will still boot?

Of course not.  A (U)EFI system will not boot without an EFI partition ... and even if it could if boot and efi are the same partition your kernel will be on that efi partition that you have removed from the computer: no kernel, no booting.

pfdint wrote:

I didn't mean to imply I'd be using grub. The impression I have is that we ought to be moving away from it?

I think that "ought" is quite an overstatement, if not entirely false.  I don't use grub, and I'm a bit critical of it.  But it still has it's place on some systems and many many archers use it.  It is most certainly not deprecated nor ill-advised.  It is however also not necessary especially on simpler configurations.  You do not need a "boot loader" but you do need a boot manager.  Systemd provides one (systemd-boot), and you already have one for windows anyways.

pfdint wrote:

I think I also hear you saying there *does* need to be an EFI partition, and mounted to /boot or /boot/efi. Is it really possible to mount 2 partitions to /boot? That doesn't sound right. So there would be a _boot partition mounted to /boot and an EFI partition mounted to /boot/efi...

You do need an efi partiton.  You can mount one partition to /boot and another to /boot/efi, but current best practices are generally just to use one partition to do both jobs, so you don't mount two partitions to /boot, you mount just one partition to /boot and it serves as both your efi partition and your boot partition.  In your case, that partition already exists as nvme0n1p2.  So you can have / and /home on sda and mount nvme0n1p2 at /boot


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

Offline

#8 2018-07-13 22:21:36

pfdint
Member
Registered: 2013-11-18
Posts: 43

Re: [SOLVED] Questions about a two drive, windows/archlinux UEFI install

Here is what I am synthesizing from your collected wisdom.

* I need an EFI partition to boot the archlinux install.
* I can merge the EFI partition and the _boot partition into a single partition. This is simply a matter of collecting all the relevant files on that lone partition.
* I could use the EFI partition on the windows drive.
* I do not want any reference by the archlinux drive to the windows drive.
* Therefore, I must create another EFI partition for the archlinux install.
* The generally recommended partition setup of /, /boot, and /home has not changed.

So the SSD will look as follows:
sda
├─sda1 :: 256MiB :: FAT32 :: /boot + EFI system partition
├─sda2 :: 64GiB :: ext4 :: /
└─sda3 :: 936GiB :: ext4 :: /home

My final question before proceeding, then, is whether this 2 EFI partition setup will behave as I'm expecting it to, with the drives booting independently based on what I select in the bios. I suspect no one can actually answer that, so I must return after attempting it.

It looks like all I have to do to make an EFI partition is create a FAT32 partition and activate an 'esp' flag on it. In order to create a merged EFI and _boot partition, I think no extra steps are necessary, just create the partition, mount it, chroot, and continue with installation. It sounds like the installation process will know what to do with a /boot mount and a partition flagged esp.
If any of that isn't right, let me know.

Thanks everyone, I'll see you after trying it.

Offline

#9 2018-07-13 22:29:11

loqs
Member
Registered: 2014-03-06
Posts: 17,192

Re: [SOLVED] Questions about a two drive, windows/archlinux UEFI install

Typically firmware is not tested with multiple ESP's so unexpected behavior is much more likely with that setup.
Also the firmware may drop an entry for a the bootloader if you decided to remove a drive without marking such an entry removable.

Last edited by loqs (2018-07-13 22:29:29)

Offline

#10 2018-07-13 23:05:30

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

Re: [SOLVED] Questions about a two drive, windows/archlinux UEFI install

pfdint wrote:

* I can merge the EFI partition and the _boot partition into a single partition. This is simply a matter of collecting all the relevant files on that lone partition.

There might be confusion here.  You don't need to merge or collect anything.  If you have a FAT32 ESP mounted at /boot, the normal installation procedure will put everything in the right place.

pfdint wrote:

* I could use the EFI partition on the windows drive.
* I do not want any reference by the archlinux drive to the windows drive.
* Therefore, I must create another EFI partition for the archlinux install.

Your logic here is sound, but this does require that a machine can use 2 seperate ESP (EFI System Partitions) which I am skeptical about and the other posters in this thread seem to advise against.


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

Offline

#11 2018-07-14 02:14:12

pfdint
Member
Registered: 2013-11-18
Posts: 43

Re: [SOLVED] Questions about a two drive, windows/archlinux UEFI install

Total victory.

My vision has been achieved and then some.

Both drives are independently capable of UEFI booting, AND I can set a preference for which one boots by default and there is no additional boot delay.

---STATUS-------------
sda
├─sda1 :: 256MiB :: FAT32 :: /boot + EFI system partition
├─sda2 :: 64GiB :: ext4 :: /
└─sda3 :: 936GiB :: ext4 :: /home
nvme0n1
├─nvme0n1p1 :: 499MiB :: NTFS :: probably windows recovery partition
├─nvme0n1p2 :: 100MiB :: FAT32 :: EFI system partition
├─nvme0n1p3 :: 16MiB :: microsoft reserved whatever
└─nvme0n1p4 :: 953GiB :: NTFS :: windows 10 home

---REPORT------------
* Prior to installation, I partitioned the SSD for archlinux as above.
* I used a usb to install archlinux to the drive as specified by the general purpose Installation Guide page.
* At the very last step of installation before rebooting ("Boot loader"), I searched for a boot loader. I chose EFISTUB as my bootloader.
      -This is a feature by which the Linux kernel can be launched as an EFI executable directly by the UEFI firmware.
      -This is possible because Arch Linux kernels have this capability enabled by default: CONFIG_EFI_STUB=y in the kernel configuration at build time.
      -This enables the kernel to "masquerade as a PE/COFF image, thereby convincing EFI firmware loaders to load it as an EFI executable".
      -This effectively means that I have no bootloader. The UEFI firmware on the motherboard is my bootloader.
* In order to use the UEFI Boot Manager as my bootloader, I need some way to interact with it. while still chrooted, I installed efibootmgr, a tool to "manipulate the UEFI Boot Manager".
* I listed the current setup of the UEFI Boot Manager

# efibootmgr

* I deleted the listings for the install usb I was booting off of:

# efibootmgr -b 3 -B
# efibootmgr -b 4 -B

      -... -b 4 ... selects the 4th entry for editing
      -... -B ... deletes the entry.
* I constructed the command to create the new entry for my archlinux install:
* Obtain the partition UUID for the install's root partition, /dev/sda2's UUID:

# blkid | grep sda2

* Peek at my boot partition's contents:

# ls /boot
initramfs-linux.img intel-ucode.img vmlinuz-linux

      -intel-ucode.img I have an Intel CPU, so I need the microcode package. I may or may not have had to mkinitcpio -p linux rebuild after installing that.
* Create the new boot entry for Arch Linux:

# efibootmgr --disk /dev/sda --part 1 --create --label "Arch Linux" --loader /vmlinuz-linux --unicode "root=PARTUUID=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX rw initrd=\initramfs-linux.img initrd=\intel-ucode.img" --verbose

      -... --disk /dev/sda ... select the target disk
      -... --part 1 ... tell the entry which partition is the EFS boot partition, the one flagged with 'efs' during the partitioning stage. This number is literally the partition number /dev/sda1.
      -... --create ... create an entry
      -... --label "Arch Linux" ... this is the name you will select at the boot selection screen.
      -... --loader /vmlinuz-linux ... this should be the same for you. UEFI specification demands \ backslashes for everything, but efibootmgr automatically converts regular slashes for you.
      -... --unicode ... options to be passed to the kernel
      -...root=PARTUUID=... that is the literal option you write, and followed by the partition UUID you found for your install's root partition.
          -Mistake: I originally supplied by boot partition's UUID because of conceptual/linguistic crossover. This resulted in "unknown filesystem: vfat; dropping into emergency shell". Make sure to offer the kernel its actual / directory where it will work and play.
      -... rw ... mount read/write as usual
      -... initrd=\initramfs-linux.img ... pass the kernel its initial ramdisk as usual
      -... initrd=\intel-ucode.img... I had an Intel CPU to worry about
      -... --verbose Sure why not
* This creation process automatically puts the new entry at the beginning of the boot order.
      -To change the default boot order, refer to the entry numbers:

# efibootmgr -o 2,0,1

      -This is also an opportunity to change the window of opportunity to select boot devices at startup. I left mine at 1 second.

# efibootmgr -t 1

* That's all. Continue with installation by leaving chroot and unmounting the drives and shutting down.
* Now, you can use your bios' boot selection key to boot whatever the hell you want in 2018 and beyond.

---CASUALTIES--------
I notice windows and linux aren't agreeing on whether the system clock should include timezone offset. I will troubleshoot later. Otherwise no problems.

---OPINION--------------
It's really not outrageous to ask to have 2 drives on a computer, both of which are bootable and removable. If the new firmware standard wasn't capable of that where BIOS was, something would be very rotten indeed over at uefi.org.
Bootloaders are for scrubs. And wizards.

Last edited by pfdint (2018-07-14 02:18:47)

Offline

#12 2018-07-14 03:22:23

circleface
Member
Registered: 2012-05-26
Posts: 639

Re: [SOLVED] Questions about a two drive, windows/archlinux UEFI install

I'm glad to hear you got it working the way you wanted it to.  Just be aware, sometimes Windows likes to overwrite EFI info in the motherboard.  So, you might have to re-run the command you used to add the linux kernel to boot directly from the firmware if you update Windows and it decides it doesn't like linux and deletes it from the firmware.  But of course, this depends on your firmware and Windows and the position of the moon in the sky, so you might not ever have a problem or you might.  No way to know for sure.

Offline

Board footer

Powered by FluxBB