Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Before new installation: Partitions considerations?
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
pmam
Veteran
Veteran


Joined: 30 Dec 2013
Posts: 1145

PostPosted: Sun May 14, 2017 5:40 pm    Post subject: Before new installation: Partitions considerations? Reply with quote

Guess it is well known issue however need some advise regarding partitioning:
I plan to have separate partitions for: boot, swap, root, home.
Please let me know what are the considerations if to add separate partitions for: var, tmp ... When it is worth to have?
_________________
“You can take our property, our sweet homes, even our cloths...
But don't touch the streets, Ah, That's NO, NO, NO!
The streets are our @world's compilable kernel ...”
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 7127
Location: almost Mile High in the USA

PostPosted: Sun May 14, 2017 7:53 pm    Post subject: Reply with quote

It depends on what the target of the machine will be.

For home single user machines that have recent firmware, it's much more efficient to make one big partition for everything in my opinion - rarely will you later think "i wish I had partitioned differently." But share that computer with other people, even if it's anonymous remote users, this may not be optimal.

Without the intended application it's hard to tell what's optimal, and then some...

/boot - if your system or possible systems firmware has problems detecting the disk.
/tmp - if you have dissimilar speed disks
/home - if you plan to upgrade os frequently (not an issue with Gentoo due to floating version) or if you don't trust users from filling up your disk
/var - if you don't necessarily trust applications that write there from filling up your disk

etc. etc., and there are lots of other possibilities that may make multiple partitions helpful.
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
The Doctor
Moderator
Moderator


Joined: 27 Jul 2010
Posts: 2574

PostPosted: Sun May 14, 2017 8:11 pm    Post subject: Reply with quote

Well, in most cases on a modern machine /tmp should be a ramfs anyway. It is faster and you should have plenty of ram. Clearly that doesn't apply to an older box. I put /usr/portage on a separate partition because /usr is on my ssd and I don't need the speed for portage or the added wear on the ssd.

I also added a partition for my windows VM to live. It makes it more efficient if it doesn't need to compete with anything else writing to its partition.

On a UEFI box you can simplify a lot by having /boot on vfat and its own partition. This is readable by the EFI firmware so the kernel can be loaded directly.

Mostly partitions are considerations of how multiple disks would best be used and limiting space in case of a spamming application or other growing data storage. For example, I've filled home with useless data quite by accident. It was a numerical physics simulation and I didn't anticipate the output very well. However since my /home is separate it didn't affect the OS's ability to run. Other concerns might be filling up your /usr/portage/distfiles or log spam in /var.

The best advice is to think about a plan and implement it. If you are really nervous about making a mistake you can use lvm partitions. Then you can grow the partitions to your hearts content. Shrinking is not so easy so it is best to leave unallocated space.
_________________
First things first, but not necessarily in that order.

Apologies if I take a while to respond. I'm currently working on the dematerialization circuit for my blue box.
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 2613

PostPosted: Mon May 15, 2017 7:29 am    Post subject: Reply with quote

pmam, did you consider gpt vs. msdos partition table? And did you think of using LVM?

The Doctor wrote:
On a UEFI box you can simplify a lot by having /boot on vfat and its own partition. This is readable by the EFI firmware so the kernel can be loaded directly.
@The Doctor,
Does this mean the EFI firmware cannot load the kernel from an ext2 formatted partition?
And, would EFI stuff necessarily need an additional "EFI system partition"?

Edit:
Just checked Gentoo Handbook
https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Disks#Creating_the_partitions wrote:
When using the UEFI interface to boot the system (instead of BIOS), mark the boot partition as the EFI System Partition. Parted does this automatically when the boot option is set on the partition:
Code:
(parted)set 2 boot on
Back to top
View user's profile Send private message
C5ace
Apprentice
Apprentice


Joined: 23 Dec 2013
Posts: 277
Location: Brisbane, Australia

PostPosted: Mon May 15, 2017 9:31 am    Post subject: Reply with quote

pman:

I use on all my, my family, friends and neighbours the same MS-DOS partition scheme. File system is always EXT4 with LABELS:

sda1 BOOT 500 MB
sda2 extended partition
sda5 SWAP 4.2 GB (memory + 200 MB for suspend)
sda6 ROOT 30 GB
sda7 HOME Reminder of the drive.

Works fine without problems on the 20 boxes I look after.
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 7127
Location: almost Mile High in the USA

PostPosted: Mon May 15, 2017 1:55 pm    Post subject: Reply with quote

Oh yeah that is true, booting in UEFI mode does require a boot partition "EFI System Partition" to at least load the boot/EFI image from. All my machines are still using legacy/MBR boot and thus don't use this (though I think some do support booting as EFI)...

That EFI partition needs to be MSDOS/FAT16/FAT32 and you could stick initramfs/GRUB in it if needed. EFI can't make heads or tails of Linux partitions so it can't boot off of them.
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
1clue
Advocate
Advocate


