You are not logged in.

#1 2021-01-13 18:22:38

Xwang
Member
Registered: 2012-05-14
Posts: 236

[Solved] Boot partition with only 16MB of free space and dual boot.

Hi,
today I've got the warning that /boot ha only 16Mb of free space.
This is how my primary hdd is parted and as you can see it has an UEFI dual boot with windows 10.
Screenshot-20210113-190743.png
Is it safe to move all the partitions to the end of the disk?
Otherwise can I create a new /boot EFI partition using the not allocated space (439 MB) after sda5?
If nothing is possible, since I have both linux and linux-lts installed in grub, can I save space removing their failback images (I have never used them).

Last edited by Xwang (2021-01-14 16:27:19)


I'm still learning English so please excuse me if my English is not good enough and feel free to correct me via PM if you want.

Offline

#2 2021-01-13 18:28:07

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,061

Re: [Solved] Boot partition with only 16MB of free space and dual boot.

You could also use grub and store the kernel somewhere else than on the esp.


Evil #archlinux@freenode channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#3 2021-01-13 18:31:24

Xwang
Member
Registered: 2012-05-14
Posts: 236

Re: [Solved] Boot partition with only 16MB of free space and dual boot.

Mr.Elendig wrote:

You could also use grub and store the kernel somewhere else than on the esp.

I'm already using grub, but it is "installed" in the boot folder with all the images.

Last edited by Xwang (2021-01-13 18:31:36)


I'm still learning English so please excuse me if my English is not good enough and feel free to correct me via PM if you want.

Offline

#4 2021-01-13 18:47:05

Ropid
Member
Registered: 2015-03-09
Posts: 952

Re: [Solved] Boot partition with only 16MB of free space and dual boot.

Xwang wrote:
Mr.Elendig wrote:

You could also use grub and store the kernel somewhere else than on the esp.

I'm already using grub, but it is "installed" in the boot folder with all the images.

Yeah, you would have to change your setup so that "/boot" isn't /dev/sda1 anymore, instead sda1 you mount to something like "/efi", and you turn /boot into just a normal folder inside "/" (/dev/sda5). I'm not sure how to do this kind of change.

Offline

#5 2021-01-13 20:16:10

Xwang
Member
Registered: 2012-05-14
Posts: 236

Re: [Solved] Boot partition with only 16MB of free space and dual boot.

This is the output of sudo fdisk -l /dev/sda:

 
Disk /dev/sda: 238,47 GiB, 256060514304 bytes, 500118192 sectors
Disk model: HFS256G39MND-230
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: A5768815-48AF-468F-9953-E3026E6F572B

Dispositivo     Start      Fine   Settori   Size Tipo
/dev/sda1        2048    534527    532480   260M EFI System
/dev/sda2      534528    567295     32768    16M Microsoft reserved
/dev/sda3      567296 158642467 158075172  75,4G Microsoft basic data
/dev/sda4   158644224 159821823   1177600   575M Windows recovery environment
/dev/sda5   159823872 499095551 339271680 161,8G Linux filesystem

and following what this wiki page https://wiki.archlinux.org/index.php/EF … _partition I have simply mounted the sda1 as /boot (as explained in https://wiki.archlinux.org/index.php/EF … partition) since when I installed archlinux on this PC back in 2016.
If I have understood correctly it should be possible to do the following:
1) sudo mkdir /efi
2) create a new FAT32 partition /dev/sda6 in the 499MB free space to be used as new boot partition
3) umount /boot and remount to /dev/sda6
4) mount /dev/sda1 as /efi
5) change /etc/fstab from this one:

# 
# /etc/fstab: static file system information
#
# <file system> <dir>   <type>  <options>       <dump>  <pass>
# /dev/sda5 UUID=74296c4e-84df-4eda-87a1-09be9d8e114b
LABEL=ArchRootSSD       /               ext4            rw,relatime,data=ordered        0 1

# /dev/sdc1 UUID=dca8b900-5a1a-4d64-b193-9194d4b214ff
LABEL=ArchDataSSD       /home           ext4            rw,relatime,data=ordered        0 2

# /dev/sdb1 UUID=91e93ef5-a6c7-45c9-94a9-90497f48754d
LABEL=ArchDataHDD       /dataBackup     ext4            rw,relatime,data=ordered        0 2

