Monday, April 22, 2013

Format Flash Drive for Big Files on Linux

By default, flash drives are formatted with the FAT32 file system. FAT32 has a file size limit of about 4.3GB.

To get around this, you can format with a file system that supports bigger files. I chose ext4 for this, you can use ext2, ext3, or others.

Who's a big boy today?

Warnings:

  • You probably won't be able to use the flash drive on Windows machines (maybe this is what you want?)
  • Performance of flash drives under different file systems can apparently vary markedly. I didn't have any issues with mine using ext4.

Here are the commands:

$ df

Use df to find out which device is your flash drive, in my case it was /dev/sdd1. (Make sure you get this right, so you don't blat your hard drive or something).

$ umount /dev/sdd1 $ sudo mkfs.ext4 -L "BigFileDrive" /dev/sdd1

After reformatting, the drive mounted with root as the owner, so I did:

$ sudo chown ash /media/ash/BigFileDrive $ chgrp ash /media/ash/BigFileDrive

And all was well.

Update 11 Sept 2013:

Trying to run this for NTFS (on kubuntu at least) can result in:

The program 'mkfs.ntfs' is currently not installed.
You can install it by typing:
sudo apt-get install ntfs-3g

But it says it's already installed. This is a known bug, a simple workaround is to just run mkntfs rather than mkfs.ntfs.

No comments:

Post a Comment