You are not logged in.

#1 2019-05-14 12:40:13

Zarch1
Member
Registered: 2019-05-14
Posts: 28

[SOLVED]Setting partition boot flag using parted in NON-IN....

Not an Arch specific question I know.

I am attempting to partition my HDD using parted in non-interactive mode. The below commands partition the drive as expected, then on completing install and configuration then booting I see an error saying I do not have an EFI partition setup.

parted /dev/sda mklabel gpt
parted /dev/sda mkpart primary fat32 1MiB 500MiB
parted /dev/sda mkpart primary linux-swap 500MiB 8.5GiB
parted /dev/sda mkpart primary ext4 8.5GiB 23.5GiB
parted /dev/sda mkpart primary ext4 23.5GiB 100%
mount /dev/sda3 /mnt
mkdir /mnt/boot
mount /dev/sda1 /mnt/boot
mkdir /mnt/home
mount /dev/sda4 /mnt/home

I believe this is because the Fat32 boot partition is not flagged as boot. I am able to boot successfully when partitioning using interactive mode.

How can I set the boot flag on this partition without using interactive mode in parted? Is this even possible?

Last edited by Zarch1 (2019-05-17 18:31:29)

Offline

#2 2019-05-14 12:52:42

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [SOLVED]Setting partition boot flag using parted in NON-IN....

You want the set or toggle commands.

man parted

No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#3 2019-05-14 15:32:04

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: [SOLVED]Setting partition boot flag using parted in NON-IN....

Zarch1 wrote:

How can I set the boot flag on this partition without using interactive mode in parted?

The boot flag is for non-UEFI systems & msdos partition tables.

You want

# parted /dev/sda set 1 esp on

But I would recommend gdisk (or sgdisk if you want to script the partitioning) for GPT disks.

@Slithery: scnr


Jin, Jîyan, Azadî

Offline

#4 2019-05-14 16:01:04

Zarch1
Member
Registered: 2019-05-14
Posts: 28

Re: [SOLVED]Setting partition boot flag using parted in NON-IN....

Head_on_a_Stick wrote:
Zarch1 wrote:

How can I set the boot flag on this partition without using interactive mode in parted?

The boot flag is for non-UEFI systems & msdos partition tables.

You want

# parted /dev/sda set 1 esp on

But I would recommend gdisk (or sgdisk if you want to script the partitioning) for GPT disks.

@Slithery: scnr

Thanks.

Why would you use sgdisk over parted?

Offline

#5 2019-05-14 16:01:04

Zarch1
Member
Registered: 2019-05-14
Posts: 28

Re: [SOLVED]Setting partition boot flag using parted in NON-IN....

Head_on_a_Stick wrote:
Zarch1 wrote:

How can I set the boot flag on this partition without using interactive mode in parted?

The boot flag is for non-UEFI systems & msdos partition tables.

You want

# parted /dev/sda set 1 esp on

But I would recommend gdisk (or sgdisk if you want to script the partitioning) for GPT disks.

@Slithery: scnr

Thanks.

Why would you use sgdisk over parted?

Offline

#6 2019-05-14 16:17:04

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: [SOLVED]Setting partition boot flag using parted in NON-IN....

Zarch1 wrote:

Why would you use sgdisk over parted?

Because {s,}gdisk is specifically for GUID partition tables and I much prefer the handling of sectors in that program — parted will only accept bytes as size units, which can be confusing.


Jin, Jîyan, Azadî

Offline

#7 2019-05-17 18:30:08

Zarch1
Member
Registered: 2019-05-14
Posts: 28

Re: [SOLVED]Setting partition boot flag using parted in NON-IN....

Head_on_a_Stick wrote:
Zarch1 wrote:

How can I set the boot flag on this partition without using interactive mode in parted?

The boot flag is for non-UEFI systems & msdos partition tables.

You want

# parted /dev/sda set 1 esp on

But I would recommend gdisk (or sgdisk if you want to script the partitioning) for GPT disks.

@Slithery: scnr

This worked great, thanks

Offline

Board footer

Powered by FluxBB