4

I have a USB drive (whatever size) that I write an ISO to. After writing the image to the drive it only shows the partition size as the size of the ISO image with no additional space to write to. I need to be able to write additional data to the drive for additional setup that needs to be done for my specific machine but I can't access the other parts of the USB.

For example, with a 32Gb USB, after writing an image, the drive only shows the capacity as 2.4Gb with no additional space. When I open GParted and select the drive (/dev/sdb) it shows the capacity as 32Gb but says the Used portion is -- and the Unused is --. The file system shows gray and ISO9660 and its unable to mount.

All of the programs I have used that write an ISO to the USB reduce the size of the USB to the size of the ISO image and you lose all the extra space that is on the USB. I would like to be able to create a bootable USB with the terminal command line and just write the contents of the ISO to the USB in a separate process (not using dd or any of the image writing programs since these all reformat the drive to the size of the ISO), or, is there a way to reclaim the extra space of data after writing the ISO?

I can't find any way to make a USB bootable from the command line without writing an ISO image. I find plenty of instructions for making a USB bootable from Windows with diskpart, but I don't have that option available as I have completely migrated to Linux.

1 Answers1

2

Make Bootable USB with No Wasted Space from Ubuntu.

There are several methods of making a bootable USB in Ubuntu.

Basic categories are Persistent install and Full install

For a comparison see: Use Ubuntu on external hard drive in 2 different devices? . Instructions for Full install USB are included.

The main reason to make a Persistent install is to create a USB that can be used to install Ubuntu.

The best tool for doing this is mkusb, see: https://help.ubuntu.com/community/mkusb , mkusb will create a drive that will run Ubuntu and save between sessions, (Persistence), It can also create a NTFS data partition to be used by Linux or Windows like a normal USB.

enter image description here

enter image description here

The easiest tool for making a Live USB, that can be used for installing Ubuntu, comes with Ubuntu and is called Startup Disk Creator. It overwrites the whole disk as you mention in the question.

The useless space resulting from a SDC install can be easily converted to a NTFS or FAT32 data partition useful for data storage and transportation like mkusb.

Procedure Legacy Boot

  • Run Startup Disk Creator, dd. Disks or Etcher to create Live 19.10, or later, USB

  • Boot new Live USB to activate writable partition, (AKA casper-rw), then Power Off.

  • Reboot the Live USB toram. (press shift when booting, hit F6 and type a space and toram).

  • Unmount writable/casper-rw partition using Disks.

  • For NTFS open Terminal and run:

sudo mkfs.ntfs -f -L data /dev/sdx3

were x is the drive letter of the new Live USB

For FAT32 use:

sudo mkfs.vfat -F 32 -n data /dev/sdx1

The drive should now have the original data space minus the size of the OS ISO.

Procedure UEFI Boot

Same as Legacy Boot however at GRUB menu press e. After the words quiet splash type a space then toram. Press F10 to continue boot.

C.S.Cameron
  • 20,530
  • 12
  • 78
  • 125