# /dev/sda1 UUID=F0D6-7769
LABEL=SYSTEM            /boot           vfat            rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro        0 2

/swapfile none swap defaults 0 0

to this one:

# 
# /etc/fstab: static file system information
#
# <file system> <dir>   <type>  <options>       <dump>  <pass>
# /dev/sda5 UUID=74296c4e-84df-4eda-87a1-09be9d8e114b
LABEL=ArchRootSSD       /               ext4            rw,relatime,data=ordered        0 1

# /dev/sdc1 UUID=dca8b900-5a1a-4d64-b193-9194d4b214ff
LABEL=ArchDataSSD       /home           ext4            rw,relatime,data=ordered        0 2

# /dev/sdb1 UUID=91e93ef5-a6c7-45c9-94a9-90497f48754d
LABEL=ArchDataHDD       /dataBackup     ext4            rw,relatime,data=ordered        0 2

# /dev/sda1 UUID=F0D6-7769
LABEL=SYSTEM            /efi           vfat            rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro        0 2

# /dev/sda6
LABEL=SYSTEM            /boot           vfat            rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro        0 2

/swapfile none swap defaults 0 0

6) reinstall grub (and check that it is written to /dev/sda6
7) cross my fingers
8) reboot

Is it correct?
Should /dev/sda6 be a FAT32 in order to have the dual booting with windows 10 still working or can it be ext2?
Is the new fstab correct?


I'm still learning English so please excuse me if my English is not good enough and feel free to correct me via PM if you want.

Offline

#6 2021-01-13 21:36:59

Ropid
Member
Registered: 2015-03-09
Posts: 952

Re: [Solved] Boot partition with only 16MB of free space and dual boot.

Xwang wrote:

[...]
2) create a new FAT32 partition /dev/sda6 in the 499MB free space to be used as new boot partition
[...]

No, the idea about grub was that you do not need a boot partition at all. You can keep your current EFI partition and you do not need to create a new partition.

Grub has its own drivers for ext4 filesystems and can load the kernel image from your "/" filesystem. You can then have only grub inside your EFI partition with the kernel files moved onto your "/" partition.

I mean concretely, you would do something along these lines here:

mkdir /newboot   # this new directory exists inside your "/" ext4 filesystem
cp -a /boot/. /newboot/.
umount /boot
rmdir /boot
mv /newboot /boot

mkdir /efi
mount /dev/sda1 /efi
rm /efi/vmlinuz* /efi/initramfs*

# (1) fix fstab so that it mounts sda1 to /efi instead of /boot

# (2) fix the grub config so that it searches the kernel image
#     inside "/" instead of the EFI partition

The problem is that I do not know how to do point (2) in this list. I don't know how to fix the grub config.

Last edited by Ropid (2021-01-13 21:40:57)

Offline

#7 2021-01-13 23:17:37

Xwang
Member
Registered: 2012-05-14
Posts: 236

Re: [Solved] Boot partition with only 16MB of free space and dual boot.

 sudo mkinitcpio -P 

should recreate the initramfs image in /boot  and

 sudo grub-mkconfig -o /boot/grub/grub.cfg 

should recreate the /boot/grub.conf and the grub menu
Is it correct?
Moreover if it is not an issue, I would like to keep the /boot partition separate from / and so I'm still wondering if I can use the 499MB free space to create a new partition to mount as /boot instead of the newboot folder that you sugested above.


I'm still learning English so please excuse me if my English is not good enough and feel free to correct me via PM if you want.

Offline

#8 2021-01-14 00:10:40

kermit63
Member
Registered: 2018-07-04
Posts: 56

Re: [Solved] Boot partition with only 16MB of free space and dual boot.

Xwang wrote:

Should /dev/sda6 be a FAT32 in order to have the dual booting with windows 10 still working or can it be ext2?

It doesn't have to be FAT32 since Windows 10 doesn't use the /boot partition at all.

Regarding your new /etc/fstab:
Your entry for the new /boot partition (/dev/sda6) is incorrect. It should be the label of the new partition your created. Better yet, it may be a good idea to use UUID instead of LABEL to direct GRUB to specific partitions in your system. For example your /boot partition can be:

UUID=UUID-of-the-boot-partition            /boot           ext4            rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro        0 2

