Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for parted 'Disk Flags' (in particular 'Disk Flags: pmbr_boot' to boot from GPT disk on BIOS system) #2300

Closed
jsmeix opened this issue Dec 12, 2019 · 5 comments
Labels
bug The code does not do what it is meant to do enhancement Adaptions and new features needs sponsorship This issue will not get solved on a voluntary base by ReaR upstream. no-issue-activity
Milestone

Comments

@jsmeix
Copy link
Member

jsmeix commented Dec 12, 2019

Cf.
#2298 (comment)
and
#2299 (comment)

See #2299 (comment)
(excerpt)

I did a "rear recover" test on my laptop
...
the recreated system can no longer boot from its built-in /dev/sda
(the BIOS tells that an operating system needs to be installed on the disk)
but it can be booted from the USB disk ReaR recovery system bootloader
in its syslinux boot menue by selecting `Boot Local disk (hd1)`
so something on the built-in /dev/sda got lost or damaged by "rear recover"
that is needed by that laptop's firmware (UEFI capable firmware that I use
in legacy BIOS mode) to boot.
  • Workaround, if any:

See #2299 (comment)
(excerpt)

The missing piece on /dev/sda that got destroyed by "rear recover"
was the enabled boot flag on the GPT’s protective MBR partition, cf.
https://www.gnu.org/software/parted/manual/html_node/disk_005fset.html
...
(parted) disk_set pmbr_boot on
...
The difference is `Disk Flags:` empty which does not work
versus `Disk Flags: pmbr_boot` which is needed
at least by my UEFI firmware that I use in legacy BIOS mode
to boot from a GPT disk with GRUB2 installed "in MBR"

Accordingly the following POST_RECOVERY_SCRIPT
in etc/rear/local.conf helped in my case:

SSH_ROOT_PASSWORD="rear"
USE_DHCLIENT="yes"
PROGRESS_MODE="plain"
PROGRESS_WAIT_SECONDS=3
KEEP_BUILD_DIR="yes"
GRUB_RESCUE=y
OUTPUT=USB
BACKUP=NETFS
BACKUP_URL=usb:///dev/disk/by-label/REAR-000
USB_SUFFIX="ReaRbackup"
USB_DEVICE_FILESYSTEM_PERCENTAGE=10
POST_RECOVERY_SCRIPT=( 'parted -s /dev/sda disk_set pmbr_boot on' )
@jsmeix jsmeix added enhancement Adaptions and new features minor bug An alternative or workaround exists labels Dec 12, 2019
@jsmeix jsmeix added this to the ReaR v2.6 milestone Dec 12, 2019
@jsmeix jsmeix self-assigned this Dec 12, 2019
@jsmeix jsmeix added bug The code does not do what it is meant to do and removed minor bug An alternative or workaround exists labels Dec 12, 2019
@jsmeix jsmeix changed the title parted "disk_set pmbr_boot on" needed in "rear recover" to boot from GPT disk on BIOS system Add support for parted 'Disk Flags' (in particular 'Disk Flags: pmbr_boot' to boot from GPT disk on BIOS system) Mar 6, 2020
@jsmeix
Copy link
Member Author

jsmeix commented Mar 6, 2020

I think what is actually needed is support for parted Disk Flags.

E.g. on my original system I have

# parted -s /dev/sda unit MiB print

Model: ATA QEMU HARDDISK (scsi)
Disk /dev/sda: 20480MiB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: pmbr_boot
...

but after "rear recover" I get on the recreated system

# parted -s /dev/sda unit MiB print

Model: ATA QEMU HARDDISK (scsi)
Disk /dev/sda: 20480MiB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
...

i.e. no longer any Disk Flags.

@jsmeix jsmeix modified the milestones: ReaR v2.6, ReaR v2.7 Apr 29, 2020
@github-actions
Copy link

Stale issue message

@dcz01
Copy link

dcz01 commented May 14, 2021

@jsmeix I think that this bug is important for many systems.
You should reopen it because it was closed by github-bot.
I also use some systems with the BIOS and GPT partition format with pmbr_boot flag.

@dcz01
Copy link

dcz01 commented Jul 16, 2021

@gdha Could we reopen this bug or better said feature for ReaR?

@gdha gdha reopened this Jul 16, 2021
@jsmeix jsmeix added the needs sponsorship This issue will not get solved on a voluntary base by ReaR upstream. label Jul 16, 2021
@jsmeix jsmeix modified the milestones: ReaR v2.7, ReaR future Jul 16, 2021
@jsmeix jsmeix removed their assignment Jul 16, 2021
@github-actions
Copy link

Stale issue message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The code does not do what it is meant to do enhancement Adaptions and new features needs sponsorship This issue will not get solved on a voluntary base by ReaR upstream. no-issue-activity
Projects
None yet
Development

No branches or pull requests

3 participants