You are not logged in.

#1 2016-09-04 07:56:03

zebulon
Member
Registered: 2008-10-20
Posts: 349

Partitioning a new disk for BIOS-GPT but preparing for UEFI-GPT

Hi, I have a PC with BIOS, and just bought a new hard drive (an SSD to be precise) where I want to install Arch with GRUB as the bootloader. I reckon my PC is quite old and will be replaced at some point with a new UEFI based motherboard. Hence I want to make the boot drive future proof, having both the GRUB BIOS partition for the moment, then switching to an EFI boot requiring the ESP partition.

Is it ok to partition the SSD that way (in that order):
1- a 512MiB partiton with code EF00 for the future ESP. I do not format it in FAT32 for the moment (and do not set a boot flag) as I have no use of UEFI. Or should I leave it as unallocated, with no code at all (if possible)?
2- the 1MiB GRUB bios boot partition with code EF02. I do not format it as per specifications.
3- my / and /home partitions
4- an unallocated space (overprovisioning) for the SSD, this is specific to SSDs.

I know that the ESP and GBP do not need to be at the beginning of the hard drive, but I read this could facilitate my life later. So when I switch to an UEFI system, I would just need to format the first partition and set the boot flag, and reinstall GRUB as per specifications. I could also erase the GRUB bios boot partition if needed and merge it.

Is it fine that way?

Last edited by zebulon (2016-09-04 07:57:00)

Offline

#2 2016-09-04 08:37:41

frostschutz
Member
Registered: 2013-11-15
Posts: 1,409

Re: Partitioning a new disk for BIOS-GPT but preparing for UEFI-GPT

If you keep an empty partition with ESP type around, while not actually using ESP, you'll just confuse both sides. So don't do that until you actually intend to make it work.

SSDs don't need unallocated space / overprovisioning [apart from what's already built-in anyhow]. Especially not if you intend to use fstrim, and have free space available in your filesystems.

If it's not a database server or video surveillance that writes data 24/7, there is no need to worry about writes on SSD whatsoever. Unless you buy a vegetable (make sure it's a proper SSD with TRIM support and >50K IOPS).

Basically I'd go with

1) 1 MIB bios_grub partition
2) 512 MiB /boot partition
3) root home as you like it

Later on you can just convert the /boot partition itself to ESP - if you actually want to do that. If there is no Windows on this machine, most UEFI boards are happy to boot traditional like, so there may not actually be a need to switch unless you dislike GRUB for some reason.

In parted this would be something like

unit MiB
mklabel gpt
print free

disk_set pmbr_boot on # some BIOSes need this
mkpart grub 1 2
set 1 bios_grub on

mkpart boot 2 512
mkpart swap 512 1024
mkpart root 1024 20480
mkpart home 20480 -1
print free

Adapt the sizes and names to your liking.

Offline

#3 2016-09-04 08:47:03

zebulon
Member
Registered: 2008-10-20
Posts: 349

Re: Partitioning a new disk for BIOS-GPT but preparing for UEFI-GPT

Many thanks for your reply. Using the /boot partition as future ESP is very clever indeed.

My SSD is a Samsung 850 pro 512MB. Their Magician software under Windows says 47GB (!!) should be unallocated for overprovisioning. That is crazy. I am aware there is built-in, unaccessible overprovisioning already and that should suffice. Anyway, resizing the end of a drive is quite easy.

Also, I have a mechanical HDD, which I will use to store the swap space, avoiding swapping on the SSD.

Last edited by zebulon (2016-09-04 08:52:23)

Offline

#4 2016-09-04 09:04:11

frostschutz
Member
Registered: 2013-11-15
Posts: 1,409

Re: Partitioning a new disk for BIOS-GPT but preparing for UEFI-GPT

zebulon wrote:

My SSD is a Samsung 850 pro 512MB.

That's a bit small big_smile

zebulon wrote:

Their Magician software under Windows says 47GB (!!) should be unallocated for overprovisioning. That is crazy.

It's a Samsung, what do you expect. But if you don't fill the SSD to the brim and have 47GB "free space", that's the same thing as overprovisioning (as long as you fstrim the free space you have).

zebulon wrote:

Also, I have a mechanical HDD, which I will use to store the swap space, avoiding swapping on the SSD.

Whatever you want to be fast, do it on the SSD. That's what it's there for.

HDD is fine for the big clunky data (movies, music, ...) that uses tons of space but does not benefit at all from SSD speed.

In my system I have one SSD (64GB) and 7 HDDs in a RAID-5. These disks are in standby most of the time since I have everything I need (for mail, firefox, office, programming) on SSD. Using swap on HDD would probably prevent it from going into standby (even if only a few kilobytes of swap are actually used, it will still cause reads and writes from time to time). Besides it would be slow.

If you use suspend to disk (hibernate) then both going into hibernate and resuming from it would be as slow as your HDD is...

...so I'd never go for HDD swap anymore. The SSD can take it (well, not mine, it's too old/small to waste gigabytes on this, so I don't actually have any swap at all...)

Last edited by frostschutz (2016-09-04 09:09:49)

Offline

#5 2016-09-04 09:24:29

zebulon
Member
Registered: 2008-10-20
Posts: 349

Re: Partitioning a new disk for BIOS-GPT but preparing for UEFI-GPT

Thank you for all the advice smile

Offline

#6 2016-09-04 11:29:38

zebulon
Member
Registered: 2008-10-20
Posts: 349

Re: Partitioning a new disk for BIOS-GPT but preparing for UEFI-GPT

Another question: is it possible to do a 512 MiB partition for the GRUB bios boot partition (instead of the classic 1MiB), and then convert it to ESP later?

Offline

#7 2016-09-04 11:33:53

frostschutz
Member
Registered: 2013-11-15
Posts: 1,409

Re: Partitioning a new disk for BIOS-GPT but preparing for UEFI-GPT

It's possible ... but it kinda hurts to make a 512MiB partition, of which Grub will at most use 64KiB or so ...

I usually squeeze the Grub partition in before the 1st MiB (sector 64 - 2047) and that's still plenty ...

Offline

Board footer

Powered by FluxBB