NOTE:
1. I replaced FAT32 with ext4. It can be ext2 if that is your preference.
2. replace UUID-of-the-boot-partition with the actual UUID. You can find out the UUID by using the "#blkid" command.

Xwang wrote:

so I'm still wondering if I can use the 499MB free space to create a new partition to mount as /boot i

Yes, you can. You have to copy or move the grub folder from your efi partition, as well as the initramfs, vmlinuz and ucode image files to the new /boot partition.

It is more conservative to copy first before removing these files from the efi partition so you can check if your new setup is working. If not you can revert back to your previous setup.

EDIT: I noticed you're using relatiime instead of noatime as argument in your /etc/fstab. I'm no expert, but I think noatime suits SSD drives better since it minimizes writes to the disk. However, if you search the internet, opinions vary whether it really helps. In the end it's up to you.

Last edited by kermit63 (2021-01-14 03:40:42)

Offline

#9 2021-01-14 07:48:43

Xwang
Member
Registered: 2012-05-14
Posts: 236

Re: [Solved] Boot partition with only 16MB of free space and dual boot.

kermit63 wrote:
Xwang wrote:

Should /dev/sda6 be a FAT32 in order to have the dual booting with windows 10 still working or can it be ext2?

It doesn't have to be FAT32 since Windows 10 doesn't use the /boot partition at all.

Regarding your new /etc/fstab:
Your entry for the new /boot partition (/dev/sda6) is incorrect. It should be the label of the new partition your created. Better yet, it may be a good idea to use UUID instead of LABEL to direct GRUB to specific partitions in your system. For example your /boot partition can be:

UUID=UUID-of-the-boot-partition            /boot           ext4            rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro        0 2

NOTE:
1. I replaced FAT32 with ext4. It can be ext2 if that is your preference.
2. replace UUID-of-the-boot-partition with the actual UUID. You can find out the UUID by using the "#blkid" command.

Xwang wrote:

so I'm still wondering if I can use the 499MB free space to create a new partition to mount as /boot i

Yes, you can. You have to copy or move the grub folder from your efi partition, as well as the initramfs, vmlinuz and ucode image files to the new /boot partition.

It is more conservative to copy first before removing these files from the efi partition so you can check if your new setup is working. If not you can revert back to your previous setup.

EDIT: I noticed you're using relatiime instead of noatime as argument in your /etc/fstab. I'm no expert, but I think noatime suits SSD drives better since it minimizes writes to the disk. However, if you search the internet, opinions vary whether it really helps. In the end it's up to you.

You are right about the wrong label. I will write the correct one, but I prefer labels to UUID.
Regarding relatime , I'm using it because it seems a comprimise and I do not want to have "strange" problems with programs which act as mutt (from fstab wiki "When using Mutt or other applications that need to know if a file has been read since the last time it was modified, the noatime option should not be used; using the relatime option is acceptable and still provides a performance improvement. ").

# 
# /etc/fstab: static file system information
#
# <file system> <dir>   <type>  <options>       <dump>  <pass>
# /dev/sda5 UUID=74296c4e-84df-4eda-87a1-09be9d8e114b
LABEL=ArchRootSSD       /               ext4            rw,relatime,data=ordered        0 1

# /dev/sdc1 UUID=dca8b900-5a1a-4d64-b193-9194d4b214ff
LABEL=ArchDataSSD       /home           ext4            rw,relatime,data=ordered        0 2

# /dev/sdb1 UUID=91e93ef5-a6c7-45c9-94a9-90497f48754d
LABEL=ArchDataHDD       /dataBackup     ext4            rw,relatime,data=ordered        0 2

# /dev/sda1 UUID=F0D6-7769
LABEL=SYSTEM            /efi           vfat            rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro        0 2

# /dev/sda6 UUID=305d04f0-7318-4915-a240-a24b764dc84f
LABEL=BOOTGRUB            /boot           ext4            rw,relatime,data=ordered         0 2

/swapfile none swap defaults 0 0

What is the difference between copying grub folder from your efi partition, as well as the initramfs, vmlinuz and ucode image files to the new /boot partition and simply reinstalling grub to the new /boot partition using the grub-install command?


I'm still learning English so please excuse me if my English is not good enough and feel free to correct me via PM if you want.