Joined: 05 Feb 2006
Posts: 2549

PostPosted: Mon May 15, 2017 4:25 pm    Post subject: Reply with quote

I use:


  1. 512g EF00 FAT32 on /boot
  2. 10G 8300 ext4 as /
  3. * 8E00 Linux LVM


/ 10g gives enough for a modest main install without special handling during boot.
LVM lets me have on-the-fly resizable partitions for everything from /home to data partitions to whatever.
/boot is the normal Linux /boot + EFI.

The UEFI system cares not one bit where it mounts when your system is running. It only cares that:

  1. There is an adequately sized partition of type EF00
  2. The partition is formatted Fat32
  3. There is a bootable binary in a preconfigured place or in the default place.


Likewise, the stuff Linux people tend to put in /boot does not care about file permissions, and everything "fits" inside of fat32 nicely.

So my /boot contains what /boot normally contains, plus EFI/BOOT/grubx64.efi

I also have a SWAP space on each non-RAID drive which is the size of RAM. On RAID arrays there is a single swap space the size of RAM on the assembled array. The space is on LVM so it can be resized if I add memory.

Finally, memory is large enough that it pretty much never gets paged out. The SWAP space is there for emergencies, as SWAP was originally intended. I also use tmpfs for anything that it can work for, including:

  1. /tmp
  2. /var/tmp/portage
  3. Anything the system uses as scratch which need not survive a reboot.
Back to top
View user's profile Send private message
The Doctor
Moderator
Moderator


Joined: 27 Jul 2010
Posts: 2574

PostPosted: Tue May 16, 2017 2:54 am    Post subject: Reply with quote

charles17 wrote:
The Doctor wrote:
On a UEFI box you can simplify a lot by having /boot on vfat and its own partition. This is readable by the EFI firmware so the kernel can be loaded directly.
@The Doctor,
Does this mean the EFI firmware cannot load the kernel from an ext2 formatted partition?
And, would EFI stuff necessarily need an additional "EFI system partition"?
Partially answered but no ext2 is not recognized by EFI.

EFI doesn't necessarily "need" an extra partition. You can make boot readable and call it good. What it needs is some partition it can read. What grub and I believe most boot loaders do is install themselves on the readable EFI partition and then load the system's /boot. Basically a hack. I prefer to cut out the middle man and simply tell the EFI firmware to boot my kernel directly.
_________________
First things first, but not necessarily in that order.

Apologies if I take a while to respond. I'm currently working on the dematerialization circuit for my blue box.
Back to top
View user's profile Send private message
1clue
Advocate
Advocate


Joined: 05 Feb 2006
Posts: 2549

PostPosted: Tue May 16, 2017 2:40 pm    Post subject: Reply with quote

The Doctor wrote:
charles17 wrote:
The Doctor wrote:
On a UEFI box you can simplify a lot by having /boot on vfat and its own partition. This is readable by the EFI firmware so the kernel can be loaded directly.
@The Doctor,
Does this mean the EFI firmware cannot load the kernel from an ext2 formatted partition?
And, would EFI stuff necessarily need an additional "EFI system partition"?
Partially answered but no ext2 is not recognized by EFI.

EFI doesn't necessarily "need" an extra partition. You can make boot readable and call it good. What it needs is some partition it can read. What grub and I believe most boot loaders do is install themselves on the readable EFI partition and then load the system's /boot. Basically a hack. I prefer to cut out the middle man and simply tell the EFI firmware to boot my kernel directly.


So how do you deal with new kernels? How do you compile and install a kernel and then boot into it? You need to set up an EFIVARS entry right? I never got that working correctly.
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 7089
Location: Saint Amant, Acadiana

PostPosted: Tue May 16, 2017 2:45 pm    Post subject: Reply with quote

I have a backup kernel next to default one, in case I need to use it I choose rEFInd from motherboard boot menu which presents a menu of kernel choices. By default the firmware boots the EFI stub kernel directly, without user intervention.
_________________
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
mega_flow
n00b
n00b


Joined: 26 Jun 2016
Posts: 31
Location: Belgium, Maasmechelen

PostPosted: Tue May 16, 2017 6:11 pm    Post subject: Reply with quote

My system boot also the EFI stub kernel, no grub on this system
I dit create a EFI firmware setting with efibootmgr, but only for intel-microcode
also to note my firmware dont like long Command line

so efibootmgr points to bzImage and the microcode.cpio
and in the kernel CONFIG_CMDLINE="root=PARTUUID=xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx quiet"

I keep a usbstick with SystemRescue in case i make a mistake
Back to top
View user's profile Send private message
The Doctor
Moderator
Moderator


Joined: 27 Jul 2010
Posts: 2574

PostPosted: Tue May 16, 2017 6:17 pm    Post subject: Reply with quote

