Announcement

Collapse
No announcement yet.

Is there a way to recover a failed dual boot of Kubuntu and MS Windows on a Lenovo L14 laptop?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    Sorry, OP is forum-speak for "original poster", the poster that started the thread, pwrcul. I've seen it used to mean "original post", but the context normally makes it clear which.
    Regards, John Little

    Comment


      #17
      Windows does tend to stuff things up for linux, but there is one suggestion I can advise you to make. When manipulating the partitions, ensure your EFI partition is at least 300mb. Windows normally makes one of 100mb and it is barely big enough for Windows, let alone dual booting. I use gparted but the Kubuntu version will do the same thing, I just find gparted easier.
      So you need to:
      1)firstly install Windows from scratch, ensure it boots and works.
      2)boot to a live linux usb stick
      3)increase the size of the EFI partition to 300mb and ensure it is formatted fat32. You may have to move the Windows partition to give you enough room, that will take a long time.
      4)reboot and check your Windows still works
      5)insert Kubuntu usb stick and boot to it.
      6)When creating partitions for Kubuntu make the operating system / at least 40gb, and create a separate /home partition of at least 50gb for your personal data, and a swap partition of at least half your ram size
      9)after the install check both systems still work properly.
      10) if you can't boot to linux use the "boot rescue disk" by Yannis to sort out your boot issues, easier than stuffing around with chroot.
      11) if you want to go the chroot route, this is how (my notes are after the ####):


      Code:
      # Get the device names for your efi and linux partition This is my setup, yours will be different.
      
      mint mint # blkid
      /dev/sda1: LABEL="SYSTEM" UUID="B60D-32FF" TYPE="vfat" PARTLABEL="EFI system partition" PARTUUID="6d09393a-d11d-4a7e-9638-566b2b7ec749"       #### EFI partition
      /dev/sda3: LABEL="w10" UUID="D006D1BA06D1A1B0" TYPE="ntfs" PARTUUID="fdd8d8c1-3781-49ca-bfad-683f48c97353"                                    #### my windows 10 partition  
      /dev/sdb1: LABEL="data" UUID="F2E89BB2E89B7397" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="1ce6123a-1742-4ca4-9b71-c495bca489af"  #### my data partition
      /dev/sdc1: LABEL="tv" UUID="6E66CE4866CE112F" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="d9118715-a532-4b4f-8ba0-01fe09c65398"    #### my media partition
      /dev/sdd1: LABEL="MULTISYSTEM" UUID="65F1-D88E" TYPE="vfat" PARTUUID="300fa8d0-01"                                                            #### this live pendrive partiton
      /dev/loop0: UUID="2017-06-29-12-08-24-00" LABEL="Linux Mint 18.2 KDE 64-bit" TYPE="iso9660" PTUUID="68783b88" PTTYPE="dos"                    #### this live pendrive partiton                                                              
      /dev/loop1: TYPE="squashfs"                                                                                            #### this live pendrive partiton    
      /dev/sda2: PARTLABEL="Microsoft reserved partition" PARTUUID="43852976-bf57-4529-8270-e79250147ad3"                          #### windows system partition    
      /dev/sda4: PARTUUID="5051ddbb-5210-4a06-8d8b-a118df3f07ca"                                                                                    #### legacy bios unused partition
      /dev/sda5: UUID="1a3fdcc8-9e28-4095-8d7b-9e09fbc56ad2" TYPE="ext4" PARTUUID="4c431bce-ca10-4920-afec-726808f6864c"                            #### LINUX PARTITION
      /dev/sda6: UUID="fb717962-1a1e-4a3b-9c45-1b1181ada463" TYPE="swap" PARTUUID="7b044993-325f-4c6f-9026-b445d5a3799c"                            #### swap partition
      /dev/sda7: LABEL="home" UUID="9afe46e7-60d5-44ae-b73b-adde2d7617fd" TYPE="ext4" PARTUUID="55f3f4ae-48a9-4156-841a-ad44405639eb"              #### Home partition                                                                                                        
      
      # Setup chroot environment
      
      mint mint # mount /dev/sda5 /mnt                                                                                  
      mint mint # mount /dev/sda1 /mnt/boot/efi                                                                            
      mint mint # mount --bind /dev /mnt/dev                                                                                
      mint mint # mount --bind /dev/pts /mnt/dev/pts                                                                          
      mint mint # mount --bind /proc /mnt/proc
      mint mint # mount --bind /sys /mnt/sys
      
      #  Chroot command, (note the /bin/bash environment variable is only sometimes required, it will occasionally fail without it)
      
      mint mint # chroot /mnt /bin/bash
      
      # Now we are in a chroot environment, we issue the commands to repair grub2
      
      mint / # grub-install /dev/sda
      Installing for x86_64-efi platform.
      Installation finished. No error reported.
      
      mint / # update-grub
      Generating grub configuration file ...
      using custom appearance settings
      Found linux image: /boot/vmlinuz-4.10.0-30-generic
      Found initrd image: /boot/initrd.img-4.10.0-30-generic
      Found linux image: /boot/vmlinuz-4.8.0-53-generic
      Found initrd image: /boot/initrd.img-4.8.0-53-generic
      File descriptor 24 (/dev/rfkill) leaked on lvs invocation. Parent PID 4971: /bin/sh
        /run/lvm/lvmetad.socket: connect failed: No such file or directory
        WARNING: Failed to connect to lvmetad. Falling back to internal scanning.                 #### I have no idea what this error means, it doesn't affect the repair.
      Adding boot menu entry for EFI firmware configuration
      done
      
      # Press ctrl+d to exit the chroot, or just type quit or exit.
      
      mint / # exit
      
      # Cleanly unmount the chroot
      
      mint mint # umount /mnt/dev/pts
      mint mint # umount /mnt/dev
      mint mint # umount /mnt/proc
      mint mint # umount /mnt/sys
      mint mint # umount /mnt/boot/efi
      mint mint # umount /mnt
      mint mint #
      
      #  Reboot and you are done.  You should now have your grub2 boot screen.  I always run update-grub after the linux system boots to add entries not added in chroot.
      
      ​
      I hope this helps, Tony
      Asus Z270i7 16gb rm 8tb GT1660 Haupp Quad tuner Kubuntu Jammy/Win 11 Be/FE mythtv 0.34Homerun dual netwk tuner 55¨ Smsng QN95B55" Lap Smsng NP R580 i5 nvidia linux Ultimate/Win 10

      Comment


        #18
        Originally posted by oshunluvr View Post
        I trust you didn't mess with /boot/efi - the EFI partition. The warning you probably got was it telling you it was too small. It's not. Just some developer got it in their head that the EFI partition should be 300MB which isn't necessary. 60GB is more than enough to dual boot Windows and Linux. I think windows usually defaults to 150 or 256MB so you get the warning from Kubuntu installer.
        oshunluvr I have found when dual booting many flavours of linux the partitioning step will not complete and just fail and not allow the install to complete when it detects the size of the EFI partition is too small.
        Tony
        Asus Z270i7 16gb rm 8tb GT1660 Haupp Quad tuner Kubuntu Jammy/Win 11 Be/FE mythtv 0.34Homerun dual netwk tuner 55¨ Smsng QN95B55" Lap Smsng NP R580 i5 nvidia linux Ultimate/Win 10

        Comment


          #19
          Originally posted by barfly View Post

          oshunluvr I have found when dual booting many flavours of linux the partitioning step will not complete and just fail and not allow the install to complete when it detects the size of the EFI partition is too small.
          Tony
          That is the installer griping, not the actual need for a large EFI partition.
          However, there probably some distros that do put all or most of /boot into it, instead of just /boot/efi

          Comment


            #20
            I've been trying things and reading guides and answers to question.
            I decided to try going into the kubuntu install live dvd version of etc and see what happens
            My naive attempt to go to etc/default/grub got me:
            kubuntu@kubuntu:~$ sudo update-grub
            /usr/sbin/grub-probe: error: failed to get canonical path of `/cow'.
            kubuntu@kubuntu:~$

            I think I need to set up a mount point and chroot first as described in https://unix.stackexchange.com/quest...al-path-of-cow
            I began reading the history and syntax of chroot....
            I need to deepen my background in linux....
            Neon 18.04.1 User on desktop and on Asus Transformer 3 Pro laptop

            Comment


              #21
              Yes, you need to chroot from the live session.

              https://help.ubuntu.com/community/Gr...ing#via_ChRoot
              Skip step 3, 4, 5

              or
              https://forum.level1techs.com/t/reinstall-grub/134056
              or

              https://www.youtube.com/watch?v=FIAxzzE45Sg

              These all have some minor variations, but are doing the same things overall.

              Comment


                #22
                I'm extra cautious so I checked multiple guides after invoking fdisk -l
                None said what to do about my two EFI partitions.
                One is early on in the list; my impulse is to do sudo mount just the first one on p1 before doing the chroot.
                Or is there a way to check further?
                Device Start End Sectors SizeType
                /dev/nvme0n1p1 2048 534527 532480 260M EFI System
                /dev/nvme0n1p2 534528 567295 32768 16M Microsoft reserved
                /dev/nvme0n1p3 567296 131090431 130523136 62.2G Microsoft basic data
                /dev/nvme0n1p4 996118528 1000214527 4096000 2G Windows recovery environment
                /dev/nvme0n1p5 131090432 356370431 225280000 107.4G EFI System
                /dev/nvme0n1p6 356370432 358418431 2048000 1000M Linux filesystem
                Neon 18.04.1 User on desktop and on Asus Transformer 3 Pro laptop

                Comment


                  #23
                  When I got busy with other things I missed barfly's contributions and am back after running sudo blkid to try to figure out partitions
                  kubuntu@kubuntu:~$ sudo blkid
                  /dev/nvme0n1p1: LABEL="SYSTEM" UUID="4638-560E" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="EFI system partition" PARTUUID="62aef6fa-1dcd-43
                  80-a111-e901d17ef9d8"
                  /dev/nvme0n1p3: TYPE="BitLocker" PARTLABEL="Basic data partition" PARTUUID="fe1a5251-01c0-4df0-80ce-8461159d2eaa"
                  /dev/nvme0n1p4: LABEL="WinRE_DRV" BLOCK_SIZE="512" UUID="B4C23B82C23B483E" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="7192e7
                  16-269b-4374-9559-a1e0d025c998"
                  /dev/nvme0n1p5: UUID="91603f16-9b63-4bcf-b21f-b52ac97447ce" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="c5e1278b-5eda-4160-9e5c-a432509a6c90
                  "
                  /dev/nvme0n1p6: LABEL="swap" UUID="45a677d4-9dcb-4123-8b86-323a0a7109e6" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="3b84baae-2a24-4b01-9945
                  -60e3ccb1033b"
                  /dev/loop1: BLOCK_SIZE="131072" TYPE="squashfs"
                  /dev/nvme0n1p2: PARTLABEL="Microsoft reserved partition" PARTUUID="b92e42d8-444e-449b-8217-992d58ec75f4"

                  I believe that tells me not to worry about the p5 label of EFI system from fdisk -l since it is my Linux partition and formatted ext4.
                  I think my p1 at 260 MB will be large enough for both Win11 and Kubuntu and it is formatted as vfat.
                  Neon 18.04.1 User on desktop and on Asus Transformer 3 Pro laptop

                  Comment


                    #24
                    My first attempt to set up the chroot generated an error when I launched the second command. When I followed the suggestion to use dmesg to find more it generated a lengthy message which overwrote my previous work.

                    I had felt subjectively ready. I was following the guide, https://www.youtube.com/watch?v=FIAxzzE45Sg especially in the text part below the video.
                    Commands used in this video: Mount root partition:
                    sudo mount /dev/sdXY /mnt (example: sudo mount /dev/sda3 /mnt)
                    Mount boot partition (if applicable): sudo mount /dev/sdXY /mnt/boot (example: sudo mount /dev/sda2 /mnt/boot)
                    Mount EFI System partition (if applicable): sudo mount /dev/sdXY /mnt/boot/efi (example: sudo mount /dev/sda1 /mnt/boot/efi)


                    From memory my first command was successful in that there were no error messages:
                    sudo mount /dev/nvme0n1p5​ /mnt

                    My second command generated an error with the suggestion to use dmesg
                    sudo mount /dev/nvme0n1p​1 /mnt/boot/efi

                    Adding dmesg generated pages of messages. I do not have an idea about interpreting them. I have not listed any of them.

                    I think there is an automatic limit to messages but I don't know how to control it. I would like to see if I can recover the earlier message.

                    I will wait before throwing in the towel and check more.
                    I don't know what a better second command would have been.
                    Neon 18.04.1 User on desktop and on Asus Transformer 3 Pro laptop

                    Comment


                      #25
                      Now, again, why are you chrooting?
                      Because you are going to do what? and where in the OS are you wanting to do it?
                      (You may not even need to mount everything.)
                      An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                      Comment


                        #26
                        I wrote this chroot how-to for UEFI (and for BIOS) systems.
                        https://www.kubuntuforums.net/forum/...l=1#post537598

                        I don't want to confuse you here.
                        I am NOT an expert in this, but I have chrooted a lot (in the past) as I experimented in fixing broken systems, mainly reinstalling GRUB.
                        My how-to (in that link) may or may not shed light on this for you.
                        At the time, I DID test it quite a lot, but YMMV ...
                        When I wrote it, I researched it, like you are doing. Some chroot guides worked for me, some didn't.
                        I tried to assemble common elements in my how-to.
                        But, as I say, YMMV.
                        An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                        Comment


                          #27
                          If you use that how-to, ignore any formatting you see in the code boxes.
                          Code:
                          Example:
                          root@kubuntu:/# grub-install
                          Installing for x86_64-efi platform.
                          Installation finished. No error reported.
                          
                          root@kubuntu:/# update-grub
                          Generating grub configuration file ...
                          ... etc. ...
                          done​
                          Ignore any bold code formats, like B or /B -- do not type the B's!
                          I have to edit and fix that in the how-to.

                          EDIT: I copied that code box into here. The original (from my how-to) had B tags in the line: root@kubuntu:/# grub-install.
                          But they are gone now (I didn't delete the B's).
                          Anyway, if you read the how-to, you will probably see some bold "B" "/B" code tags. Ignore them, do not type them.
                          Last edited by Qqmike; Jun 13, 2024, 08:35 PM.
                          An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                          Comment


                            #28
                            After being occupied all day with other work, tonight I read relevant parts of Qqmike's guide.
                            It was interesting.

                            It seemed to deal with a situation different from mine though similar.

                            I have a pragmatic goal: fixing my dual boot effort.

                            To contextualize my situation. I am trying to overcome a problem I created for myself by inadequately installing kubuntu alongside Win11 on a Lenovo L14 laptop.
                            It will not boot kubuntu now. It automatically boots Win11.

                            I am looking for suggestions that overcome the problems I ran into in doing a chroot to fix the problem I created.


                            Can I assume the first mount command has succeeded and I can pick up after then?​ I got no errors.

                            Should I have done a mount command before the one that includes the efi partition. If so, where? or how?

                            Can I repeat the error I made that includes the efi partition and this time focus on its message (rather than running dmesg)?

                            Thanks to all who offered advice and suggestions.
                            Neon 18.04.1 User on desktop and on Asus Transformer 3 Pro laptop

                            Comment


                              #29
                              That how-to addresses steps for chrooting, so you can reinstall GRUB, so you can boot into Kubuntu.
                              But now that you started on a path, you better stick to it and get your original questions addressed.
                              An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                              Comment


                                #30
                                Originally posted by pwrcul View Post
                                After being occupied all day with other work, tonight I read relevant parts of Qqmike's guide.
                                It was interesting.

                                It seemed to deal with a situation different from mine though similar.

                                I have a pragmatic goal: fixing my dual boot effort.

                                To contextualize my situation. I am trying to overcome a problem I created for myself by inadequately installing kubuntu alongside Win11 on a Lenovo L14 laptop.
                                It will not boot kubuntu now. It automatically boots Win11.

                                I am looking for suggestions that overcome the problems I ran into in doing a chroot to fix the problem I created.


                                Can I assume the first mount command has succeeded and I can pick up after then?​ I got no errors.

                                Should I have done a mount command before the one that includes the efi partition. If so, where? or how?

                                Can I repeat the error I made that includes the efi partition and this time focus on its message (rather than running dmesg)?

                                Thanks to all who offered advice and suggestions.
                                It looks as though you have both win and Kubuntu installed ok, but cannot boot to kubuntu, only windows.

                                Easy way out-download this from Sourceforge boot from this on a thumbdrive and let it do its thing, it will sort your boot issues. You may have to do the GRUB_DISABLE_OS_PROBER=false in /etc/default/grub afterwards​:

                                The forum has truncated the link just copy and paste the one below it into your address bar of your browser.
                                https://sourceforge.net/projects/boot-repair-cd/
                                Last edited by barfly; Jun 15, 2024, 10:14 AM. Reason: The forum truncates the link
                                Asus Z270i7 16gb rm 8tb GT1660 Haupp Quad tuner Kubuntu Jammy/Win 11 Be/FE mythtv 0.34Homerun dual netwk tuner 55¨ Smsng QN95B55" Lap Smsng NP R580 i5 nvidia linux Ultimate/Win 10

                                Comment

                                Working...
                                X