Gparted and Disk GUI are showing different partition tables; two flash drive errors

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
red-striped-zebra
Level 3
Level 3
Posts: 139
Joined: Thu Feb 10, 2022 4:29 am

Gparted and Disk GUI are showing different partition tables; two flash drive errors

Post by red-striped-zebra »

I created a bootable 8GB usb/flash drive with Cinnamon on it. I had flashed the ISO on the drive using etcher which used the default MBR partition scheme that came with the USB. However, the Windows machine where I am trying a dualboot has UEFI. So after having already flashed the ISO, I tried converting the MBR to GPT with Command Prompt which meant formatting before creating the GPT table. Usual Windows tutorial to format is:

Diskpart > list disk > select disk 1 (the usb drive) > clean > convert gpt


However, once I entered 'clean', it showed an error (which I didn't screenshot). Window's Disk Man showed the USB as unallocated, which I thought of as partial victory, but the partition table was still MBR.

So I 'exit' without finishing the last command. I thought I might have better luck getting the job done on my other linux machine. So I opened Disk App on LM, unmounted the usb stick, and formatted the drive. Then I had--and I don't recall the exact instance of their appearance--these two errors, back to back. Obviously, I had done something stupid. Here they are:

Image

Image

So, next day, I fit the usb again to get screenshots of the Disk App so I could enquire about the goof-ups here. As an afterthought, I also took the screenshot of gparted. As it turned out, both show different partition tables.

Image

Image

Image


What have I done (so help me god!), and can I save my USB stick?

/noob
Last edited by LockBot on Wed Sep 20, 2023 10:00 pm, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
AndyMH
Level 21
Level 21
Posts: 13743
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Gparted and Disk GUI are showing different partition tables; two flash drive errors

Post by AndyMH »

This is normal.

First try with gparted, device > create partition table, select msdos. Once that is done, you can add a partition to the stick, usually fat32, or if you want exfat.

If that fails (gparted sometimes has trouble with an ISO9660 stick), you can install mkusb.

Code: Select all

sudo add-apt-repository ppa:mkusb/ppa
sudo apt update
sudo apt install mkusb
It has a "restore to standard storage device" option.
Screenshot from 2023-03-20 17-13-34.png
Basically it zaps the first few sectors of the drive, creates an msdos partition table and a fat32 partition. You can zap the drive with dd, but this is a little safer (less chance of you mistyping and ending up wiping your system drive).

When you burn an iso to a stick it creates an ISO9660 file system on it, this is the same as used for CDs.

Bit more on mkusb:
https://help.ubuntu.com/community/mkusb ... A%20drive.
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
red-striped-zebra
Level 3
Level 3
Posts: 139
Joined: Thu Feb 10, 2022 4:29 am

Re: Gparted and Disk GUI are showing different partition tables; two flash drive errors

Post by red-striped-zebra »

AndyMH wrote: Mon Mar 20, 2023 1:19 pm This is normal.

First try with gparted, device > create partition table, select msdos. Once that is done, you can add a partition to the stick, usually fat32, or if you want exfat.
Thank you Andy. I think you've answered it with regards to saving the flash drive. But with regards to using the flash drive to dual boot Cinnamon on Windows (running on UEFI mode), will the new msdos partition table on the USB suffice or do I, post-repair, format the fat32 once again and recreate GPT before proceeding with the Cinnnamon install? I thought GPT on USB is required for UEFI enabled windows.
User avatar
AndyMH
Level 21
Level 21
Posts: 13743
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Gparted and Disk GUI are showing different partition tables; two flash drive errors

Post by AndyMH »

If you are talking about installing mint to a usb stick, you can, but not recommended. The install will take a long time and you will find it slow to use. You will also wear out the stick quickly because of all the frequent writes to it. Not what they are designed for. If you want to go down this route suggest you get an SSD in a USB enclosure or if you want a smaller form factor an nvme M.2 drive in a usb enclosure.

With "erase and install" the mint installer reformats the drive, so it will put a gpt partition table on the stick. But it might have problems with the ISO9660 filesystem on it, try it and see, I've not done it. If it does then follow my advice earlier so that it appears as a 'normal' drive to the installer.

Be aware, with a UEFI install there is a bug in the installer, it puts grub, the bootloader in the first EFI partition it finds. This means it will put grub in the EFI partition on your system drive. It will work, but if you plug the stick into another computer it won't boot. Easy to fix, once you know about it, either:
  • disconnect the system drive before install, or
  • using gparted (copy on your mint install stick), disable the boot and esp flags on the EFI partition on your system drive, re-enable after install. Those flags are what tell the system it is an EFI partition.
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
red-striped-zebra
Level 3
Level 3
Posts: 139
Joined: Thu Feb 10, 2022 4:29 am

Re: Gparted and Disk GUI are showing different partition tables; two flash drive errors

Post by red-striped-zebra »

AndyMH wrote: Tue Mar 21, 2023 6:23 am If you are talking about installing mint to a usb stick, you can, but not recommended. The install will take a long time and you will find it slow to use. You will also wear out the stick quickly because of all the frequent writes to it. Not what they are designed for. If you want to go down this route suggest you get an SSD in a USB enclosure or if you want a smaller form factor an nvme M.2 drive in a usb enclosure.
No, I intend to install LM alongside the already running Windows on the laptop.
With "erase and install" the mint installer reformats the drive, so it will put a gpt partition table on the stick. But it might have problems with the ISO9660 filesystem on it, try it and see, I've not done it. If it does then follow my advice earlier so that it appears as a 'normal' drive to the installer.
So to rephrase what you said here, the mint installer on the USB will instead create a gpt partition table on the 1TB hard drive on my laptop, am I right? (Because I am not installing on the USB itself)

BTW, I suggested GPT because my 1TB drive on the Windows UEFI system also has GPT partition. That is why I originally suggested if I should convert msdos partition table to GPT after I repair the USB drive.
Be aware, with a UEFI install there is a bug in the installer, it puts grub, the bootloader in the first EFI partition it finds. This means it will put grub in the EFI partition on your system drive. It will work, but if you plug the stick into another computer it won't boot. Easy to fix, once you know about it, either:
  • disconnect the system drive before install, or
  • using gparted (copy on your mint install stick), disable the boot and esp flags on the EFI partition on your system drive, re-enable after install. Those flags are what tell the system it is an EFI partition.
this bug will work in the same way on my laptop's main hard drive as well? So I should "unmount" windows drive to prevent Linux installer to use the Window's EFI partition, am I right?
User avatar
AndyMH
Level 21
Level 21
Posts: 13743
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Gparted and Disk GUI are showing different partition tables; two flash drive errors

Post by AndyMH »

The bug is only applicable if you are trying to install mint to a separate drive. "Install alongside" with win on the same drive has no issues. I use win's disk utilities to shrink win C: and leave the space created unallocated*. The mint installer will use that space for the / partition and put grub in the same EFI partition as used by the win bootloader.

* I believe the installer can shrink win C: for you, but I prefer to do it myself.
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
red-striped-zebra
Level 3
Level 3
Posts: 139
Joined: Thu Feb 10, 2022 4:29 am

Re: Gparted and Disk GUI are showing different partition tables; two flash drive errors

Post by red-striped-zebra »

AndyMH wrote: Wed Mar 22, 2023 6:29 am The bug is only applicable if you are trying to install mint to a separate drive. "Install alongside" with win on the same drive has no issues. I use win's disk utilities to shrink win C: and leave the space created unallocated*. The mint installer will use that space for the / partition and put grub in the same EFI partition as used by the win bootloader.

* I believe the installer can shrink win C: for you, but I prefer to do it myself.
And putting the grub in the same EFI partition as used by the win bootloader should be no problem because it is not a separate drive?
So Linux doesn't need its separate EFI partition for the grub, I take it.

I will also unallocate enough space myself on C: I had a problem leaving everything to Linux last time around.
User avatar
AndyMH
Level 21
Level 21
Posts: 13743
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Gparted and Disk GUI are showing different partition tables; two flash drive errors

Post by AndyMH »

No problems with grub in the same EFI partition as win, UEFI boot allows multiple bootloaders. You do hear some horror stories about win updates wiping grub, not had it myself. What win updates can do is put win back at the top of the BIOS boot list. Easy to spot, easy to fix.

Things to do:
  • disable secure boot in BIOS, mint will install with it enabled, but some third party drivers won't load, so if you have nvidia graphics...
  • disable fast start in win - if you want read/write access to win partitions from linux, default is enabled.
  • I also turn off automatic win updates, so they happen at a time of my choosing.
For a comfortable experience with mint I'd recommend 100GB for linux, as a minimum 30GB.
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
User avatar
deck_luck
Level 7
Level 7
Posts: 1577
Joined: Mon May 27, 2019 6:57 pm
Location: R-4808 North

Re: Gparted and Disk GUI are showing different partition tables; two flash drive errors

Post by deck_luck »

If you are curious this is a Windows11 and Linux Mint dual boot example.

Code: Select all

$ sudo efibootmgr

Timeout: 5 seconds
BootOrder: 0000,0001,0009,000A,000B
Boot0000* Windows Boot Manager
Boot0001* ubuntu
Boot0009* Solid State Disk
Boot000A* Solid State Disk
Boot000B* USB Drive (UEFI) -  USB DISK 3.2 PMA

$
Right now, I am using Windows 11 on a regular basis, so I have the Windows Boot Manager as the top boot priority. Also, I can hit F9 after power on, and it will allow me to select the shimx64.efi file to start grub2 to boot Linux. If you use Linux on a regular basis you can simply put the ubuntu (Linux Mint) entry at the top and default to running grub2.


Reference:

EFI System Partition files:
/boot/efi/EFI/ubuntu/shimx64.efi -- Linux
/boot/efi/EFI/Microsoft/Boot/bootmgr.efi -- Windows11
🐧Linux Mint 20.3 XFCE (UEFI - Secure Boot Enabled) dual boot with Windows 11

Give a friend a fish, and you feed them for a day. Teach a friend how to fish, and you feed them for a lifetime. ✝️
Locked

Return to “Storage”