Announcement

Collapse
No announcement yet.

Problem creating bootable usb thumb drives

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [SOLVED] Problem creating bootable usb thumb drives

    These days I use a thumb drive to install the latest version of Kubuntu. CD's, DVD's and my DVD Player have become redundant.
    I also use a Gparted-live usb drive to prepare disks before installation. I have discovered that pre-formatting drives tends to smooth the flow of a Linux install.

    I decided to update my version of Gparted and in doing so started to experience some anomalies that I hadn't noticed before. I downloaded the appropriate .iso and using dd, copied it across to my thumb drive.
    I will spare you the agonies that I then went through, but in brief, it followed that if I corrected the errors, a recursive partition and a partition overlap, then the program and the thumb drive ceased to function. The only sure way was to start again, to repartition and re-copy the .iso ...and then, as long as it was left in its error state, it would continue to function. Arriving at this situation appears to be a result of using dd to make the thumb drive.
    I'm not sure that apart from creating confusion (in the error messages that crop up) it is so important, but to my perfectionist inner self running programs that throw up error messages is like standing in a lift with someone who has a bad case of wind. I just wanted to get out.

    Eventually, after spending hours looking for ways to overcome this problem, I found that a manual installation, as suggested on the Gparted web-site, instantly solved the issue and also pointed directly to dd being the cause of the messages. I simply downloaded the gparted .zip file, unzipped onto a thumb drive, ran the script to make it bootable and voila - an error free working Gparted-live thumb drive.

    It was no more trouble than using dd and the end result was glitch free. I had always used dd to create my bootable thumb drives and although I'm sure it is still a viable method I will be looking at alternatives in the future.

    I thought I would share this with you, though maybe you already know...?
    ...the instructions for setting up are at http://gparted.org/liveusb.php for those who want to follow it up. I was following Method B, the manual install for Linux.

    I heartily recommend gparted-live, it is a very useful utility.
    Last edited by SteveRiley; May 26, 2015, 02:21 PM. Reason: minor grammar corrections

    #2
    I can relate to your experience. Having done enough crazy experiments, I have also encountered unexplainable issues like what you encountered (but not the same problem you are reporting).

    However ... I'm not sure about throwing the dd method out the window. (I'm kind of a dd fan, as it sounds you are.) dd is listed as Method D, so the iso image must contain everything needed to boot and use, or they would caution you; or, this is an unknown bug.

    What I would suggest is to post this at the GParted forum and ask if anyone has had the same or a similar experience; perhaps even a mod/dev might see it and respond. I've had good luck on the few occasions I've had to post there. If you happen to do so, let us know back here.

    Agree that GParted is a very good tool!

    Thanks for your post.
    An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

    Comment


      #3
      Thanks for your interest Qqmike,
      I will post at the GParted forum and will report back with any news

      *addition*
      I reported this as a bug, it seemed more appropriate.

      *further addition*
      belt n braces - its in the forums too
      Last edited by bobbicat; May 17, 2015, 11:03 AM.

      Comment


        #4
        Good! Keep us posted, as you can.
        An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

        Comment


          #5
          No results as yet from Gparted Forum or Bugzilla.

          BUT
          after more extensive Googling I seem to be part way to an answer.

          With:
          Code:
          sudo parted /dev/sdd print
          I get:
          Code:
          libparted bug found
          Invalid partition table - recursive partition on /dev/sdd.
          Performing:
          Code:
          sudo fdisk -lu /dev/sdd
          gives:
          Code:
          Disk /dev/sdd: 3.9 GiB, 4127194624 bytes, 8060927 sectors
          Units: sectors of 1 * 512 = 512 bytes
          Sector size (logical/physical): 512 bytes / 512 bytes
          I/O size (minimum/optimal): 512 bytes / 512 bytes
          Disklabel type: dos
          Disk identifier: 0x656f8811
          
          Device     Boot Start    End Sectors  Size Id Type
          /dev/sdd1  *        0 464895  464896  227M 17 Hidden HPFS/NTFS
          I found this comment which, perhaps, explains the above:
          The first partition starts at sector 0, so it includes the MBR and the partition table that contains itself. This makes it look like an extended partition recursively containing itself.
          -----------------------------------------------
          Should something be done to make the dd copy skip a few sectors to allow space for the msdos partition table? Is that even possible?

          This still doesn't address the fact that my computer cannot see that the file on the usb drive has UEFI capabilities.

          Also,is the file type reported by fdisk relevant?

          I am very much out of my depth here but I will continue tread water in the hope that a rescue is possible.

          Comment


            #6
            Nor am I the expert I'll throw some stuff out for thought.

            dd:
            Yes you can control what is written and where it is written. Use skip and seek. man dd. This time, you'd use seek, skip past 512 bytes, seek=512 bs=1; or seek=1 bs=512, etc. That would skip 512 bytes on the target flash drive.

            But, for standard stuff such as this--building GParted on a flash drive--I can't imagine any seek should be necessary, or they would tell you so at GParted.

            I think what could be going on is some confusion among the utilities/PC/whatever as to what MODE the work is being done in: is it older BIOS+MBR mode or newer UEFI+GPT mode? You want UEFI, right? And you want straight UEFI, not some hybrid like UEFI with any old MBR in use (no CSM stuff).

            So, making sure everything is always done in UEFI mode ...

            GParted live iso file: is it the amd64 version (for UEFI)?
            amd64
            64-bit version runs on x86-64 based computers, with ability to access more than 4 gigabytes of memory, and supports use of multiple processor cores.
            For newer (>2010) computers with UEFI instead of legacy BIOS try this one.
            http://gparted.org/download.php

            Booting your PC: are you booting it in UEFI mode? That would be determined by your settings in the PC's UEFI setup menus.

            Booting the flash drive: in UEFI mode?
            That's determined when you put the flash drive in the PC, re-boot, see the POST, hit the magic key on your PC to enter its UEFI-"BIOS" setup (bad terminology), and you find a list of booting options, perhaps called a Boot Override menu. You'll see the flash drive if it is bootable. In fact, you may see it listed two or more times. You want to select the flash drive instance that has the descriptor UEFI or EFI on it.

            That's all I can think of at the moment. If I can find time today, I'll try to build the GParted flash drive in UEFI and see what happens. I have done other UEFI bootable live flash drives with dd, straight iso-copying--with no problems.

            Edit

            Also, I would make sure the flash drive is clean before using it.
            Best: dd it to zeros, dd if=/dev/zero of=/dev/sdX bs=4096 (or whatever bs you like, maybe bs=1M).
            Also OK: Use GParted or a partitioning tool to delete all filesystems and partitioning and start from scratch with a GPT partition table and the rest of the drive one FAT32 partition. Of course, dd-ing the GParted iso will take over and wipe this off anyway, it will overwrite anything and everything on the flash drive to set up its own files for booting.

            gdisk
            And for any partition work with GPT, we are using gdisk, not fdisk, right?
            Last edited by Qqmike; May 18, 2015, 06:41 AM.
            An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

            Comment


              #7
              I have the correct iso - gparted-live-0.22.0-1-amd64.iso - it md5sums OK

              GParted do not specify the type of partition table for the usb drive, so I assumed a standard thumb drive would be right. I have only ever used standard (msdos partition tabled) thumb drives for my iso's in the past. They have always functioned correctly with the UEFI system.

              I created a standard clean thumb drive, using fdisk, for the results shown above.
              The drive had an msdos partition table and one full sized fat32 partition before the iso was copied across.

              I'll scrub the drive down to zero, create a GPT with a fat32 partition using gdisk and dd the iso across as before.
              ...and will post the outcome in a few minutes.

              I'll also be looking at other bootable thumb drives I have that do not have this problem. Maybe something will show up there.


              Oh and thanks for sparing your time Qqmike.


              *results*

              I'm getting the same result for both msdos and GPT partition tables. The utility boots up, declares a recursive partition on usb drive and is not recognized as UEFI by the PC.
              The same utility installed from the appropriate zip file sets up correctly, is recognized as UEFI by the PC and throws up no error messages.

              This leads me to suspect that the iso is not setting up correctly.

              I have never had this problem dding other iso's. (for example - the iso for 64bit 1504 Kubuntu vervet and also all its predecessors)
              Last edited by bobbicat; May 18, 2015, 11:53 AM.

              Comment


                #8
                This is the result for my 1504 vervet installation thumb drive, it was created by using dd with the 64bit iso on an msdos partition tabled thumb drive.
                It works fine, throwing up no errors and functioning correctly in UEFI.

                Code:
                sudo fdisk -lu /dev/sdd
                Code:
                Disk /dev/sdd: 7.5 GiB, 8053063680 bytes, 15728640 sectors
                Units: sectors of 1 * 512 = 512 bytes
                Sector size (logical/physical): 512 bytes / 512 bytes
                I/O size (minimum/optimal): 512 bytes / 512 bytes
                Disklabel type: dos
                Disk identifier: 0x000ea6ea                                                                            
                                                                                                                       
                Device     Boot Start      End  Sectors  Size Id Type                                                  
                /dev/sdd1  *       63 15727634 15727572  7.5G  c W95 FAT32 (LBA)
                If you look you will see that start in this case is not at zero, it is at 63, so the partition table is not overwritten.
                I'm now almost certain this is where the problem lies.
                Last edited by bobbicat; May 18, 2015, 12:47 PM.

                Comment


                  #9
                  Looks like you are correct -- there seems to be the problem you've identified with the iso and dd-ing it to the flash drive. I tried two versions of GParted amd64: the current version gparted-live-0.22.0-1-amd64.iso, and the previous version: gparted-live-0.21.0-1-amd64.iso.
                  Same result: My PC did not recognize it as a UEFI boot choice; it DID see it as a BIOS boot choice, though. GParted's main menu indicated it was booted in BIOS mode (it was a * footnote at bottom of a main menu screen).

                  There seems to be a problem with that iso not setting up a proper UEFI installation and bootloader.
                  An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                  Comment


                    #10
                    I'll try the skip and seek routine you mentioned above in connection with dd and see if I can create a start at sector 63. If I am successful the result might be enlightening.


                    not able to get a result, tried without success


                    I'm watching gparted forum and bugzilla but no interest is being shown there as yet
                    Last edited by bobbicat; May 19, 2015, 02:48 AM.

                    Comment


                      #11
                      I tried to post at GParted forum, couldn't do it even though I have a valid account, very frustrating: Question: Who was the creator of GParted? Pun stops bots, answer on GParted site, etc. I clicked everything and couldn't find what they expected as an answer. How the h*ll do you post there? (something I've done many times in the past)
                      An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                      Comment


                        #12
                        I got it. VERY frustrating! Bart Hakvoort
                        but I only saw this quite by accident when clicking on some Help link TWICE.

                        So I posted right after yours.
                        An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                        Comment


                          #13
                          yup - saw your post - thanks for the support
                          I went through the same maze and found the answer after Googling for it.
                          I was unable to find the answer on the Gparted web-site
                          Perhaps I'll mention that on the Gparted Forum - though I'm beginning to think there's no activity there ( apart from ourselves that is)

                          I'm not a coder so I wouldn't have a clue how to write a patch for this bug.
                          I might be barking up the wrong tree but I think I've pointed out the anomaly - its up to someone with the appropriate abilities to tackle it now.

                          It has also occurred to me that as it is a gnome based utility this isn't really the place to find the answers I'm looking for.
                          If anything positive occurs I'll post here again, but for now I think its time to let the matter rest.
                          Last edited by bobbicat; May 18, 2015, 11:30 PM.

                          Comment


                            #14
                            Like a terrier with a rat, I just can't let go...

                            Here is some discussion on the Gparted Forums, it is very relevant. I'm beginning to wonder whether the recent iso versions of Gparted are isohybrid. I might try to convert them.

                            Heres a link to 2009 and the pertinent discussion: http://gparted-forum.surf4.info/viewtopic.php?id=13581 also in 2013 http://gparted-forum.surf4.info/viewtopic.php?id=16838
                            Last edited by bobbicat; May 19, 2015, 01:41 PM.

                            Comment


                              #15
                              After more Googling and experimenting I came up with a procedure that appears to solve the problems.
                              I'm not sure that it is the right answer, just hacking really, but appears to work.

                              This is how:
                              Code:
                              download gparted-live-0.22.0-1-amd64.iso
                              install:
                              Code:
                              sudo apt-get install syslinux-utils
                              then run:
                              Code:
                              sudo isohybrid --uefi /path/to/gparted-live-0.22.0-1-amd64.iso
                              plug in your thumb drive at /dev/sdX
                              and run:
                              Code:
                              sudo dd if=/path/to/gparted-live-0.22.0-1-amd64.iso of=/dev/sdX bs=4M; sync
                              try booting up from it
                              It worked for me
                              Code:
                              sudo parted /dev/sdd print
                               
                              Model: Ut163 USB2FlashStorage (scsi)
                              Disk /dev/sdd: 4127MB
                              Sector size (logical/physical): 512B/512B
                              Partition Table: msdos
                              Disk Flags: 
                              
                              
                              Number  Start  End    Size    Type     File system  Flags
                               2      232MB  236MB  4280kB  primary               esp
                              maybe it will for you?


                              Code:
                              sudo fdisk -lu /dev/sdd
                              
                              
                              Disk /dev/sdd: 3.9 GiB, 4127194624 bytes, 8060927 sectors
                              Units: sectors of 1 * 512 = 512 bytes
                              Sector size (logical/physical): 512 bytes / 512 bytes
                              I/O size (minimum/optimal): 512 bytes / 512 bytes
                              Disklabel type: dos
                              Disk identifier: 0x656f8811
                              
                              
                              Device     Boot  Start    End Sectors  Size Id Type
                              /dev/sdd1  *         0 464895  464896  227M  0 Empty
                              /dev/sdd2       453500 461859    8360  4.1M ef EFI (FAT-12/16/32)
                              It probably needs tweaking up somewhat, its a strange looking thumb drive.
                              I'm no coder, just a cat with a mouse.

                              I'd appreciate feedback, if anyone reading this gets results or no...
                              Last edited by bobbicat; May 19, 2015, 02:12 PM.

                              Comment

                              Working...
                              X