Offline

#10 2021-01-14 08:08:06

kermit63
Member
Registered: 2018-07-04
Posts: 56

Re: [Solved] Boot partition with only 16MB of free space and dual boot.

Xwang wrote:

What is the difference between copying grub folder from your efi partition, as well as the initramfs, vmlinuz and ucode image files to the new /boot partition and simply reinstalling grub to the new /boot partition using the grub-install command?

Reinstalling grub using grub-install will work if you prefer to go that route. In fact, it may be a better option than copying. The only reason I suggested copying is a lot of users are uncomfortable using the grub-install command since they don't understand the parameters they needed to set to make it work. If you are comfortable with it, then by all means, go for it.

Offline

#11 2021-01-14 14:04:03

Xwang
Member
Registered: 2012-05-14
Posts: 236

Re: [Solved] Boot partition with only 16MB of free space and dual boot.

First of all thank you to all for your help.
I've almost ready to try a restart.
Grub has been reinstalled in the /dev/sda6 ext4 BOOTGRUB partition mounted as /boot
/dev/sda1 has been mounted as /efi
All initramfs have been recreated in /boot and grub.cfg has been updated.
/etc/fstab has been modified accordngly.

However I've seen that in the /efi dir there are these files:
├── EFI
│   ├── arch_grub
│   │   └── grubx64.efi    created 30/03/2016
│   ├── Boot
│   │   └── bootx64.efi     created today
│   └── Microsoft
│       ├── Boot

