Results 1 to 6 of 6

Thread: Bootable USB and Grub2 dual boot

  1. #1
    Join Date
    Jan 2020
    Beans
    3

    Bootable USB and Grub2 dual boot

    Hi guys (and girls!),
    I am new to Linux and i am having trouble with 2 different things but they are somewhat related.
    I run Linux KDE Neon (based on Ubuntu) on laptop and i have one SATA drive which is 500GB.
    It looks like this:
    Code:
    Harddrive is GPT and i´m running legacy boot but i want to change that to GPT and uefi boot!
    sda1 = Linux (ext4)
    sda2 = Windows (ntfs) msftdata (whats this?) <<- Can i make this ext4 or does windows not work then?
    sda3 = Others (ntfs) msftdata (whats this?) <<- which is for all kinds of files
    sda 4 = linux-swap (i do have 16GB of memory, do i need it? even for when i close my laptop and it goes to sleep?)
    sda 5 = fat32 (/dos flag + boot, esp) which i think i should be using for grub2...
    44 GB unused.
    Now what i would like to know first is do i have it set up correctly?
    I wish to have a dual boot (windows and linux) so i think i should have the bootloader in sda5 and not sda (main) right?
    But when i do this at linux install it does not boot. (keep in mind that i still have not installed windows 10 here)
    If i put the bootloader at sda then linux works but then why do i need a fat32 partition?

    Second problem is somewhat related so i thought let me ask it with this first problem.
    I have a USB drive which is not in GPT yet and not uefi bootable and i want to change that, currently i have used grub4dos because i want to have the following options: windows64.iso, linux64.iso, partitiontool.iso. a bootable usb menu which i can change with background image and styles. it has just a couple of files hidden on the usb drive nothing fancy and the iso are on the main drive next to them. besides that i have not hidden folders with software, drivers, tweaks, private stuff.
    What i want now is to have my laptop boot in uefi only with GPT harddrive (which it is now except for the uefi) but if i enable uefi i cant install anything because my bootable usb won't boot.
    I have gone over every forum i could find for months now but was unable to have anything that does what i want and since i have removed windows i am restricted to linux which as a newbie is hard!
    Do you know of a working version (2019/20) of how to make a bootable USB that does:
    - boot in UEFI with GPT.
    - has a menu which can be designed with background and all. (grub2???)
    - that menu can then boot the 3 isoś above (win64, linux64 and other iso's) > the ISOś should not be extracted on the usb!!! as almost all tutorials will do.
    - Simple file structure, not fancy (visible on drive)
    How should i structure the drive? do i make many partitions? or can it all go on 1 partition?
    - FAT32 partition does not work because it is only designed for <4GB files which ALL tutorials so far are using but my windows.iso is bigger than 4GB so thats why for months i could not create this USB but now on linux i have to have one because i'm stuck.
    - Do i format the partitions to ext4? (will it work on windows?) or ntfs?
    - what flags should i use?

    As you can see i'm all over the place. Thats why i come to this forum. Hope you can help me

  2. #2
    Join Date
    Jun 2009
    Location
    SW Forida
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Bootable USB and Grub2 dual boot

    You are in the chat sub-forum.
    So moved to Other Linux support since not an official Ubuntu flavor.

    Best to ask one question per post, so all posts can be about that question, otherwise it can get confusing.
    But do not double post same question. We all a volunteers and need to know what has already been suggested.

    I use grub2's loopmount to boot many ISO on one flash drive. But I do not think Windows supports that.
    Is there some issue with letting Windows have its own flash drive and everything else on another larger flash drive.

    Basically you just install grub2, create a folder for the isos and edit a grub.cfg to loop mount the isos. I find getting path and boot parameters correct as most common issue. I often have to open ISO to see what grub uses as boot parameters. And different versions use slightly different names like linux or linux.efi etc.

    How to Create a EFI/UEFI GRUB2 Multiboot USB drive to boot ISO images
    https://ubuntuforums.org/showthread....3#post13692473
    https://ubuntuforums.org/showthread.php?t=2276498

    How to Create a EFI/UEFI GRUB2 Multiboot USB drive to boot ISO images
    https://wiki.archlinux.org/index.php...boot_USB_drive
    https://wiki.archlinux.org/index.php...on_live_medium

    ISO Booting with Grub 2 from Hard drive - drs305
    https://help.ubuntu.com/community/Grub2/ISOBoot
    Examples - you may copy & edit for your path & ISO version
    https://help.ubuntu.com/community/Gr...OBoot/Examples
    https://wiki.archlinux.org/index.php...boot_USB_drive
    http://ubuntuforums.org/showthread.php?t=1549847
    UEFI grub install and example grub boot stanzas, Also Windows
    https://wiki.archlinux.org/index.php...boot_USB_drive
    For more info on UEFI boot install & repair - Regularly Updated :
    http://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to change to [Solved] when/if answered completely.

  3. #3
    Join Date
    Jan 2020
    Beans
    3

    Re: Bootable USB and Grub2 dual boot

    Thank you for assisting me and for changing the sub-forum for me.

    I only have 1 USB so i would like to have it all on one.
    I'm not sure if windows iso can be installed from a iso on usb, do you? (so far i haven managed to find the right 'code' to in my menu.lst on grub4dos. (but now i plan to go for grub2)

    for Grub2 should i have 1 partition or more? i think so.
    But i am having trouble doing that with gparted.

    The second link i already tried but i can upload a file larger then 4GB and it does not work. outdated?
    The links from arch linux also don't work
    Problems with the others is that they extract files and not leave the iso intact on the usb drive.
    And they almost always make it a fat32 drive.

    Do i need to have uefi first enabled and have linux installed through uefi settings in order to make a uefi bootable usb?
    Last edited by ayudha; 4 Weeks Ago at 06:38 PM.

  4. #4
    Join Date
    Jun 2009
    Location
    SW Forida
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Bootable USB and Grub2 dual boot

    All the links work for me.

    A few ISO are not configured to boot using grub2's loopmount. So then you have to at least extract kernel & initrd files to boot. I had to do that with Puppy years ago, but only have used Ubuntu, gparted and a couple others in recent history.

    I am almost positive that grub will not boot Windows ISO. I did once use grub to boot a Windows 7 repair flash drive, but that was not an ISO.

    I always forget to run 'sudo update-grub' when updating or changing an ISO. So I now use a standard configfile entry in grub that does not change and a text file with all the grub2 loopmount boot stanza in my ISO folder.

    Most of the time now, I have ISO on SSD & HDD and loopmount those to install on the other drive. And my larger flash drives are now full Ubuntu installs with data partition. I often then include an ISO or two in data partition, but full install is often all I need for repairs.

    FAT32 will not support any file over 4GB.
    Most Linux ISO are not that large, but newer Windows now has a .win file that is over 4GB and will not work on FAT32.

    I just installed 20.04 to a new NVMe drive from my sdb drive, which became sda as I unplugged a M.2 SATA drive. But had to unmount isodevice.

    Unable to umount isodevice unmount ISO
    https://bugs.launchpad.net/ubuntu/+s...y/+bug/1155216
    sudo umount -l -r -f /isodevice
    Last edited by oldfred; 4 Weeks Ago at 06:34 PM.
    For more info on UEFI boot install & repair - Regularly Updated :
    http://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to change to [Solved] when/if answered completely.

  5. #5
    Join Date
    Jan 2020
    Beans
    3

    Re: Bootable USB and Grub2 dual boot

    Even if i try linux iso's i can't get a functioning usb drive like i want. all i get is a drive that has extracted linux files and then boots in uefi.
    I also can't seem to get the right answers on how to structure a usb, if i do have a site/manual then it doesn't go into cli details so still i´ll mess up.
    What has worked is: FAT32 uefi boot but then there isn't a iso that can be booted its just a drive that has files extracted and it isn't ntfs.
    It seems impossible, cause i have been looking at this same kind of thing for a few years now.

  6. #6
    Join Date
    Jun 2009
    Location
    SW Forida
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Bootable USB and Grub2 dual boot

    I really recommend USB3, but all my USB3 flash drives are large & I only wanted focal on this one. But it is sloooow.

    Code:
    Model: USB 2.0 USB Flash Drive (scsi)
    Disk /dev/sdb: 4052MB
    Sector size (logical/physical): 512B/512B
    Partition Table: gpt
    Disk Flags: 
    
    Number  Start   End     Size    File system  Name   Flags
     1      1049kB  4051MB  4050MB  fat32        focal  msftdata
    I could not use newer grub 2.04, but 2.02 works.
    2.04 Out of memory error loop mount
    https://bugs.launchpad.net/ubuntu/+s...2/+bug/1851311

    I installed grub to flash drive & created ESP & folder for ISO.
    Worked without creating /EFI first.
    sudo grub-install --target=x86_64-efi --boot-directory=/media/fred/FOCAL/EFI/BOOT --efi-directory=/media/fred/FOCAL --removable


    Code:
    fred@fred-Z170N-focal:/media/fred/FOCAL$ ll
    total 36
    drwxr-xr-x  7 fred fred 4096 Dec 31  1969  ./
    drwxr-x---+ 3 root root 4096 Jan 20 13:52  ../
    drwxr-xr-x  2 fred fred 4096 Oct 23 12:34  .disk/
    drwxr-xr-x  3 fred fred 4096 Nov  4 17:48  EFI/
    drwxr-xr-x  2 fred fred 4096 Jan  8 15:47  ISO/
    -rw-r--r--  1 fred fred 4635 Oct 15 14:49  NewInstall.txt
    drwxr-xr-x  2 fred fred 4096 Nov 12 14:19 'System Volume Information'/
    drwxr-xr-x  5 fred fred 4096 Oct 26 17:41  .Trash-1000/
    Created UEFI grub.cfg
    Code:
    fred@fred-Z170N-focal:/media/fred/FOCAL/EFI/BOOT$ cat grub.cfg
    search.fs_uuid DBB9-51F6 root hd0,gpt1 
    set prefix=($root)'/EFI/BOOT/grub'
    configfile $prefix/grub.cfg
    Then created grub.cfg to boot ISO.

    Code:
    fred@fred-Z170N-focal:/media/fred/FOCAL/EFI/BOOT/grub$ cat grub.cfg
    
    set color_normal=cyan/blue
    set color_highlight=white/blue
    
    
    menuentry "Focal Live ISO" {
    set isofile="/ISO/focal-desktop-amd64.iso"
    loopback loop (hd0,1)$isofile
        linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=$isofile toram noeject
        initrd (loop)/casper/initrd
    }
    
    menuentry "Reboot" {
        reboot
    }
    
    menuentry "Halt" {
        halt
    }
    Code:
    fred@fred-Z170N-focal:/media/fred/FOCAL/ISO$ ll
    total 2540936
    drwxr-xr-x 2 fred fred       4096 Jan  8 15:47 ./
    drwxr-xr-x 7 fred fred       4096 Dec 31  1969 ../
    -rw-r--r-- 1 fred fred 2601910272 Jan  6 07:53 focal-desktop-amd64.iso
    For more info on UEFI boot install & repair - Regularly Updated :
    http://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to change to [Solved] when/if answered completely.

Bookmarks

Posting Permissions

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