Page 1 of 5 123 ... LastLast
Results 1 to 10 of 46

Thread: openSUSE 13.1 have to restore Grub

Hybrid View

  1. #1
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,964

    Default openSUSE 13.1 have to restore Grub

    This is a bit confusing story. I will try to keep to the main path I am following now, but I guess a bit of background information is needed.

    The system is good old BIOS and MSDOS partitioning.
    This is (still) a 13.1 system. This is it's fstab:
    Code:
    /dev/disk/by-id/ata-ST2000DM001-1CH164_Z1E89L2J-part2    /    ext4    acl,user_xattr    1 1  
    /dev/disk/by-id/ata-ST2000DM001-1CH164_Z1E89L2J-part5    /home    ext4    acl,user_xattr    1 2 
    /dev/disk/by-id/ata-ST2000DM001-1CH164_Z1E89L2J-part1    swap    swap    defaults    0 0 
    boven.henm.xs4all.nl:/home/wij                /home/wij nfs    noauto        0 0 
    tmpfs                            /tmp    tmpfs    size=25%,uid=root,gid=root,mode=1777 0 0
    and fdisk -l
    Code:
    Disk /dev/sda: 2000.4 GB, 2000398934016 bytes, 3907029168 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 4096 bytes
    I/O size (minimum/optimal): 4096 bytes / 4096 bytes
    Disk label type: dos
    Disk identifier: 0x00006df8
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1            2048    14684159     7341056   82  Linux swap / Solaris
    /dev/sda2   *    14684160    56629247    20972544   83  Linux
    /dev/sda3        56629248    98590719    20980736   83  Linux
    /dev/sda4        98590720  3907028991  1904219136    f  W95 Ext'd (LBA)
    /dev/sda5        98592768   518014975   209711104   83  Linux
    Usage:
    sda1 as Swap
    sda2 is ext4 and mounted as /
    sda3 is unused and planned for a new / on installing a new system
    sda4 is extended
    sda5 is ext4 and mounted as /home
    a lot of free space where a new /home for a new installation is planned.

    Time to upgrade to 15.1. I installed 15.1 using:
    sda1 as Swap
    sda3 as ext4 (no Btrfs) for /
    a new sda6 of 200GB as ext4 (no zfs) for /home
    This basicaly went well (although there was one lib.... package which gave an error having an incorrect cheksum, it was skipped). Updated from the Update repos. Now I do have problems getting KDE Plasma to run.(after a few seconds it returns to the login screen). But as I can start at least one other DE, I consider the system as such and the users as configured correct.

    The main reason installing on two free partitions is to have the old 13.1 still available for my wife doing what she wants until a full takeover to the new 15.1 can take place.
    Grub menu shows four lines: two for 15.1 and two for 13.1, So it detected the other system.

    But, booting from 13.1 takes me to a running green ruler (different greens below) instead of the 13.1 Gecko on a branch) and hitting esc show me the text in large VGA characters. After a lot of fast scrolling (I see upping the network, and starting LSB), it abrubtly stops, Black screen. Can do nothing except Ctrl-Alt-Del which restarts the system.

    I tried to recover to the 13.1 Grub. Using the 15.1 as rescue system: booted, CTRL-Alt-F1 to the console,
    Code:
    mount /dev/sda2 /mnt
    mount --bind /dev /mnt/dev
    mount --bind /proc /mnt/proc
    mount --binf /sys /dev/sys
    chroot /mnt
    mount -a
    This indeed brings me to the 13.1 systems with all files (including in /home) available.
    Start
    Code:
    yast
    brings me the ncurses version. Start the boot module.
    From there, I am stuck. I changed several things there and hoped that at the end Grub would be installed overwriting the 15.1 grub, but always I get the 15.1 menu back and the same lousy booting of 13.1

    Anybody any suggestions how to recover the 13.1 grub (and forget for the time being the 15.1 installation, that can always be done again).
    Henk van Velden

  2. #2

    Default Re: openSUSE 13.1 have to restore Grub

    I would guess that the grub coming with 13.x (/boot/grub...) was overwritten by the new installation of 15.1 (boot device /dev/sda2 ? - as that partition is marked with a * )

    If you have network you could try chroot-ing into your 13.x installation, /boot/grub... should be populated, and do a forced re-install all of the grub packages of 13.x with yast or zypper, then run the bootloader setup.

    This might fix it.




    P.S. BACKUP your data, just in case.

  3. #3
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,964

    Default Re: openSUSE 13.1 have to restore Grub

    Hm, I would never have thought that the installation would write to a file system it is not using during installation. But you could be right (because of the *). Thanks for the suggestion. I will check my backups.
    Henk van Velden

  4. #4
    Join Date
    Dec 2008
    Location
    FL, USA
    Posts
    2,080

    Default Re: openSUSE 13.1 have to restore Grub

    Quote Originally Posted by hcvv View Post
    Hm, I would never have thought that the installation would write to a file system it is not using during installation. But you could be right (because of the *). Thanks for the suggestion. I will check my backups.
    Writing a boot flag does not constitute writing to a partition. All it does is change the location of the flag within the partition table if one previously existed, or add one if not.

    This could be key to why this problem arose. You may have installed 13.1 originally with generic MBR code, and Grub on 13.1's sda2 only. Chrooting into 13.1 to update Grub would then repair /dev/sda2 without touching the MBR code that the 15.1 installer wrote, which continues loading Grub from sda3. If during chroot you would write generic code to the MBR, then due to the location of the flag, boot would go immediately to the 13.1 Grub installed on sda2. The other option would be to switch 13.1 to booting from MBR in YaST while in chroot, which would write 13.1's Grub code to MBR and update grub.cfg on sda2 and whatever is necessary in /etc/grub.d/ and/or /etc/default/grub.

    With booting according to the flag (via generic MBR code) and Grub on / configured for both 13.1 and 15.1, switching boot control becomes a simple matter of moving the flag, which could at least in theory be done even booting a DOS floppy, a simple and painless table manipulation process.

    I always keep generic code in the MBR, which boots according to the boot flag location (which Grub and Grub2 both ignore), and keep Grub either on / or nowhere at all that any individual OS knows about.
    Reg. Linux User #211409 *** multibooting since 1992
    Primary: 15.1,TW,15.2 & 13.1 on Haswell w/ RAID
    Secondary: eComStation (OS/2)&15.1 on 965P/Radeon
    Tertiary: TW,15.2,15.1,Fedora,Debian,more on Kaby Lake,Q45,Q43,G41,G3X,965G,Cedar,Caicos,Oland,GT218&&&

  5. #5
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,964

    Default Re: openSUSE 13.1 have to restore Grub

    Sorry for being more or less a noob on Grub.

    The situation of a few things as it is now:
    Boot flag is on sda2.
    I use ncurses yast in the chrooted 13.1. Boot module.
    There is a main list there where I have Boot from MBR.
    There is a more detailed screen behind it (which also shows kernel parameters, boot screen timers, etc.) where I checked both
    . Set active flag in Partition table for Boot partition
    . Write generic Boot code to MBR.
    yast says it writes things and it takes a few secs, thus I assume something is done.
    This gives still the grub menu belonging to the 15.1 installtion on boot .
    Henk van Velden

  6. #6
    Join Date
    Dec 2008
    Location
    FL, USA
    Posts
    2,080

    Default Re: openSUSE 13.1 have to restore Grub

    Quote Originally Posted by hcvv View Post
    There is a main list there where I have Boot from MBR.
    ...
    Write generic Boot code to MBR.
    These two are incompatible with each other. Boot from MBR generally means put Grub on MBR, but that would overwrite the generic code. The organization of those options since 13.1 has been improved. You need to choose one or the other. You need the boot flag on sda2 if MBR contains generic code and Grub is on root partition sda2. If booting from MBR with Grub on MBR, everything else should be unchecked.
    Reg. Linux User #211409 *** multibooting since 1992
    Primary: 15.1,TW,15.2 & 13.1 on Haswell w/ RAID
    Secondary: eComStation (OS/2)&15.1 on 965P/Radeon
    Tertiary: TW,15.2,15.1,Fedora,Debian,more on Kaby Lake,Q45,Q43,G41,G3X,965G,Cedar,Caicos,Oland,GT218&&&

  7. #7
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,964

    Default Re: openSUSE 13.1 have to restore Grub

    Quote Originally Posted by mrmazda View Post
    These two are incompatible with each other. Boot from MBR generally means put Grub on MBR, but that would overwrite the generic code. The organization of those options since 13.1 has been improved. You need to choose one or the other. You need the boot flag on sda2 if MBR contains generic code and Grub is on root partition sda2. If booting from MBR with Grub on MBR, everything else should be unchecked.
    I changed "Boot from MBR" into "Boot from root partition" leaving other thing as they were explained above. No luck.
    Henk van Velden

  8. #8
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,964

    Default Re: openSUSE 13.1 have to restore Grub

    @mrmazda.

    Let me try to express what I understand from this.

    In the MBR there can be so called "generic boot code", which means that there can also be some specific boot code.

    I assume my situaton is that in the MBR there is now 15.1 specific boot code and that there should be generic boot code.

    For some reason the writing of this generic boot code (overwriting the 15.1 boot code) does not work.

    Am I right that the crucial question is how we can force that?
    Doing it with YaST bootloader from the chrooted 13.1 seems to fail.
    I assume that in principle doing it from 15.1 must also be possible, after all it is the same MBR and the code is generic in both cases.
    (The 15.1 has the problem that KDE does not work, so again ncurses yast must do it).
    Henk van Velden

  9. #9
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,964

    Default Re: openSUSE 13.1 have to restore Grub


    I use 15.1 and set Generic boot code to MBR. Now the system says:
    Missing Operating System

    ERROR: No boot disk has been detected ....
    Henk van Velden

  10. #10
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    13,341
    Blog Entries
    3

    Default Re: openSUSE 13.1 have to restore Grub

    Quote Originally Posted by hcvv View Post
    @mrmazda.

    Let me try to express what I understand from this.

    In the MBR there can be so called "generic boot code", which means that there can also be some specific boot code.

    I assume my situaton is that in the MBR there is now 15.1 specific boot code and that there should be generic boot code.

    For some reason the writing of this generic boot code (overwriting the 15.1 boot code) does not work.
    I was never sure whether that generic boot code is put back at later updates.

    You can put generic boot code there yourself, fairly easily.

    Code:
    cd /usr/share/syslinux
    cat mbr.bin > /dev/sda
    If you are squeamish about the use of "cat" there, you could alternatively use (from same directory)
    Code:
    dd if=mbr.bin of=/dev/sda bs=440 count=1
    However, the size of "mbr.bin" should be 440 bytes, so the "cat" does about the same thing.

    You can do that in 15.1. It's generic boot code, so it isn't important which version it comes from.

    Hmm, if we go back far enough, "syslinux" was not automatically installed. It is part of a 15.1 install, and I'm pretty sure that it was already part of a 13.1 install.

    Am I right that the crucial question is how we can force that?
    Doing it with YaST bootloader from the chrooted 13.1 seems to fail.
    I assume that in principle doing it from 15.1 must also be possible, after all it is the same MBR and the code is generic in both cases.
    (The 15.1 has the problem that KDE does not work, so again ncurses yast must do it).[/QUOTE]
    openSUSE Leap 15.1; KDE Plasma 5;
    testing Leap 15.2Alpha

Page 1 of 5 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
  •