0

If I have an 8G USB and I create an installer iso, which occupies only a fraction of the available space, something like:

$ lsblk -o model,NAME,SIZE,TYPE,fstype,state /dev/sdb
MODEL            NAME    SIZE TYPE FSTYPE  STATE
USB DISK 2.0     sdb     7.5G disk iso9660 running
                 ├─sdb1  325M part iso9660 
                 └─sdb2  416K part vfat  

and

$ sudo fdisk -l /dev/sdb
Disk /dev/sdb: 7.5 GiB, 8011120640 bytes, 15646720 sectors
                        ^^^^^^^^^^ available
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: 0x64c1c041

Device     Boot Start    End Sectors  Size Id Type
/dev/sdb1  *        0 665599  665600  325M  0 Empty
/dev/sdb2        3984   4815     832  416K ef EFI (FAT-12/16/32)

(note: I'm aware these partitions aren't aligned). ISO image occupies 600k sectors out of 16 million available.
I've tried to add a partition onto the free space, so I could use it for general file storage, but my partition editor (cfdisk) threw an error.
Is it possible to add a partition and filesystem onto the free space? if so how?

5
  • 1
    You have overlapping partitions, this is not going to work. Make sure sdb1 ends before sdb2 starts, then add sdb3 to the end.
    – dirkt
    Commented Apr 27, 2018 at 9:06
  • @dirkt good spotting, but yeah Im pretty sure this installer usb works. my question is can I re-use the remaining space for general file storage? Commented Apr 27, 2018 at 9:13
  • 1
    Can you use the remaining space for general file storage? Yes, you can. Can you do this with your current partition layout? No, you can't, because, as you've observed, the partition editors will throw an error.
    – dirkt
    Commented Apr 27, 2018 at 9:15
  • @dirkt ok. that makes sense. Yes I have installed an OS from this USB. but then I played around with the partition table - this is likely when this partition sizing problem was introduced. can you recommend a basic technique to get a bootable USB which can use available device space for general storage? Commented Apr 27, 2018 at 9:22
  • @Emmanuel Rosa I find the crux of the OPs question being the fact that cfdisk throws an error instead of containerizing an ISO.
    – jdwolf
    Commented Apr 29, 2018 at 1:50

0

Browse other questions tagged .