The officially official Devuan Forum!

You are not logged in.

#1 2024-06-14 15:30:19

jeudi
Member
Registered: 2024-05-24
Posts: 22  

[SOLVED] How to force the ESP partition to be formatted at installation ?

Hi,
how to format the ESP partition at manual partitionning step ?
I use the expert installation and manual partitionning methods, as I want to keep my partition layout and use the full-disk encryption and want to keep my existing encrypted partition. But I can't find how to format it.
I want to format it because I was on Arch Linux and I want a clean installation. The old .efi files stay on the partition.

I thought formatting it in a shell at the same time I use cryptsetup to open my encrypted partition but is there another way to do it ?

Here's my partition layout

$ lsblk -f /dev/nvme0n1
NAME                 FSTYPE      FSVER LABEL UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
nvme0n1
├─nvme0n1p1          vfat        FAT32 ESP   3075-B1FE                               505M     1% /boot/efi
├─nvme0n1p2          ext4        1.0   boot  ddd9f57d-603b-423f-ac55-8b626e13d427  812,8M    10% /boot
└─nvme0n1p3          crypto_LUKS 2           3b33f705-8877-480d-9555-a3df72b944b8
  └─cryptlvm
    ├─arch_vg-swap                                                                               [SWAP]
    ├─arch_vg-rootfs                                                                25,1G     9% /
    └─arch_vg-home                                                                 824,6G     0% /home

Thanks : )
(I forgot to rename my volume group -___-)


Devuan Daedalus 64bits - Ryzen 7 5700X - Radeon RX 7600 - 16Go RAM

Offline

#2 2024-06-14 17:13:48

fsmithred
Administrator
Registered: 2016-11-25
Posts: 2,470  

Re: [SOLVED] How to force the ESP partition to be formatted at installation ?

You can (and should) remove the unwanted boot entries using efibootmgr.

efibootmgr -b XXXX -B

where XXXX is the boot order number given by efibootmgr without any arguments.

Offline

#3 2024-06-14 17:28:47

jeudi
Member
Registered: 2024-05-24
Posts: 22  

Re: [SOLVED] How to force the ESP partition to be formatted at installation ?

I found how to delete UEFI entries and old efi files from other distros today. But it is not answering my question. x)

How to re-format the Boot EFI partition within the installer ?


Devuan Daedalus 64bits - Ryzen 7 5700X - Radeon RX 7600 - 16Go RAM

Offline

#4 2024-06-14 17:53:52

fsmithred
Administrator
Registered: 2016-11-25
Posts: 2,470  

Re: [SOLVED] How to force the ESP partition to be formatted at installation ?

You should be able to select the efi partition from the partition list and set it to be formatted and used as the esp. I haven't done it in the installer in a long time.

Be forewarned that some motherboards with poor uefi implementations may be bricked by formatting the efi partition. Here's some info about that:
https://superuser.com/questions/1318593 … -dangerous

Offline

#5 2024-06-14 18:15:34

jeudi
Member
Registered: 2024-05-24
Posts: 22  

Re: [SOLVED] How to force the ESP partition to be formatted at installation ?

Thank you for your answer.

The problem is that the installer keep and use the EFI partition automatically. There is no option to re-format this partition.
You can tell the installer not to use it but not to format it.
Now I know how to delete old EFI files and entries it's not a big deal but I'm still curious to know if we can do it or not.

Thank you for your link. But I already format my EFI partition while installing Arch Linux before and nothing happened, l'm lucky.
About this, the expert installer of Devuan ask if we want to write on NVRAM, is it okay ? I did it because I thought it was the right way to install the booloader but now I'm in doubt.


Devuan Daedalus 64bits - Ryzen 7 5700X - Radeon RX 7600 - 16Go RAM

Offline

#6 2024-06-14 18:30:50

rolfie
Member
Registered: 2017-11-25
Posts: 1,146  

Re: [SOLVED] How to force the ESP partition to be formatted at installation ?

My advice is: with any live system, first of all delete all existing entries of operating systems that efibootmgr shows. Keep the ones that point to internal devices like cdrom, usb ... That makes sure the efi flash memeory in the bios is more or less cleared. There usually is no other way.
In a second step, you may use a gparted live iso to write a new partition table to the nvme. Then all exisiting partitions are history., and you may set up you desired partitioning scheme.

Last edited by rolfie (2024-06-14 18:31:31)

Offline

#7 2024-06-14 18:52:53

Camtaf
Member
Registered: 2019-11-19
Posts: 423  

Re: [SOLVED] How to force the ESP partition to be formatted at installation ?

I create & format EFI partitions before running the installer on some distros,  (& BSDs), & then it gets picked up & used for the installation, can't remember if Devuan is like that or not.

Offline

