Linux - Newbie This 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
 |
|
07-14-2017, 01:01 PM
|
#1
|
Member
Registered: Aug 2005
Posts: 81
Rep:
|
Need help managing efi entries
Hello,
I got a warning that I have low uefi disk pace.
My efi partition is 100 MB. I didn’t make the partition, it came with the laptop pre-partitioned.
I have a new machine and I am still not completely familiar with the efi system that’s why I need advise to free up space on the efi partition.
I guess some of my experiments left old entries on the efi partition that I need to be deleted somehow to free up disk space. But I don’t know how.
This is my boot directory:
Code:
[mak@jmak-pc ~]$ dir /boot/efi/EFI
antergos_grub antergos_grub_gmm1 arch-KDE Dell
antergos_grub_1jst antergos_grub_oeil ArchLabs grub
antergos_grub_39nr antergos_grub_vl0n archLXQT Manjaro
antergos_grub_a0co antergos_grub_wnhk archLXQT_2 Microsoft
antergos_grub_de48 arch_enlightenment arc_lxqt rosa
antergos_grub_dh05 ArchKDE Boot ubuntu
From the 19 items only 4 exist, the rest are none-existent leftovers from my previous experiments.
This shows that my efi partition is 96% full:
Code:
[mak@jmak-pc ~]$ df -h
Filesystem Size Used Avail Use% Mounted on
dev 3.9G 0 3.9G 0% /dev
run 3.9G 9.2M 3.9G 1% /run
/dev/sda8 20G 7.0G 12G 38% /
tmpfs 3.9G 0 3.9G 0% /dev/shm
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
tmpfs 3.9G 192K 3.9G 1% /tmp
/dev/sda2 96M 93M 4.0M 96% /boot/efi
tmpfs 786M 8.0K 786M 1% /run/user/1000
overlaid 786M 8.0K 786M 1% /run/user/1000/mak-chromium
/dev/sda11 73G 233M 69G 1% /run/media/mak/b6eaebe0-022c-4add-9692-c54ad69c77bf
[mak@jmak-pc ~]$
Thank you.
Last edited by jozmak; 07-17-2017 at 10:52 AM.
Reason: SOLVED
|
|
|
07-14-2017, 01:51 PM
|
#2
|
Senior Member
Registered: Dec 2014
Location: Montreal, Quebec and Dartmouth, Nova Scotia CANADA
Distribution: Arch, AntiX, ArtiX
Posts: 1,364
|
Hi jozmak,
In my opinion, 100MB is way too small for an ESP. If it were me, I would use GParted Live to grow it to *at least* 200MB or if you can spare it (your df -h output suggests this is the case), 500MB.
You can do a clean-up, but in my opinion you will run into the issue again if you don't increase the size of your ESP.
Hope this helps - let us know if anything.
Cheers !
|
|
|
07-14-2017, 03:04 PM
|
#3
|
Member
Registered: Aug 2005
Posts: 81
Original Poster
Rep:
|
Quote:
Originally Posted by Rickkkk
Hi jozmak,
In my opinion, 100MB is way too small for an ESP. If it were me, I would use GParted Live to grow it to *at least* 200MB or if you can spare it (your df -h output suggests this is the case), 500MB.
You can do a clean-up, but in my opinion you will run into the issue again if you don't increase the size of your ESP.
Hope this helps - let us know if anything.
Cheers !
|
Hi Rickkkk,
Thanks for replying.
I thought of this, but as far as I know you can expand a partition only if there is space right next to it.
This is my partition table:
Code:
[mak@jmak-pc ~]$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 238.5G 0 disk
├─sda1 8:1 0 450M 0 part
├─sda2 8:2 0 100M 0 part /boot/efi
├─sda3 8:3 0 16M 0 part
├─sda4 8:4 0 59.9G 0 part
├─sda5 8:5 0 20G 0 part
├─sda6 8:6 0 20G 0 part
├─sda7 8:7 0 20G 0 part
├─sda8 8:8 0 20G 0 part /
├─sda9 8:9 0 20G 0 part
├─sda10 8:10 0 4G 0 part [SWAP]
└─sda11 8:11 0 74G 0 part /run/media/mak/b6eaebe0-022c-4add-9692-c54ad69c
[mak@jmak-pc ~]$
As you see there is a 16MB partition between the efi and the windows (sda4) partition from which I could recover the required disk space. I think the 16MB is either dell service partition or windows recovery partition.
So I don’t know how this would be possible.
As you see there is plenty of diskspace on (sda11) partition available but they are in a wrong sequence.
What do you think if I would create a second ESP partition right after the (sda11) that could work? This way I would have two ESP partitions, one for windows and one for linux.
|
|
|
07-14-2017, 04:03 PM
|
#4
|
Senior Member
Registered: Dec 2014
Location: Montreal, Quebec and Dartmouth, Nova Scotia CANADA
Distribution: Arch, AntiX, ArtiX
Posts: 1,364
|
Hi again jozmak,
You are indeed correct that you must have contiguous free space adjacent to a partition in order to be able to expand it. You would be required to do a good bit of manipulation of several partitions (shrinking, moving ...) to grow your ESP.
I can't comment on whether your suggestion of a 2nd ESP is recommendable or not - I've never done it (perhaps other members may have an opinion ... ).
I personally would greatly simplify the partitioning scheme. 11 logical partitions on a 250GB disk is, in my opinion, not optimal. I would expect that you may run into other issues down the road. That said, you may have set it up that way for a good reason - could you perhaps elaborate on what motivated you to structure it that way ?
My scheme of choice for a client machine (i.e. non-server) is simple: one ESP, one root partition (which includes home) and one swap partition (even this is optional). On my servers I have a separate home partition.
|
|
|
07-14-2017, 04:21 PM
|
#5
|
Member
Registered: Aug 2005
Posts: 81
Original Poster
Rep:
|
Quote:
Originally Posted by Rickkkk
Hi again jozmak,
You are indeed correct that you must have contiguous free space adjacent to a partition in order to be able to expand it. You would be required to do a good bit of manipulation of several partitions (shrinking, moving ...) to grow your ESP.
I can't comment on whether your suggestion of a 2nd ESP is recommendable or not - I've never done it (perhaps other members may have an opinion ... ).
I personally would greatly simplify the partitioning scheme. 11 logical partitions on a 250GB disk is, in my opinion, not optimal. I would expect that you may run into other issues down the road. That said, you may have set it up that way for a good reason - could you perhaps elaborate on what motivated you to structure it that way ?
My scheme of choice for a client machine (i.e. non-server) is simple: one ESP, one root partition (which includes home) and one swap partition (even this is optional). On my servers I have a separate home partition.
|
The reason is simple, I am a kind of distro hopper. I like to check out different linux flavors.
On my desktop machine with 1 TB space I had 16 partitions.
But this is what I've found on arch forum:
https://bbs.archlinux.org/viewtopic.php?id=168503
"Having two EFI System Partitions (ESPs) on one disk is explicitly permitted by the EFI spec; however, it's inadvisable because the Windows 7 installer flakes out when presented with such a configuration. Once installed, Windows 7 seems to work normally, although I don't know if everything works fine -- there might conceivably be problems with software updates that would access the ESP, for instance...."
"Another possibility is to use two ESPs, but adjust the Linux ESP's partition type code so that it's not a regular ESP should you ever need to re-install Windows or when you install system updates or otherwise do anything that might interact with the ESP."
In the second part, what does he mean by "adjust the Linux ESP's partition type code so that it's not a regular ESP"
As far as I know the efi partition code is "ef00". Is there other efi code?
Thank you,
|
|
|
07-14-2017, 06:25 PM
|
#6
|
LQ Guru
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524
|
If you're going to distro hop, then virtualbox is probably a lot easier than actually installing all the distros.
|
|
|
07-14-2017, 06:27 PM
|
#7
|
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,440
|
Quote:
Originally Posted by jozmak
From the 19 items only 4 exist, the rest are none-existent leftovers from my previous experiments.
|
Impressive - even I don't have listings like that. If you don't need all 4, just delete the appropriate directory(s) - that'll give you a "quick fix" maybe. Likewise the empty dirs. If you also want to clean up the boot list (in NVRAM), use efibootmgr from Intel; should be in one of your repos. Else check your EFI setup menu for a delete option.
As for the partition, no magic there - it's just a [V]FAT partition. Reallocate a bigger one and copy everything over. I've never allowed more than one EFI partition (change the original one after the copy), but the move to a new partition has worked fine when I've needed to do it.
|
|
|
07-14-2017, 07:38 PM
|
#8
|
Member
Registered: Aug 2005
Posts: 81
Original Poster
Rep:
|
Quote:
Originally Posted by syg00
Impressive - even I don't have listings like that. If you don't need all 4, just delete the appropriate directory(s) - that'll give you a "quick fix" maybe. Likewise the empty dirs. If you also want to clean up the boot list (in NVRAM), use efibootmgr from Intel; should be in one of your repos. Else check your EFI setup menu for a delete option.
As for the partition, no magic there - it's just a [V]FAT partition. Reallocate a bigger one and copy everything over. I've never allowed more than one EFI partition (change the original one after the copy), but the move to a new partition has worked fine when I've needed to do it.
|
This is what my efibootmgr shows:
Code:
[mak@jmak-pc ~]$ sudo efibootmgr
[sudo] password for mak:
BootCurrent: 0001
Timeout: 6 seconds
BootOrder: 0001,0000,0002,0003,0004,0005,0006,0007
Boot0000* Windows Boot Manager
Boot0001* manjaro
Boot0002* ArchLabs
Boot0003* antergos_grub_vl0n
Boot0004* antergos_grub_dh05
Boot0005* UEFI:CD/DVD Drive
Boot0006* UEFI:Removable Device
Boot0007* UEFI:Network Device
Boot0009* UEFI:Network Device
[mak@jmak-pc ~]$
It doesn't show the old entries because when I rearanged the boot order I left only the active ones on the list. This is a new machine, I've never had experince with efi systems before because my old machine had legacy board. When I experimented with the efibootmgr I've never knew that I will later face issues like this.
Could you instruct me how to delete those entries from the esp partition? How could I make efibootmgr to show all the boot entries?
|
|
|
07-14-2017, 10:14 PM
|
#9
|
Member
Registered: Aug 2005
Posts: 81
Original Poster
Rep:
|
I found an excellent tutorial
https://websetnet.com/remove-ubuntu-...ndows-10-uefi/
which shows a simple way to remove old scrap from the efi partition.
By removing them I managed to free 10Mib disk space.
My efi partition is still close to the limit
Code:
[mak@jmak-pc ~]$ df -h
Filesystem Size Used Avail Use% Mounted on
dev 3.9G 0 3.9G 0% /dev
run 3.9G 9.2M 3.9G 1% /run
/dev/sda8 20G 7.1G 12G 39% /
tmpfs 3.9G 41M 3.8G 2% /dev/shm
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
tmpfs 3.9G 4.0K 3.9G 1% /tmp
/dev/sda2 96M 82M 15M 86% /boot/efi
tmpfs 786M 23M 764M 3% /run/user/1000
overlaid 786M 23M 764M 3% /run/user/1000/mak-chromium
[mak@jmak-pc ~]$
and I still want to implement the second efi partition as I said earlier.
|
|
|
07-15-2017, 01:15 AM
|
#10
|
Member
Registered: Dec 2012
Location: Mauritius
Distribution: Slackware
Posts: 567
|
Hi jozmak,
I do distro hopping too and that, since my MBR days. It is something else to actually install the systems and experiment. But whenever I installed a new distro I didn't let it install its bootloader. Instead, I have a Slackware Linux which I use as my main distro and it holds all my configs for GRUB. I would just update the /boot/grub/grub.cfg each time I installed something new.
Yes, 100MB is a bit small, but a second EFI partition can mess up multi-booting, especially with Windows there. I don't recommend this.
For your current problem, if you need to delete entries from the UEFI registered list of bootloaders, take this example:
Code:
BootCurrent: 0001
Timeout: 6 seconds
BootOrder: 0001,0000,0002,0003,0004,0005,0006,0007
Boot0000* Windows Boot Manager
Boot0001* manjaro
Boot0002* ArchLabs
Boot0003* antergos_grub_vl0n
Boot0004* antergos_grub_dh05
Boot0005* UEFI:CD/DVD Drive
Boot0006* UEFI:Removable Device
Boot0007* UEFI:Network Device
Boot0009* UEFI:Network Device
### I would like to remove bootloader "antergos_grub_dh05", that is Boot0004: ###
> efibootmgr -b 0004 -B
You can read the man pages of efibootmgr for more information.
Concerning all the other bootloaders which are present on the EFI partition but not listed in the output of efibootmgr, they are simply not being used at all. You can safely delete them from the EFI partition.
I will advise that in the future you boot a single instance of GRUB and just add an entry for any newly installed distro to the grub.cfg. Or if you really want to install the "new" bootloader, then you just have to think a bit more and manage the EFI space. With 11 partitions only on the hard disk I don't think you need that many as 19 bootloaders on the EFI partition, so I seriously think the 100MB can be managed.
Last edited by aragorn2101; 07-15-2017 at 01:19 AM.
|
|
|
07-15-2017, 07:48 AM
|
#11
|
Member
Registered: Aug 2005
Posts: 81
Original Poster
Rep:
|
Quote:
Originally Posted by aragorn2101
Hi jozmak,
I do distro hopping too and that, since my MBR days. It is something else to actually install the systems and experiment. But whenever I installed a new distro I didn't let it install its bootloader. Instead, I have a Slackware Linux which I use as my main distro and it holds all my configs for GRUB. I would just update the /boot/grub/grub.cfg each time I installed something new.
Yes, 100MB is a bit small, but a second EFI partition can mess up multi-booting, especially with Windows there. I don't recommend this.
For your current problem, if you need to delete entries from the UEFI registered list of bootloaders, take this example:
Code:
BootCurrent: 0001
Timeout: 6 seconds
BootOrder: 0001,0000,0002,0003,0004,0005,0006,0007
Boot0000* Windows Boot Manager
Boot0001* manjaro
Boot0002* ArchLabs
Boot0003* antergos_grub_vl0n
Boot0004* antergos_grub_dh05
Boot0005* UEFI:CD/DVD Drive
Boot0006* UEFI:Removable Device
Boot0007* UEFI:Network Device
Boot0009* UEFI:Network Device
### I would like to remove bootloader "antergos_grub_dh05", that is Boot0004: ###
> efibootmgr -b 0004 -B
You can read the man pages of efibootmgr for more information.
Concerning all the other bootloaders which are present on the EFI partition but not listed in the output of efibootmgr, they are simply not being used at all. You can safely delete them from the EFI partition.
I will advise that in the future you boot a single instance of GRUB and just add an entry for any newly installed distro to the grub.cfg. Or if you really want to install the "new" bootloader, then you just have to think a bit more and manage the EFI space. With 11 partitions only on the hard disk I don't think you need that many as 19 bootloaders on the EFI partition, so I seriously think the 100MB can be managed.
|
Thanks for the idea.
So I guess I just have to live with this 100M for a while. This is a new machine and it still has 1 year warranty on it. When the warranty expires I plan to remove windows completely, repartition the harddrive creating a large enough efi partition, which I guess will solve these problems.
I tried several times before creating 40_custom boot file in grub.d but I always ended up in failure. Some time ago, I even posted a help request on archlinux forum but they couldn't figure out what was wrong with the 40_custom file. I copied it exactely from the arch wiki page and it still didn't work.
|
|
|
07-15-2017, 11:57 AM
|
#12
|
Member
Registered: Jan 2009
Distribution: Fedora, Gentoo, LFS
Posts: 224
Rep:
|
If you install Windows from an OEM CDROM and partition the hard drive manually, a 100 MiB EFI partition should be enough. On my home built desktop computer, I installed Windows 8 (subsequently upgraded to windows 10) from an OEM CDROM. Microsoft takes up about 24M on the EFI partition. Most Linux distros only use about 120K on the EFI partition. The exceptions are Fedora and CentOS which use about 8M and Ubuntu which uses about 3-6M. My 100MiB EFI partition is only 48% full. It contains Windows and 7 Linux distros.
Things are different on a laptop. My HP laptop has a 260M EFI partition that was already set up by the manufacturer. Microsoft uses 66M and HP 44M. The 7 or so Linux distros that I have on it do not take up much space. It is 53% full, mostly junk from Microsoft and HP.
From a Linux perspective, you can have more than one EFI partition per hard drive. The problem is when you try to update Windows, the process may hang if you have more than one EFI partition.
If I were you, I would back up the EFI partition using Clonezilla or some other product, and do an internet search on how to remove unnecessary Microsoft and laptop manufacturer files from the EFI. If the laptop then becomes unbootable, you can always restore the original ESP.
|
|
|
07-15-2017, 12:33 PM
|
#13
|
Member
Registered: Dec 2012
Location: Mauritius
Distribution: Slackware
Posts: 567
|
Quote:
Originally Posted by jozmak
I tried several times before creating 40_custom boot file in grub.d but I always ended up in failure. Some time ago, I even posted a help request on archlinux forum but they couldn't figure out what was wrong with the 40_custom file. I copied it exactely from the arch wiki page and it still didn't work.
|
Editing 40_custom to add distro menu entries is a bad idea.
Let's say you have a main distro, then from within your main distro you update grub like this:
Code:
grub-mkconfig -o /boot/grub/grub.cfg
It should detect all the distros you have on your machine and add an entry for them in the config file.
|
|
|
07-15-2017, 01:47 PM
|
#14
|
Member
Registered: Aug 2005
Posts: 81
Original Poster
Rep:
|
Quote:
Originally Posted by plasmonics
If you install Windows from an OEM CDROM and partition the hard drive manually, a 100 MiB EFI partition should be enough. On my home built desktop computer, I installed Windows 8 (subsequently upgraded to windows 10) from an OEM CDROM. Microsoft takes up about 24M on the EFI partition. Most Linux distros only use about 120K on the EFI partition. The exceptions are Fedora and CentOS which use about 8M and Ubuntu which uses about 3-6M. My 100MiB EFI partition is only 48% full. It contains Windows and 7 Linux distros.
Things are different on a laptop. My HP laptop has a 260M EFI partition that was already set up by the manufacturer. Microsoft uses 66M and HP 44M. The 7 or so Linux distros that I have on it do not take up much space. It is 53% full, mostly junk from Microsoft and HP.
From a Linux perspective, you can have more than one EFI partition per hard drive. The problem is when you try to update Windows, the process may hang if you have more than one EFI partition.
If I were you, I would back up the EFI partition using Clonezilla or some other product, and do an internet search on how to remove unnecessary Microsoft and laptop manufacturer files from the EFI. If the laptop then becomes unbootable, you can always restore the original ESP.
|
Hi plasmonics,
Here is the EFI partition content:
Code:
[mak@jmak-pc EFI]$ ls
antergos_grub_vl0n ArchLabs archLXQT_2 Boot Dell grub Manjaro Microsoft
[mak@jmak-pc EFI]$
In the Dell directory there is only two items a bios recovery file and a small log file. That's all.
The Microsoft directory on the other hand, full of language files and directories. Those are the ones that take up most of the space.
But I don't dare to touch any of those because I have no good understanding what are their functions.
This is the content of the Microsoft/Boot directory:
Code:
[mak@jmak-pc Boot]$ ls
BCD da-DK fr-CA kd_02_15b3.dll memtest.efi sk-SK
BCD.LOG de-DE fr-FR kd_02_1969.dll nb-NO sl-SI
BCD.LOG1 el-GR hr-HR kd_02_19a2.dll nl-NL sr-Latn-CS
BCD.LOG2 en-GB hu-HU kd_02_8086.dll pl-PL sr-Latn-RS
bg-BG en-US it-IT kd_07_1415.dll pt-BR sv-SE
bootmgfw.efi es-ES ja-JP kd_0C_8086.dll pt-PT tr-TR
bootmgr.efi es-MX kd_02_10df.dll kdstub.dll qps-ploc uk-UA
BOOTSTAT.DAT et-EE kd_02_10ec.dll ko-KR Resources zh-CN
boot.stl fi-FI kd_02_1137.dll lt-LT ro-RO zh-HK
cs-CZ Fonts kd_02_14e4.dll lv-LV ru-RU zh-TW
[mak@jmak-pc Boot]$
Last edited by jozmak; 07-15-2017 at 01:59 PM.
|
|
|
07-16-2017, 11:10 AM
|
#15
|
Member
Registered: Jan 2009
Distribution: Fedora, Gentoo, LFS
Posts: 224
Rep:
|
Assuming that your EFI partition is mounted at /boot/efi, you can try the following to see which application is taking up the space:
Code:
cd /boot/efi
du -h .
|
|
|
All times are GMT -5. The time now is 11:44 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|