I called my kernels vmlinuz.efi and vmlinuz-rescue.efi. When a new kernel comes out I rename vmlinuz.efi to vmlinuz-rescue.efi and the new kernel becomes vmlinuz.efi. Since the names never change I never need to edit the EFIVARS and I always have a known working kernel available.
_________________
First things first, but not necessarily in that order.

Apologies if I take a while to respond. I'm currently working on the dematerialization circuit for my blue box.
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 2613

PostPosted: Wed May 17, 2017 5:32 am    Post subject: Reply with quote

The Doctor wrote:
EFI doesn't necessarily "need" an extra partition. You can make boot readable and call it good. What it needs is some partition it can read. What grub and I believe most boot loaders do is install themselves on the readable EFI partition and then load the system's /boot. Basically a hack. I prefer to cut out the middle man and simply tell the EFI firmware to boot my kernel directly.

In case of double booting with Windows, how many EFI system partitions does it need? archlinux says both can use the same.
How do you think about?
Back to top
View user's profile Send private message
The Doctor
Moderator
Moderator


Joined: 27 Jul 2010
Posts: 2574

PostPosted: Wed May 17, 2017 5:43 am    Post subject: Reply with quote

One should be sufficient. Just don't put your Linux stuff into the windows directory structure. You wouldn't want windows to helpfully clean the "extra" files.
_________________
First things first, but not necessarily in that order.

Apologies if I take a while to respond. I'm currently working on the dematerialization circuit for my blue box.
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 2613

PostPosted: Wed May 17, 2017 6:03 am    Post subject: Reply with quote

The Doctor wrote:
One should be sufficient. Just don't put your Linux stuff into the windows directory structure. You wouldn't want windows to helpfully clean the "extra" files.
So where then put my /boot stuff if not on the common EFI system partition?
Or do you regard EFI system partition not being part of windows directory structure?
Back to top
View user's profile Send private message
The Doctor
Moderator
Moderator


Joined: 27 Jul 2010
Posts: 2574

PostPosted: Wed May 17, 2017 6:34 pm    Post subject: Reply with quote

One partition is fine. When you look in the partition you are going to find it has a directory structure. I don't remember it off the top of my head. The point is there will be stuff there that is obviously windows. Make your own directory lower down in the tree so that if windows replaces the contents of its directories later or checks for intrusive programs it won't take out your linux.
_________________
First things first, but not necessarily in that order.

Apologies if I take a while to respond. I'm currently working on the dematerialization circuit for my blue box.
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 2613

PostPosted: Tue May 30, 2017 5:31 pm    Post subject: Reply with quote

Having studied some articles on wiki.gentoo.org and elsewhere on the internet I see instructions like:
Code:
root # mkdir -p /boot/efi/boot
root # cp /boot/vmlinuz-* /boot/efi/boot/bootx64.efi

My stupid question: Is the /boot/vmlinuz-* still needed for booting with EFI stub kernel? Both are the same, just different names and different location.
Back to top
View user's profile Send private message
1clue
Advocate
Advocate


Joined: 05 Feb 2006
Posts: 2549

PostPosted: Tue May 30, 2017 5:52 pm    Post subject: Reply with quote

I think they're trying to make it work with both efi and old-school. You shouldn't need the kernel directly in /boot if you do pure EFI boot all the time
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 2613

PostPosted: Wed May 31, 2017 5:29 pm    Post subject: Reply with quote

1clue wrote:
... You shouldn't need the kernel directly in /boot if you do pure EFI boot all the time

No more kernel in /boot directly. :-)
Then if using EFI Boot Stub, does kernel command line need the full path to the *.efi file like
Code:
Processor type and features  --->
    [*] Built-in kernel command line
    (root=/dev/sda2/EFI/Gentoo/vmlinuz-4.9.16-gentoo.efi)
or will (root=/dev/sda2) be sufficient (presuming ESP located at /dev/sda2) ?
Back to top
View user's profile Send private message
1clue
Advocate
Advocate


Joined: 05 Feb 2006
Posts: 2549

PostPosted: Wed May 31, 2017 6:53 pm    Post subject: Reply with quote

charles17 wrote:
1clue wrote:
... You shouldn't need the kernel directly in /boot if you do pure EFI boot all the time

No more kernel in /boot directly. :-)
Then if using EFI Boot Stub, does kernel command line need the full path to the *.efi file like
Code:
Processor type and features  --->
    [*] Built-in kernel command line
    (root=/dev/sda2/EFI/Gentoo/vmlinuz-4.9.16-gentoo.efi)
or will (root=/dev/sda2) be sufficient (presuming ESP located at /dev/sda2) ?


I use grub2 on uefi, so my experience is thin here.

It's my understanding that you need an efivar containing \Gentoo\vmlinuz-4.9.16-gentoo.efi. Or maybe \EFI\Gentoo\vmlinuz-4.9.16-gentoo.efi.
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 2613

PostPosted: Mon Jun 05, 2017 10:06 am    Post subject: Reply with quote

It needed some reworking of the EFI stub kernel article in order to reduce such kind of confusion.
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