Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How does the /boot/ and /efi partitions work?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
AspieHacker
n00b
n00b


Joined: 10 Apr 2017
Posts: 2
Location: Iowa

PostPosted: Tue Apr 11, 2017 4:30 pm    Post subject: How does the /boot/ and /efi partitions work? Reply with quote

Okay so I have been working on my gentoo installation for about a week now and I am finally at the installing the bootloader stage. I am getting really confused about how the /boot partition and the /efi partition work so could someone please help me understand what is going on here thank you. I would like to apologize for the lack of complete sentences, but I think in lots of abstract pictures so sentences can be somewhat hard for me to form, down below is some information on what I have done and hopefully a little more helpful.

What I had first

/dev/sda1 grub bios_grub 1mib to 3mib
/dev/sda2 /boot ext2 boot boot, esp 3mib to 131mib
/dev/sda3 none swap swap 131mib to 643mib
/dev/sda4 / ext4 rootfs 643mib to 228932mib
out of 457863mib

What I changed it to

/dev/sda1 /boot vfat boot boot, esp 3mib to 131mib
/dev/sda2 none swap swap 131mib to 643mib
/dev/sda3 / ext4 rootfs 643mib to 228932mib
out of 457863mib

What I'm wondering?

How should /efi be attached to the system?

Like this?

/dev/sda1=/efi
/dev/sda2=/boot
/dev/sda3=/swap
/dev/sda4=/root

(/root/)
/mnt/gentoo/boot/efi
where /efi is attach to sda1 and mounted to /sda2 (/boot)

or like this?

/dev/sda2=/boot /efi is like an extended partition of boot
/dev/sda3=/swap
/dev/sda4=/root

(/root/)
/mnt/gentoo/boot/efi

or would it be like /proc/?

These are just some things I am wondering and I would just like to understand what is going on here? So please comment if you think you can help. Also I know I probably left some information out so if I did just ask thank you.
Back to top
View user's profile Send private message
Logicien
Veteran
Veteran


Joined: 16 Sep 2005
Posts: 1555
Location: Montréal

PostPosted: Tue Apr 11, 2017 6:39 pm    Post subject: Reply with quote

You can use only one partition for both boot and efi. This partition must have the Efi System ID, be formated in Fat and must cover the size of the boot and efi data who will go there. You mount this partition in the /boot directory of the root partition and it will have a double purpose.

By default, the boot partition is mounted in the /boot directory and the efi one in /boot/efi, all from the root directory /.
_________________
Paul
Back to top
View user's profile Send private message
AspieHacker
n00b
n00b


Joined: 10 Apr 2017
Posts: 2
Location: Iowa

PostPosted: Wed Apr 12, 2017 12:16 am    Post subject: Reply with quote

Okay I think I know what is happening I am getting partitions and directories mixed up with each other. So this might seem kind of basic to you down below, but I am just trying to fit the details together so I can understand this better.

    Directories
  • root (/mnt/gentoo)
  • boot
  • efi
  • swap
  • proc
  • sys
  • dev


    Partitions
  • /dev/sda1
  • /dev/sda2
  • /dev/sda3


/dev/sda3 mounts on to /mnt/gentoo
which is essentially an empty box

which makes the directories /boot, /swap, /proc, /sys, and /dev
boxes within /mnt/gentoo

which therefore would make the efi directory a box within /boot within /mnt/gentoo.

So /dev/sda1 will be mounted onto two places on the file system. Through /boot
and /efi. Okay I think I got it now thank you for the help. If I am wrong about anything just tell me thanks again.
Back to top
View user's profile Send private message
Roman_Gruber
Advocate
Advocate


Joined: 03 Oct 2006
Posts: 3846
Location: Austro Bavaria

PostPosted: Wed Apr 12, 2017 1:57 pm    Post subject: Reply with quote

Quote:
Directories
root (/mnt/gentoo)


when you use a live-cd you can mount your later root partition ( / ) to any desired mount-point. e.g. mount pint /mnt/gentoo

root is usually /

pay attention that some live-cds have already some directories in use. e.g. sysrescue-cd (oct 2015) has not an empty /boot for example.

--

Quote:
which makes the directories /boot, /swap, /proc, /sys, and /dev
boxes within /mnt/gentoo


swap is lint basically in my point of view with boxes with 4gb or more. this depends on the software usuage too

/Swap + /proc + /dev => they serve a special function

You can add later swap when you have a need for that.

i love those installations with 8gb or 16gb / 32gb of ram with "double ram size" swap partitions which are hardly ever used.

