Page 1 of 3 123 LastLast
Results 1 to 10 of 30

Thread: how to reboot in another os just once?

  1. #1

    Default how to reboot in another os just once?

    Hi
    I'm trying to figure out how to reboot just once in a different OS (Windows 10) and after rebooting from W10 it automatically comes back to opensuse at the boot screen order as default.

    I've tried some methods like these (no matter if the GRUB2_DEFAULT=0 or saved - 0 is the TW:

    Method 1:
    Code:
    sudo grub2-set-default 2
    which is the W10 place at the boot order and then
    Code:
    sudo reboot
    but it fixed the boot order to always boot on W10 although I have an option to manually change it in the boot loader screen.

    Method 2:
    same as 1 but editing /etc/default/grub and setting
    Code:
    GRUB_SAVEDEFAULT="false"
    follwed by
    Code:
    sudo grub2-mkconfig -o /boot/grub2/grub.cfg
    but the result was the same as 1

    Method 3:
    same as 2 but instead of
    Code:
    sudo grub2-set-default 2
    I used
    Code:
    sudo grub2-reboot 2
    But it did a mess in the boot! It even give me the boot options to choose from, booting directly on W10. The only solution to come back to opensuse is a recovery.

    I'll try now the method 2 again with
    Code:
    sudo grub2-once 2
    instead of
    Code:
    sudo grub2-set-default 2
    .

    Is there a way to do what I'm trying to do?

    Thank you,

  2. #2
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    26,538
    Blog Entries
    15

    Default Re: how to reboot in another os just once?

    Hi and welcome to the Forum
    So is this a UEFI boot system? If so can just use the efibootmgr command...

    Code:
    efibootmgr
    
    BootCurrent: 0004
    Timeout: 0 seconds
    BootOrder: 0002,0001,0004,0000,2001,2002,2004
    Boot0000* openSUSE
    Boot0001* sled-secureboot
    Boot0002* Windows Boot Manager
    Boot0004* opensuse-secureboot <== Current boot
    
    efibootmgr -n 2
    
    BootNext: 0002 <== Next boot
    BootCurrent: 0004
    Timeout: 0 seconds
    BootOrder: 0002,0001,0004,0000,2001,2002,2004
    Boot0000* openSUSE
    Boot0001* sled-secureboot
    Boot0002* Windows Boot Manager
    Boot0004* opensuse-secureboot
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  3. #3

    Default Re: how to reboot in another os just once?

    Hi, thank you for replying!

    I think it is not an UEFI boot system as below response:

    Code:
    ap@hpsuse:~> sudo efibootmgr
    
    EFI variables are not supported on this system.
    
    ap@hpsuse:~>
    I tried everything I've searched with no success yet.

  4. #4
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    26,538
    Blog Entries
    15

    Default Re: how to reboot in another os just once?

    Quote Originally Posted by aperali View Post
    Hi, thank you for replying!

    I think it is not an UEFI boot system as below response:

    Code:
    ap@hpsuse:~> sudo efibootmgr
    
    EFI variables are not supported on this system.
    
    ap@hpsuse:~>
    I tried everything I've searched with no success yet.
    Hi
    Ahh ok, well grub2-once should work....

    So what does the list show?

    Code:
    grub2-once --list
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  5. #5

    Default Re: how to reboot in another os just once?

    The output is it:

    Code:
         0 openSUSE Tumbleweed
         1 Advanced options for openSUSE Tumbleweed>openSUSE Tumbleweed, with Linux 5.1.7-1-default
         2 Advanced options for openSUSE Tumbleweed>openSUSE Tumbleweed, with Linux 5.1.7-1-default (recovery mode)
         3 Advanced options for openSUSE Tumbleweed>openSUSE Tumbleweed, with Linux 5.1.5-1-default
         4 Advanced options for openSUSE Tumbleweed>openSUSE Tumbleweed, with Linux 5.1.5-1-default (recovery mode)
         5 Windows 10 (on /dev/sda1)
         6 Ubuntu 18.04.2 LTS (18.04) (on /dev/sda3)
         7 Advanced options for Ubuntu 18.04.2 LTS (18.04) (on /dev/sda3)>Ubuntu (on /dev/sda3)
         8 Advanced options for Ubuntu 18.04.2 LTS (18.04) (on /dev/sda3)>Ubuntu, with Linux 4.18.0-20-generic (on /dev/sda3)
         9 Advanced options for Ubuntu 18.04.2 LTS (18.04) (on /dev/sda3)>Ubuntu, with Linux 4.18.0-20-generic (recovery mode) (on /dev/sda3)
        10 Advanced options for Ubuntu 18.04.2 LTS (18.04) (on /dev/sda3)>Ubuntu, with Linux 4.18.0-15-generic (on /dev/sda3)
        11 Advanced options for Ubuntu 18.04.2 LTS (18.04) (on /dev/sda3)>Ubuntu, with Linux 4.18.0-15-generic (recovery mode) (on /dev/sda3)
        12 Advanced options for Ubuntu 18.04.2 LTS (18.04) (on /dev/sda3)>Memory test (memtest86+, serial console 115200) (on /dev/sda3)
        13 Start bootloader from a read-only snapshot> openSUSE Tumbleweed  (5.1.7-1,2019-06-19T13:45,post,yast services-manager)
    and many other snapshots.

    I reverted the grup2.cfg as per original state.

    If I run:
    Code:
    sudo grub2-once 5
    sudo reboot
    pc reboots in windows as expected but without passing through the boot loader screen anymore and after I reboot from W10 it is always keeping booting into W10 with no boot loader screen options to choose.

  6. #6
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    12,374
    Blog Entries
    3

    Default Re: how to reboot in another os just once?

    As far as I know, "grub2-once" works by storing information in "/boot/grub2/grubenv". And grub2 is supposed to remove that information on the next boot. But grub2 is unable to write to "grubenv" if it is on a "btrfs" file system.

    Or, at least, that used to be the problem. I don't know whether it is still a problem.
    openSUSE Leap 15.1; KDE Plasma 5;

  7. #7

    Default Re: how to reboot in another os just once?

    Quote Originally Posted by nrickert View Post
    As far as I know, "grub2-once" works by storing information in "/boot/grub2/grubenv". And grub2 is supposed to remove that information on the next boot. But grub2 is unable to write to "grubenv" if it is on a "btrfs" file system.

    Or, at least, that used to be the problem. I don't know whether it is still a problem.
    Then if I want it working I'd need to reinstall opensuse with another file system type (which one?) or is there a way to change it on the go?

  8. #8
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    26,538
    Blog Entries
    15

    Default Re: how to reboot in another os just once?

    Quote Originally Posted by aperali View Post
    Then if I want it working I'd need to reinstall opensuse with another file system type (which one?) or is there a way to change it on the go?
    Hi
    If it's BIOS booting, did you create a small /boot partition?

    Code:
    lsblk
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  9. #9

    Default Re: how to reboot in another os just once?

    Quote Originally Posted by malcolmlewis View Post
    Hi
    If it's BIOS booting, did you create a small /boot partition?
    I think so. Almost sure it is on sda1. Suse is on sda4

    Code:
    NAME            MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
    sda               8:0    0 298,1G  0 disk 
    ├─sda1            8:1    0   500M  0 part 
    ├─sda2            8:2    0 242,1G  0 part 
    ├─sda3            8:3    0  27,7G  0 part 
    └─sda4            8:4    0  27,9G  0 part 
      ├─system-swap 254:0    0     2G  0 lvm  [SWAP]
      └─system-root 254:1    0  25,9G  0 lvm  /home
    sr0              11:0    1  1024M  0 rom
    I've just used the opensuse standard when I installed

    edit: looking into sda1 with Dolphin it seems to be empty

  10. #10
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    26,538
    Blog Entries
    15

    Default Re: how to reboot in another os just once?

    Quote Originally Posted by aperali View Post
    I think so. Almost sure it is on sda1. Suse is on sda4

    Code:
    NAME            MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
    sda               8:0    0 298,1G  0 disk 
    ├─sda1            8:1    0   500M  0 part 
    ├─sda2            8:2    0 242,1G  0 part 
    ├─sda3            8:3    0  27,7G  0 part 
    └─sda4            8:4    0  27,9G  0 part 
      ├─system-swap 254:0    0     2G  0 lvm  [SWAP]
      └─system-root 254:1    0  25,9G  0 lvm  /home
    sr0              11:0    1  1024M  0 rom
    I've just used the opensuse standard when I installed
    Hi
    Does look like it, what about the output from;

    Code:
    mount | grep boot
    ls /boot/grub2/
    fdisk -l /dev/sda
    Edit: Maybe sda is for windows....
    Last edited by malcolmlewis; 19-Jun-2019 at 08:57.
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •