I need to produce a custom live Lubuntu version on a 2GB pendrive. But don't have the pen right now, so I need to test it with the 16GB that I have at hand. The system won't start the live version if this pen is formatted to full capacity (tested on Dell and HP computers), but found that one possible solution is to format it at a smaller size. What would be the command to do so? Currently I'm using sudo mkdosfs -F 32 -I /dev/sdb1, and get the expected 14.5GB available storage.

Update: from the selected answer

$sudo fdisk /dev/sdb
> p
> n
> p
> 1
> [Intro]
> +2G
> p
> w

/dev/sdb1 tells me that the drive is partitioned. You will have to repartition the drive so that the first partition is limited to 2 GB or less, and then create the FAT32 file system on this partition.

EDIT: as an alternative solution, you can tell mkdosfs to limit the file system size, instead of using the whole partition. According to the mkdosfs man page, you can specify a block count as the last parameter after the device name. I guess the block size is 512 bytes, so the number of blocks would be 2G divided by 512.

  • What are the commands to do so? – nightcod3r Mar 20 '17 at 12:19
  • Use fdisk if you want to use a traditional MBR partition table or gdisk to create a GPT partition table. Repartitioning destroys all data currently on the drive. – Johan Myréen Mar 20 '17 at 12:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.