"physical block size is 2048 bytes, but Linux says it is 512" when formatting USB - How to create a bootable USB without this error

I was using:

dd  if=/path/to/my/ubuntuiso/ubuntu.iso  of=/dev/sdb1  bs=4M  &&  sync

In order to create bootable Ubuntu USB drives on older Ubuntu versions. It was working perfectly. Sometimes I used the Startup Disk Creator program, which worked well.

But when I use the same methods on Ubuntu 16.04 LTS, I get some warnings while formatting it afterwards.

The installation media works as expected, but when I try to format that USB stick after my work is done, I get the following warning :

enter image description here

The partitioning of that Pendrive looks strange :

enter image description here

And it also shows my 16GB pendrive as 64GB.

After struggling a lot with Gparted, I will somehow format it. But Why is it happening like this ?? Is there any better methods of creating bootable Ubuntu in 16.04 ?

EDIT : there is a related question here. But my question is not about how to format it properly. My question is "How to create a bootable USB without that errors." & "Wht are the causes of that error"


Solution 1:

A command-line method to make a live USB for UEFI systems

Please note: this deletes all data on the target device.

Install prerequisite:

sudo apt-get install p7zip-full

Assuming the target USB is at /dev/sdb

(please check first with lsblk or gnome-disks or sudo fdisk -l and be sure you know what you are formatting)

Make sure the device has no mounted filesystem and unmount it if necessary, for example:

udisksctl unmount -b /dev/sdb1

Destroy existing partition table:

sudo sgdisk --zap-all /dev/sdb

Create new GPT:

sudo sgdisk --new=1:0:0 --typecode=1:ef00 /dev/sdb

Format as FAT32:

sudo mkfs.vfat -F32 /dev/sdb1

Check it:

sudo fdisk -l /dev/sdb

Should output something like:

Device     Start      End  Sectors  Size Type
/dev/sdb1   2048 15663070 15661023  7.5G EFI System

Mount the drive and extract iso onto it, replacing 'name-of-iso' with the actual filename of the iso you downloaded earlier

sudo mount -t vfat /dev/sdb1 /mnt
sudo 7z x name-of-iso -o/mnt/

Unmount

sudo umount /mnt

Now reboot & enjoy Ubuntu ^_^

(Here's where I originally learned to do this.)

Solution 2:

Here's how I solved the problem of getting this error when trying to reformat a USB after using it as installation media:

  • First open the Disks Application under Applications > Disks
  • Select the bootable pen drive.
  • There will be an option menu on top right corner
  • Select the Format drive option (CTRL + F)
  • A pop-up will be shown. Select 0 partition and format the disk
  • Now the disk will be empty but it will be not recognized by system. But you can see on Disks Application.
  • Select the pen drive and re-format it. Now the pendrive can be detect by any system.

The accepted answer is too complex to use, as it required lots of typing and remembering the particular disk name (otherwise you may end up with serious problem). Mine is super easy to implement.