#8 2024-06-14 19:11:03

jeudi
Member
Registered: 2024-05-24
Posts: 22  

Re: [SOLVED] How to force the ESP partition to be formatted at installation ?

In a second step, you may use a gparted live iso to write a new partition table to the nvme. Then all exisiting partitions are history., and you may set up you desired partitioning scheme.

As I said, I want to keep my partition table. Like this I don't have to erase the luks header and have to learn another password.

I create & format EFI partitions before running the installer on some distros,  (& BSDs), & then it gets picked up & used for the installation, can't remember if Devuan is like that or not.

It's the solution I thought about. Formating it before to clean it and then it will be automatically used by the installer. I was just wondering if there were another way to do it from the installer instead of using a command line.

I mark the subject SOLVED. Thank you everybody for your answers

PS: and @fsmithred, I read about UEFI and systemd bricking some motherboard. I'm scared know x) I'll check if this issue is also on Devuan and sysvinit : )


Devuan Daedalus 64bits - Ryzen 7 5700X - Radeon RX 7600 - 16Go RAM

Offline

#9 2024-06-14 21:00:27

rolfie
Member
Registered: 2017-11-25
Posts: 1,146  

Re: [SOLVED] How to force the ESP partition to be formatted at installation ?

jeudi wrote:

rolfie wrote:

In a second step, you may use a gparted live iso to write a new partition table to the nvme. Then all exisiting partitions are history., and you may set up you desired partitioning scheme.

As I said, I want to keep my partition table. Like this I don't have to erase the luks header and have to learn another password.

What hinders you to set up the exact same scheme again with gparted?

Well you have to set up luks again, but you can you the same PW. What hinders you? I do that all the time when I am not happy with what I got.

Last edited by rolfie (2024-06-14 21:00:56)

Offline

#10 2024-06-14 22:02:10

jeudi
Member
Registered: 2024-05-24
Posts: 22  

Re: [SOLVED] How to force the ESP partition to be formatted at installation ?

What hinders you to set up the exact same scheme again with gparted?

Well you have to set up luks again, but you can you the same PW. What hinders you? I do that all the time when I am not happy with what I got.

Okay, I can just make the same partionning layout but that was not the question. I don't try to erase my drive and reinstall, I ask if it's possible to re-format the existing EFI partition within the installer like I can do it with Arch installation medium.


Devuan Daedalus 64bits - Ryzen 7 5700X - Radeon RX 7600 - 16Go RAM

Offline

#11 2024-06-15 01:06:51

ralph.ronnquist
Administrator
From: Battery Point, Tasmania, AUS
Registered: 2016-11-30
Posts: 1,218  

Re: [SOLVED] How to force the ESP partition to be formatted at installation ?

I don't have your setup so can't say for sure, but experimented a little with the installer's partitioning dialogs.

It sure does seem that the partman developers try to be clever about the "EFI System Partition" and exclude the offer to erase a pre-existing ESP.

So instead you'll need to fiddle with the shell at that point, which of course is far from ideal. Basically enter the shell with C-A-F2 and erase the partition with dd.

Offline

#12 2024-06-15 06:29:31

jeudi
Member
Registered: 2024-05-24
Posts: 22  

Re: [SOLVED] How to force the ESP partition to be formatted at installation ?

So instead you'll need to fiddle with the shell at that point, which of course is far from ideal. Basically enter the shell with C-A-F2 and erase the partition with dd.

Simpler solution : execute a shell within the install, format the EFI partition with mkfs.fat -F 32 /my/partition, exit the shell to return to the installer and ta-da ! : D


Devuan Daedalus 64bits - Ryzen 7 5700X - Radeon RX 7600 - 16Go RAM

Offline

#13 2024-06-16 05:50:12

aluma
Member
Registered: 2022-10-26
Posts: 646  

Re: [SOLVED] How to force the ESP partition to be formatted at installation ?

@jeudi
You did it, respect!

But in my sad experience, if there is a possibility of an fatal error, it will certainly happen. smile
I already had an error in typing a command in the console and... trump-pump-pump, all over again.
Therefore, gparted live to prepare the disk, select commands, then, after checking, confirm execution.
But this is just my path.

Regards.

Last edited by aluma (2024-06-16 05:58:50)

Offline

#14 2024-06-16 11:27:57

jeudi
Member
Registered: 2024-05-24
Posts: 22  

Re: [SOLVED] How to force the ESP partition to be formatted at installation ?

Using a live CD before installation to prepare partitions is also a solution. I proposed my way because it can be done at the same time as opening a encrypted device and with the Devuan live tools.
But both are good. : )


Devuan Daedalus 64bits - Ryzen 7 5700X - Radeon RX 7600 - 16Go RAM

Offline

Board footer