why is grubx64.efi so old (that is the date I first installed archlinux on this PC.
Should I update/refresh it somehow?


I'm still learning English so please excuse me if my English is not good enough and feel free to correct me via PM if you want.

Offline

#12 2021-01-14 14:17:59

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 11,800

Re: [Solved] Boot partition with only 16MB of free space and dual boot.

You need to grub-install into the ESP to update that https://wiki.archlinux.org/index.php/GRUB#UEFI_systems the folder name is determined by the passed id.

The separate bootgrub partition wouldn't have been necessary but if you use it and have it mounted and consequently add kernel images there then you could retain it.

Last edited by V1del (2021-01-14 14:21:38)

Offline

#13 2021-01-14 14:21:21

Xwang
Member
Registered: 2012-05-14
Posts: 236

Re: [Solved] Boot partition with only 16MB of free space and dual boot.

V1del wrote:

You need to grub-install into the ESP to update that https://wiki.archlinux.org/index.php/GRUB#UEFI_systems the folder name is determined by the passed id.

But I've just installed grub using this command:

grub-install --target=x86_64-efi --efi-directory=/efi --removable --bootloader-id=GRUB --boot-directory=/boot

and mounted esp as /efi, so it seem like I've to remove that  grubx64.efi and the arch_grub directory instead. Is it correct?

If I install grub into the ESP I'm back in the initial situation with the ESP partition full.

Last edited by Xwang (2021-01-14 14:23:41)


I'm still learning English so please excuse me if my English is not good enough and feel free to correct me via PM if you want.

Offline

#14 2021-01-14 14:24:58

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 11,800

Re: [Solved] Boot partition with only 16MB of free space and dual boot.

You're not, GRUB the binary that you want to have on your ESP / /efi is 133KB in size. That's what that command installs.

What is eating your space are kernel images, but you can keep those on /boot (which can be on your root partition or this separate /boot partition that doesn't really matter)

Yes you can remove the old arch_grub entry in that case.

Last edited by V1del (2021-01-14 14:26:27)

Offline

#15 2021-01-14 14:27:52

Xwang
Member
Registered: 2012-05-14
Posts: 236

Re: [Solved] Boot partition with only 16MB of free space and dual boot.

V1del wrote:

You're not, GRUB the binary that you want to have on your ESP / /efi is 133KB in size. That's what that command installs.

What is eating your space are kernel images, but you can keep those on /boot (which can be on your root partition or this separate /boot partition that doesn't really matter)

Ok so, if I have understood correctly, I have done all the needed, but what about that old grubx64.efi file which is 113.5KB and was created in the 2016? Can I safely delete it?


I'm still learning English so please excuse me if my English is not good enough and feel free to correct me via PM if you want.

Offline

#16 2021-01-14 14:30:34

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 11,800

Re: [Solved] Boot partition with only 16MB of free space and dual boot.

You should be able to yes, maybe verify with

efibootmgr -vu

which actual entries your UEFI currently references.

Offline

#17 2021-01-14 14:34:27

Xwang
Member
Registered: 2012-05-14
Posts: 236

Re: [Solved] Boot partition with only 16MB of free space and dual boot.

V1del wrote:

You should be able to yes, maybe verify with

efibootmgr -vu

which actual entries your UEFI currently references.

efibootmgr -v -u
BootCurrent: 0002
Timeout: 1 seconds
BootOrder: 0002,0001,0004,0000,0003,0005,0006
Boot0000* Windows Boot Manager  VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb)䥗䑎坏S
Boot0001* Windows Boot Manager  HD(1,GPT,e01f44ba-0ef8-4818-b47d-80bf6b4a6b7c,0x800,0x82000)/File(\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI)䥗䑎坏S
Boot0002* arch_grub     HD(1,GPT,e01f44ba-0ef8-4818-b47d-80bf6b4a6b7c,0x800,0x82000)/File(\EFI\ARCH_GRUB\GRUBX64.EFI)
Boot0003* UEFI:CD/DVD Drive     BBS(129,,0x0)
Boot0004* Windows Boot Manager  VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb)䥗䑎坏S
Boot0005* UEFI:Removable Device BBS(130,,0x0)
Boot0006* UEFI:Network Device   BBS(131,,0x0)

It seems as if it is referncing to the old GRUBX64.EFI, why?
With the command I've posted before I thought to have followed what is written in the wiki: https://wiki.archlinux.org/index.php/GR … allation_2

Last edited by Xwang (2021-01-14 14:37:24)


I'm still learning English so please excuse me if my English is not good enough and feel free to correct me via PM if you want.

Offline

#18 2021-01-14 14:42:54

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 11,800

Re: [Solved] Boot partition with only 16MB of free space and dual boot.

Ah you used the --removable flag, that will not adjust EFI variables. If you run it without --removable you should get a proper entry.

Offline

#19 2021-01-14 14:51:02

Xwang
Member
Registered: 2012-05-14
Posts: 236

Re: [Solved] Boot partition with only 16MB of free space and dual boot.

V1del wrote:

Ah you used the --removable flag, that will not adjust EFI variables. If you run it without --removable you should get a proper entry.

I've executed again without --removable and now

efibootmgr -v -u
BootCurrent: 0002
Timeout: 1 seconds
BootOrder: 0002,0001,0004,0000,0003,0005,0006
Boot0000* Windows Boot Manager  VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb)䥗䑎坏S
Boot0001* Windows Boot Manager  HD(1,GPT,e01f44ba-0ef8-4818-b47d-80bf6b4a6b7c,0x800,0x82000)/File(\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI)䥗䑎坏S
Boot0002* GRUB  HD(1,GPT,e01f44ba-0ef8-4818-b47d-80bf6b4a6b7c,0x800,0x82000)/File(\EFI\GRUB\grubx64.efi)
Boot0003* UEFI:CD/DVD Drive     BBS(129,,0x0)
Boot0004* Windows Boot Manager  VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb)䥗䑎坏S
Boot0005* UEFI:Removable Device BBS(130,,0x0)
Boot0006* UEFI:Network Device   BBS(131,,0x0)

and the GRUB directory has been created in the EFI dir

├── arch_grub
│   └── grubx64.efi created 30/03/2016
├── Boot
│   └── bootx64.efi
├── GRUB
│   └── grubx64.efi  created today
└── Microsoft
    ├── Boot

Can I now delete the arch_grub folder?
Should I execute
sudo mkinitcpio -P
and
sudo grub-mkconfig -o /boot/grub/grub.cfg
again?


I'm still learning English so please excuse me if my English is not good enough and feel free to correct me via PM if you want.

Offline

#20 2021-01-14 16:26:46

Xwang
Member
Registered: 2012-05-14
Posts: 236

Re: [Solved] Boot partition with only 16MB of free space and dual boot.

Ok problem solved.
Thanks to all for you help!!!


I'm still learning English so please excuse me if my English is not good enough and feel free to correct me via PM if you want.

Offline

Board footer

Powered by FluxBB