i took the luxuary to get 16gb of ram, 8gb of ram are far more than enough for a desctop linux box with average software.

Please read this:
https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard

there is also a bigger document as the minimal version of the wiki

--

/boot/efi is something special. i also have seen different writings like /boot/EFI /boot/EFI/efi /boot/efi/EFI => I assume it is related to the bootloader and the bootlaoder scripts. I also assume that you map (marry) the "uefi bios" to the device with the usuage of /boot/efi (which could be anything which is allowed by those scripts => e.g. grub2-install ... --directory(or what is called) ....)
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21631

PostPosted: Thu Apr 13, 2017 1:23 am    Post subject: Reply with quote

In most cases, no explicit swap file/directory is necessary. Swap is required for hibernation. OP has not told us the age of the system nor its RAM size, so we cannot know whether he has sufficient RAM that swap will be unnecessary for daily usage.
Back to top
View user's profile Send private message
Fitzcarraldo
Advocate
Advocate


Joined: 30 Aug 2008
Posts: 2034
Location: United Kingdom

PostPosted: Thu Apr 13, 2017 11:53 am    Post subject: Reply with quote

Yes, there are many factors and variables. A couple of weeks ago I was working on some very large spreadsheets on my old Compal NBLB2 laptop which had 4GB RAM and 4GB swap partition. Half or more of the swap partition was being used. So I increased the laptop's RAM to 8GB and swap is no longer being used.
_________________
Clevo W230SS: amd64, VIDEO_CARDS="intel modesetting nvidia".
Compal NBLB2: ~amd64, xf86-video-ati. Dual boot Win 7 Pro 64-bit.
OpenRC udev elogind & KDE on both.

Fitzcarraldo's blog
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7651
Location: Goose Creek SC

PostPosted: Thu Apr 13, 2017 2:42 pm    Post subject: Reply with quote

if you are to use UEFI you must have an EFI System Partition (ESP) formatted in a vfat file system (for maximum probability of motherboard compatibility in FAT32). The only time the ESP needs to be attached to the file system is when some change is to be made to the ESP. The ESP may be mounted to any convenient directory (mount point) in the file system. In various documents in the gentoo wiki; /boot, /boot/efi, /boot/EFI, /mnt/efi, and /mnt/EFI . If my memory serves, / is also recommended somewhere. Limitations: you need to know where you mounted it before you can change anything on the ESP. If the file structure of the ESP is non standard as results from using the gentoo handbook you will need to know/determine the structure (standard first directory is \EFI in the uefi spec, /boot in the handbook).
_________________
Defund the FCC.


Last edited by DONAHUE on Sat Apr 15, 2017 6:01 pm; edited 1 time in total
Back to top
View user's profile Send private message
Fitzcarraldo
Advocate
Advocate


Joined: 30 Aug 2008
Posts: 2034
Location: United Kingdom

PostPosted: Thu Apr 13, 2017 4:56 pm    Post subject: Reply with quote

Logicien wrote:
You can use only one partition for both boot and efi. This partition must have the Efi System ID, be formated in Fat and must cover the size of the boot and efi data who will go there. You mount this partition in the /boot directory of the root partition and it will have a double purpose.

By default, the boot partition is mounted in the /boot directory and the efi one in /boot/efi, all from the root directory /.

Not that it relates to Gentoo, but I noticed the Installers for the two binary distributions I recently installed do not allow this. They both insisted on the EFI partition with /boot/efi being a separate partition to the partition containing /boot with the kernel images and GRUB.
_________________
Clevo W230SS: amd64, VIDEO_CARDS="intel modesetting nvidia".
Compal NBLB2: ~amd64, xf86-video-ati. Dual boot Win 7 Pro 64-bit.
OpenRC udev elogind & KDE on both.

Fitzcarraldo's blog
Back to top
View user's profile Send private message
steveL
Watchman
Watchman


Joined: 13 Sep 2006
Posts: 5153
Location: The Peanut Gallery

PostPosted: Sat Apr 15, 2017 5:50 pm    Post subject: Reply with quote

AspieHacker, you already have a merged /boot and ESP, so there is no need to "attach /efi" anywhere.
It's a little small, but you seem to be installed (grub takes quite a lot of space in /boot/grub, mind.)

If you did have a separate (FAT32) ESP and (eg ext2) /boot, then you would attach the ESP at /boot/efi.
But you don't, so don't worry about it.

(You can only separate now, by repartitioning, which isn't worth it. It would mean reinstalling.)

Simply adjust paths you see (in documentation) under /boot/efi/EFI to use /boot/EFI instead.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum