[opensuse] How can I set a GPT partition flag?
Hi, Seeing that I can not select a predefined boot entry of my choice in grub2 (see thread "Grub 2 question: can I configure a default entry?", I have an alternate method possible: Gestor:~ # parted /dev/sda print Model: ATA ST2000DM001-1CH1 (scsi) Disk /dev/sda: 2000GB Sector size (logical/physical): 512B/4096B Partition Table: gpt Disk Flags: Number Start End Size File system Name Flags 1 1049kB 8389kB 7340kB primary bios_grub 2 8389kB 21.5GB 21.5GB ext4 primary legacy_boot 3 21.5GB 37.6GB 16.1GB linux-swap(v1) primary 4 37.6GB 38.7GB 1078MB ext2 primary 5 38.7GB 39.7GB 1077MB ext2 primary Change the "legacy_boot" flag to partition 5 or back when needed. I just have to find a command that does that easily, on the command line. man parted: set partition flag state Change the state of the flag on partition to state. Supported flags are: "boot", "root", "swap", "hidden", "raid", "lvm", "lba", "legacy_boot", "irst" and "palo". state should be either "on" or "off". So I think it would be: parted /dev/sda set 5 on But I get: Gestor:~ # parted /dev/sda set 5 on parted: invalid token: on Flag to Invert? ^C Gestor:~ # I see no examples in the man page. Ideas? -- Cheers / Saludos, Carlos E. R. (from openSUSE Leap 42.1 x86_64 (test)) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Hello, On Sun, 24 Jul 2016, Carlos E. R. wrote:
Number Start End Size File system Name Flags 1 1049kB 8389kB 7340kB primary bios_grub 2 8389kB 21.5GB 21.5GB ext4 primary legacy_boot 3 21.5GB 37.6GB 16.1GB linux-swap(v1) primary 4 37.6GB 38.7GB 1078MB ext2 primary 5 38.7GB 39.7GB 1077MB ext2 primary
Change the "legacy_boot" flag to partition 5 or back when needed. I just have to find a command that does that easily, on the command line.
man parted:
set partition flag state Change the state of the flag on partition to state. Supported flags are: "boot", "root", "swap", "hidden", "raid", "lvm", "lba", "legacy_boot", "irst" and "palo". state should be either "on" or "off".
So I think it would be:
parted /dev/sda set 5 on
$ parted --help Usage: parted [OPTION]... [DEVICE [COMMAND [PARAMETERS]...]...] [..] COMMANDs: [..] set NUMBER FLAG STATE change the FLAG on partition NUMBER ^^^^ toggle [NUMBER [FLAG]] toggle the state of FLAG on partition NUMBER So, try: parted /dev/sda set 5 legacy_boot on parted /dev/sda set 2 legacy_boot off Or: parted /dev/sda toggle 2 legacy_boot parted /dev/sda toggle 5 legacy_boot HTH, -dnh -- Most people would say I write code like I've already lost my mind. -- Randal L. Schwartz -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 2016-07-24 16:34, David Haller wrote:
So I think it would be:
parted /dev/sda set 5 on
$ parted --help Usage: parted [OPTION]... [DEVICE [COMMAND [PARAMETERS]...]...] [..] COMMANDs: [..] set NUMBER FLAG STATE change the FLAG on partition NUMBER ^^^^ toggle [NUMBER [FLAG]] toggle the state of FLAG on partition NUMBER
So, try:
parted /dev/sda set 5 legacy_boot on parted /dev/sda set 2 legacy_boot off
Huh, of course! I forgot to say which flag! How could I not see it? :-o -- Cheers / Saludos, Carlos E. R. (from 13.1 x86_64 "Bottle" at Telcontar)
24.07.2016 14:21, Carlos E. R. пишет:
set partition flag state
...
Gestor:~ # parted /dev/sda set 5 on parted: invalid token: on Flag to Invert? ^C Gestor:~ #
I see no examples in the man page. Ideas?
Read manual page carefully once more? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
participants (3)
-
Andrei Borzenkov
-
Carlos E. R.
-
David Haller