View previous topic :: View next topic |
Author |
Message |
ygmedusa n00b
Joined: 03 Sep 2021 Posts: 3 Location: Germany
|
Posted: Fri Sep 03, 2021 9:24 pm Post subject: Correct partitioning for Gentoo Installation |
|
|
Hello Gentoo Forums,
I was wondering what the correct partitioning for the various drives was. I intend to boot via UEFI with a GPT disk (a GEN4 NVMe to be exact). The general manual https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Disks (under "Default partitioning scheme") requires three different partitions which I of course strictly followed for my installation. However today I saw the page "Quick Installation Checklist" https://wiki.gentoo.org/wiki/Quick_Installation_Checklist which says that for a UEFI/GPT setup you should set up four different partitions. Is this going to affect my installation? Or is the four-partition setup simply the better one for performance? And regardless of the performance impact of either setup, should I go through the trouble of re-setting things up?
Thank you very much in advance![/url] |
|
Back to top |
|
|
alamahant Advocate
Joined: 23 Mar 2019 Posts: 3916
|
Posted: Fri Sep 03, 2021 9:34 pm Post subject: |
|
|
The 4 partition set up is best
Code: |
/
swap
/boot
/boot/efi
|
I always use this setup and never had a problem.
Plus you have your kernels initrds and grub related stuff on an ext4 (or other) /boot partition.
And you only have the efi binaries in /boot/efi which you can mount "noauto" in fstab
I know that the Wiki proposes a three partition setup(most of the time).
Its up to you. _________________
Last edited by alamahant on Fri Sep 03, 2021 9:38 pm; edited 1 time in total |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54577 Location: 56N 3W
|
Posted: Fri Sep 03, 2021 9:36 pm Post subject: |
|
|
ygmedusa,
Welcome to Gentoo.
Its a long story of how the PC got to where it is today. Its here, if you want the history lesson.
The short version in that four partitions are only required when you are trying to BIOS boot with a GPT disk label.
Three partitions works for UEFI with a GPT disk label and BIOS booting with an MSDOS disk label.
BIOS booting with a GPT disk label is becoming more and more unsupported on systems with UEFI FIrmware, so it should be avoided. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
Tony0945 Watchman
Joined: 25 Jul 2006 Posts: 5127 Location: Illinois, USA
|
Posted: Fri Sep 03, 2021 10:22 pm Post subject: |
|
|
NeddySeagoon wrote: |
Three partitions works for UEFI with a GPT disk label and BIOS booting with an MSDOS disk label. |
Two partitions, /boot/efi and / also work is you use a swap file or have lots of RAM.
But, my main point is that a separate /boot is not required and is only required on really old hardware, i.e. more than 15 years old.
I maintain that storing kernels on a FAT partition is a bad idea. Only the EFI booter, i.e. refind, grub2, or a single EFI stub kernel, need to be on the efi partition. If we could have ext4 partitions or even NTFS, that would be a different story. |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54577 Location: 56N 3W
|
Posted: Fri Sep 03, 2021 10:42 pm Post subject: |
|
|
Tony0945,
You will be OK without a /boot partition until you get your first HDD bigger than 128 PiB.
Then the race between hard drive sizes and what the firmware can read resumes again.
I think that's a good few years off yet. :) _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
alamahant Advocate
Joined: 23 Mar 2019 Posts: 3916
|
Posted: Fri Sep 03, 2021 10:50 pm Post subject: |
|
|
Tony0945
Quote: |
I maintain that storing kernels on a FAT partition is a bad idea. Only the EFI booter, i.e. refind, grub2, or a single EFI stub kernel, need to be on the efi partition. If we could have ext4 partitions or even NTFS, that would be a different story
|
Isnt it thats why a separate /boot is needed?
I also dont like my kernels and initrds on vfat.
So I need a separate /boot and a /boot/efi.
What would the alternative be?
/boot as a dir of / ?
Is it even bootable?
And if one runs lvm or luks?
I will always go with separate /boot and /boot/efi.
I think its a matter of preference.
_________________
|
|
Back to top |
|
|
Tony0945 Watchman
Joined: 25 Jul 2006 Posts: 5127 Location: Illinois, USA
|
Posted: Fri Sep 03, 2021 11:00 pm Post subject: |
|
|
alamahant wrote: |
Isnt it thats why a separate /boot is needed?
I also dont like my kernels and initrds on vfat.
So I need a separate /boot and a /boot/efi.
I will always go with separate /boot and /boot/efi.
I think its a matter of preference.
|
Purely preference between /boot and / , yes. But why do you want a separate partition with the same filesystem unless /root is encrypted.
I could have put my bedrooms in a separate building from the rest of my house but it makes little or no sense.
Separate /boot came about when disk space grew larger than BIOS' could read. That's no longer true and hasn't been for a long time.
There are still edge cases for separate /boot, but I don't thonk it should be offered as the preferred or recommended setup. |
|
Back to top |
|
|
alamahant Advocate
Joined: 23 Mar 2019 Posts: 3916
|
Posted: Fri Sep 03, 2021 11:15 pm Post subject: |
|
|
Tony0945
In case of lvm also would /boot as only a subdirectory of / would work?
I really like my root-on-lvm....
I think there is a way to achieve this with grub.
Thanks a lot. _________________
|
|
Back to top |
|
|
ygmedusa n00b
Joined: 03 Sep 2021 Posts: 3 Location: Germany
|
Posted: Fri Sep 03, 2021 11:40 pm Post subject: |
|
|
Hey guys,
thank you very much for all the answers! So, please correct me if I'm wrong but I get the impression that my system will work fine without the separated /boot and /boot/efi partitions, however it is the preferred setup. This however brings up a couple new questions for me:
- I read on the gentoo wiki (here: https://wiki.gentoo.org/wiki/Swap#:~:text=As%20best%20practice%2C%20the%20Gentoo,twice%20the%20available%20system%20memory.) that swap should be twice RAM so 64GB for me, however the Quick Installation Checklist mentioned above speaks of 1024MB. The Checklist seems to be older so I guess twice the amount of RAM or at least once would be the safe way to go here?
- Secondly, the /etc/fstab file in the Checklist above (under "Configure system") also only includes three partitions. How would I add the new partition taking that file as an example? I know the disk name, format and the mounted directory but what about the options and checking order?
- Thirdly and most importantly, would it be possible for me to add the according partitions via i.e. GParted Live or so and then reconfigure them in /etc/fstab and grub? Or would I be better off just reinstalling fresh? ( I just installed it the other day and haven't emerged a single package yet since I wanna set up the make.conf and such correctly for my setup and just do things properly)
Sorry for the long response time, I'm trying to make useful posts for my issue and it's taking me a bit. Thank you again for your help![/url] |
|
Back to top |
|
|
Tony0945 Watchman
Joined: 25 Jul 2006 Posts: 5127 Location: Illinois, USA
|
Posted: Sat Sep 04, 2021 12:37 am Post subject: |
|
|
/boot/efi must on the vfat formatted efi partition. Either as a standalone or as part of /boot. For all I know you could have one huge vfat partition as the efi and only partition. Possibly Windows does this. But you should use the efi partition for UEFI boot if your system supports it.
Last edited by Tony0945 on Sat Sep 04, 2021 12:53 am; edited 1 time in total |
|
Back to top |
|
|
Tony0945 Watchman
Joined: 25 Jul 2006 Posts: 5127 Location: Illinois, USA
|
Posted: Sat Sep 04, 2021 12:50 am Post subject: |
|
|
The swap as twice RAM advice is not ancient, it is positively archaic. I first saw it from Red Hat around the turn of the century, if not before.
It made sense when 512M was a big memory. I have one system with 8G Ram and 12G swap. It's working OK but I don't build some of the monster packages that others do, like rust and Chrome. I did update (i.e. rebuild) qtwebengine two days ago. It took forever but it finished. gcc takes about three hours to build natively so I build it on a Ryzen 2700 that takes half an hour. That system has 32G RAM and zero swap. I used to have a 12G swap file but deleted it. It wasn't being used.
Both of these are desktops. If you have a laptop that hibernates, you will have to get advice from someone else who has one.
IMHO, the advice is backwards. The more RAM you have the less swap you need (except for hibernation). |
|
Back to top |
|
|
Tony0945 Watchman
Joined: 25 Jul 2006 Posts: 5127 Location: Illinois, USA
|
Posted: Sat Sep 04, 2021 1:10 am Post subject: |
|
|
Stripped of the comments and cifs mounts, here is the 32G system spoken of above.
Code: | LABEL=CT500MX_EFI /boot/efi vfat relatime 1 2
LABEL=CT500MX_PART2 / ext4 relatime 0 1
LABEL=SAGE_VIDEO /video ext4 auto,relatime 0 1
/dev/sr0 /mnt/cdrom auto user,noauto,nofail 0 0
tmpfs /tmp tmpfs rw,nosuid,noatime,nodev,size=20G,mode=1777 0 0
devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0
LABEL=P1-1TB /mnt/freegentoo ext4 relatime,noauto 0 1
LABEL=P2-1TB /mnt/custom ext4 relatime,noauto 0 1
LABEL=P3-1TB /home/tony/.VirtualBox ext4 relatime,auto 0 1
LABEL=USB16CINDY /mnt/usbstick auto user,umask=000,utf8,noauto 0 0
LABEL=USB128G /mnt/usbvideo auto user,umask=000,utf8,noauto 0 0
LABEL=AGFABIOS /mnt/agfabios auto user,umask=000,utf8,noauto 0 0
| As you can see, I am fond of mounting by label. The last three are labeled usbsticks
Here is old 8G memory BIOS boot system.
Code: | LABEL=MX500ROOT / ext4 defaults 0 1
/swapfile swap swap sw 0 0
LABEL=32BIT /mnt/gentoo32 ext4 noauto 0 2
LABEL=FUNTOO /mnt/funtoo ext4 noauto 0 2
LABEL=RESCUE /mnt/rescue ext4 noauto 0 2
/dev/sdb1 /mnt/video ntfs-3g users,auto,uid=2000,gid=10 0 0
UUID="647A-695C" /media/kingston ntfs-3g users,noauto,uid=2000,gid=0 0 0
proc /proc proc defaults 0 0
shm /dev/shm tmpfs nodev,nosuid,noexec 0 0
devpts /dev/pts devpts rw,relatime,gid=5,mode=620,ptmxmode=000 0 0
tmpfs /var/tmp/portage tmpfs auto,uid=portage,gid=portage,mode=0775,size=12G,noatime 0 0
LABEL=SYSRESC /mnt/sysrescue auto user,umask=000,utf8,noauto 0 0
LABEL=USB16CINDY /mnt/usbstick auto user,umask=000,utf8,noauto 0 0
LABEL=USB128G /mnt/usbvideo auto user,umask=000,utf8,noauto 0 0
| This system has a SATA SSD and a SATA HDD. The SSD always answers first so I didn't bother to label /dev/sdb1. You could do that for safety but it's not boot critical (data only). Notice the use of UUID instead of label for the NTFS usbstick.
NeddySeagoon et al, please comment. |
|
Back to top |
|
|
Tony0945 Watchman
Joined: 25 Jul 2006 Posts: 5127 Location: Illinois, USA
|
Posted: Sat Sep 04, 2021 1:28 am Post subject: |
|
|
alamahant wrote: | What would the alternative be?
/boot as a dir of / ?
Is it even bootable?
|
yes and yes.
alamahant wrote: |
And if one runs lvm or luks?
|
Haven't a clue. I don't use them and I suspect neither do the majority of users. |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54577 Location: 56N 3W
|
Posted: Sat Sep 04, 2021 9:26 am Post subject: |
|
|
Tony0945,
Everything in LVM except boot. Most of the LVM is on top of raid5 too. There is even a nfs volume, so I can keep Blurays and DVDs in the garage.
Code: | $ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/static-root 976M 844M 66M 93% /
/dev/mapper/static-usr 207G 158G 40G 80% /usr
/dev/mapper/static-var 5.8G 3.8G 1.8G 69% /var
tmpfs 1.6G 228K 1.6G 1% /run
shm 7.9G 1020K 7.9G 1% /dev/shm
cgroup_root 10M 0 10M 0% /sys/fs/cgroup
/dev/mapper/vg-home 1.5T 1.4T 85G 95% /home
/dev/shm 7.9G 8.4M 7.9G 1% /tmp
/dev/mapper/static-opt 2.0G 1.6G 257M 87% /opt
/dev/mapper/static-local 976M 6.2M 903M 1% /usr/local
/dev/mapper/static-portage 5.3G 307M 4.7G 7% /usr/portage
/dev/mapper/vg-distfiles 256G 218G 28G 89% /usr/portage/distfiles
/dev/mapper/vg-static--packages 89G 65G 19G 78% /usr/packages
/dev/shm 11G 0 11G 0% /var/tmp/portage
/dev/mapper/vg-var 58G 21G 35G 38% /mnt/oldvar
192.168.100.55:/mnt/mediatomb 11T 9.1T 1.1T 90% /mnt/media
/dev/sr1 36G 36G 0 100% /mnt/cdrom
/dev/sde1 118M 76M 34M 70% /boot |
Maybe its overdoing it but it just sort of grew. Its not a recommendation, especially when something breaks and you have to put the bits together by hand to sort out the mess. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
Tony0945 Watchman
Joined: 25 Jul 2006 Posts: 5127 Location: Illinois, USA
|
Posted: Sat Sep 04, 2021 1:00 pm Post subject: |
|
|
NeddySeagoon,
I'm surprised to see /dev/sr1 without /dev/sr0 ! I surmise that /dev/sr0 is present but mot automatically mounted.
I see you use LVM. which doesn't surprise me as you talk about it a lot.
But do you recommend a separate /boot without LUKS or LVM? |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54577 Location: 56N 3W
|
Posted: Sat Sep 04, 2021 1:22 pm Post subject: |
|
|
Tony0945,
Its static /dev. :)
I can call it whatever I want, as long as I use the right major and minor device numbers.
I've always had a separate boot partition as I use grub-static on old hardware.
EFI makes me nervous. Only my arm64 server has EFI and that is badly broken. I edit its grub.cfg by hand as I had to do the setup with no console access and I don't want to go there again.
It started out as a Raspberry Pi 4 install, with the kernel made to boot both places and grub2 added ... shudder.
The concept of VFAT for system critical files is broken by design, so I will be putting as little as possible into VFAT.
I don't like the concept of using the grub2 operating system to boot the operating system I really want to use either but it looks like there is not much else in amd64 space. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
Tony0945 Watchman
Joined: 25 Jul 2006 Posts: 5127 Location: Illinois, USA
|
Posted: Sat Sep 04, 2021 2:20 pm Post subject: |
|
|
NeddySeagoon wrote: |
The concept of VFAT for system critical files is broken by design, so I will be putting as little as possible into VFAT. | Thank You!
NeddySeagoon wrote: |
I don't like the concept of using the grub2 operating system to boot the operating system I really want to use either but it looks like there is not much else in amd64 space. | Grub legacy. Easily edited files. Booting from cd doesn't seem to work. But there is BIOS F12 for that.
You really must try refind with an absolute minimum required on VFAT. When I built the 3900X I just copied the 2700X partition. It didn't work at first but that was because the kernels were missing some EFI configs and weren't recognized by refind. When I booted from systescuecd and rebuilt the kernels, refind found and booted them just fine. I guess I'm spoiled by building the kernel and not having to move or copy it. And have it automatocally become the default.
Code: | df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 99M 2.0M 97M 2% /boot/efi | Two Meg. easily kept uncompressed on a USB stick. |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54577 Location: 56N 3W
|
Posted: Sat Sep 04, 2021 4:12 pm Post subject: |
|
|
Tony0945,
I may have an opportunity to try it out next week :) _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
ygmedusa n00b
Joined: 03 Sep 2021 Posts: 3 Location: Germany
|
Posted: Sat Sep 04, 2021 4:50 pm Post subject: |
|
|
Hey guys,
thank you very much for all the feedback plus the additional information. I've decided to re-do my Gentoo install since it doesn't take that long with my hardware and I want to have everything set up properly. I've set up my notes for the new fstab like so:
Code: |
/dev/nvme0n1p2 /boot/efi fat32 noatime 1 2 #32MB
/dev/nvme0n1p1 /boot ext4 noatime 0 2 #128MB
/dev/nvme0n1p3 none swap sw 0 0 #2048MB
/dev/nvme0n1p4 / ext4 defaults,relatime 0 1 #..
|
This is pretty much copied from the aforementioned Quick Install Checklist. Is there anything else I need to consider? |
|
Back to top |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 22649
|
Posted: Sat Sep 04, 2021 4:53 pm Post subject: |
|
|
I use, and have been quite happy with, syslinux as an alternative to grub. It it packaged in Portage and has a simple and easy to edit configuration file. |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54577 Location: 56N 3W
|
Posted: Sat Sep 04, 2021 9:47 pm Post subject: |
|
|
Hu,
Thank you for the reminder. I used to use syslinux many years ago when I had to PXE boot my media player.
The most important requirement, (from my wife) was that it must be silent, so no HDD.
If it wasn't silent, it would not have been allowed in the lounge. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
mike155 Advocate
Joined: 17 Sep 2010 Posts: 4438 Location: Frankfurt, Germany
|
Posted: Sat Sep 04, 2021 10:03 pm Post subject: |
|
|
I use the EFI Boot Manager on my mainboard. Therefore, I do not need GRUB or Syslinux. There's also no need for a separate boot partition. |
|
Back to top |
|
|
pietinger Moderator
Joined: 17 Oct 2006 Posts: 5104 Location: Bavaria
|
Posted: Sat Sep 04, 2021 10:20 pm Post subject: |
|
|
mike155 wrote: | I use the EFI Boot Manager on my mainboard. [...] |
+ 1
mike155 wrote: | [...] Therefore, I do not need GRUB or Syslinux. There's also no need for a separate boot partition. |
I dont need grub2, but I dont delete it from my standard installation, because it is my (second) fallback, if a new kernel will not boot; I had this one time in the last years (first fallback is a second stub-kernel with IMA swithced off).
P.S.: It was 5.10.37 ( https://forums.gentoo.org/viewtopic-t-1135311.html ) |
|
Back to top |
|
|
Tony0945 Watchman
Joined: 25 Jul 2006 Posts: 5127 Location: Illinois, USA
|
Posted: Sat Sep 04, 2021 11:32 pm Post subject: |
|
|
pietinger wrote: | I dont need grub2, but I dont delete it from my standard installation, because it is my (second) fallback, if a new kernel will not boot; I had this one time in the last years (first fallback is a second stub-kernel with IMA swithced off).) |
refindgives you that choice too. |
|
Back to top |
|
|
|