Thanks @mladen! Actually this post is based on what proposed when GPT format needs (or preferred as in my case scenario) to be used, under CSM Boot mode. Furthermore it might be used as sort of short guide for those that are about to throw away their old Windows7 (just if=/dev/zero it out from your SSD), or otherwise not used computers . Just don’t destroy it, please, especially if there is someone that might reuse it with PureOS (as installed below, without extra firmware that might be, in addition, needed).
I’m trying to, just in order to have have long term performance up to align-check opt
from parted
. It is actually simple calculation by taking number 2048 and multiplying it to the size as needed. For PureOS with GPT partition style (I’ve used five of them just as an example) we need 8 MiB or 2048×8=16384 sectors for our first partition as confirmed here:
In order to start with our installation we need to boot PureOS Amber Live or Byzantium Live image under CSM anyway (this is prerequisite here, in general), meaning Disable Secure Boot Configuration (if exists) and enable CSM Boot within your BIOS Setup.
As we just entered PureOS Live on our computer let us finally start by opening Tilix terminal:
sudo su -
(optional, otherwise include sudo
up front of below terminal commands)
If Ethernet communication available:
apt update
apt install pv
fdisk -l
fdisk -l /dev/dev/sd[x]
fdisk -u /dev/dev/sd[x]
Command (m for help): p
Command (m for help): g
Command (m for help): w (only if already decided to move on, backup made!)
Make sure your computer SSD (the one to be reborn again) is still healthy:
dd if=/dev/zero conv=noerror,notrunc,sync bs=4096 | pv >/dev/dev/sd[x]
gdisk /dev/sd[x]
GPT fdisk (gdisk) version 1.0.5
Partition table scan:
MBR: not present
BSD: not present
APM: not present
GPT: not present
Creating new GPT entries in memory.
Command (? for help): n
Partition number (1-128, default 1):
First sector (34-250069646, default = 2048) or {±}size{KMGTP}:
Last sector (2048-250069646, default = 250069646) or {±}size{KMGTP}: +16384
Current type is 8300 (Linux filesystem)
Hex code or GUID (L to show codes, Enter = 8300): ef02
Changed type of partition to ‘BIOS boot partition’
Command (? for help): n
Partition number (2-128, default 2):
First sector (34-250069646, default = 18432) or {±}size{KMGTP}:
Last sector (18432-250069646, default = 250069646) or {±}size{KMGTP}: +1048576
Current type is 8300 (Linux filesystem)
Hex code or GUID (L to show codes, Enter = 8300):
Changed type of partition to ‘Linux filesystem’
Command (? for help): n
Partition number (3-128, default 3):
First sector (34-250069646, default = 1067008) or {±}size{KMGTP}:
Last sector (1067008-250069646, default = 250069646) or {±}size{KMGTP}: +67108864
Current type is 8300 (Linux filesystem)
Hex code or GUID (L to show codes, Enter = 8300):
Changed type of partition to ‘Linux filesystem’
Command (? for help): n
Partition number (4-128, default 4):
First sector (34-250069646, default = 68175872) or {±}size{KMGTP}:
Last sector (68175872-250069646, default = 250069646) or {±}size{KMGTP}: +33554432
Current type is 8300 (Linux filesystem)
Hex code or GUID (L to show codes, Enter = 8300): 8200
Changed type of partition to ‘Linux swap’
Command (? for help): n
Partition number (5-128, default 5):
First sector (34-250069646, default = 101730304) or {±}size{KMGTP}:
Last sector (101730304-250069646, default = 250069646) or {±}size{KMGTP}:
Current type is 8300 (Linux filesystem)
Hex code or GUID (L to show codes, Enter = 8300):
Changed type of partition to ‘Linux filesystem’
Command (? for help): p
Disk /dev/sd[x]: 250069680 sectors, 119.2 GiB
Sector size (logical/physical): 512/4096 bytes
Disk identifier (GUID): XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 250069646
Partitions will be aligned on 2048-sector boundaries
Number Start (sector) End (sector) Size Code Name
1 2048 18431 8.0 MiB EF02 BIOS boot partition
2 18432 1067007 512.0 MiB 8300 Linux filesystem
3 1067008 68175871 32.0 GiB 8300 Linux filesystem
4 68175872 101730303 16.0 GiB 8200 Linux swap
5 101730304 250069646 70.7 GiB 8300 Linux filesystem
Command (? for help): w
Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!
Do you want to proceed? (Y/N): Y
OK; writing new GUID partition table (GPT) to /dev/sd[x].
The operation has completed successfully.
fdisk -l /dev/sd[x]
parted -s /dev/sd[x] print
parted -s /dev/sd[x] set 1 bios_grub on
Now is time to start Calamares
installer (and exit Tilix
). If not already said, above is prepared for:
Checking if the
/dev/sd[x]1
partition is already set to ‘0x
ef02
’ type, yet change nothing please (
Cancel
) within this window:
And here will be your last chance to give up on PureOS installation under CSM/GPT:
Hope this helps a bit, if not running on top of
coreboot
yet.
P.S. This is just simple overview, end-user perspective, no guaranty from my side whatsoever (although as described worked on my old, but reliable laptop).