This is due to FAT32 limitation. Files larger than 4GB cannot be stored on a FAT32 volume. Formatting the flash drive as exFAT or NTFS will resolve this issue.
WARNING: Back up your data. Formatting will delete all the data on your device.
If you don't want to reformat your USB drive or need it to be FAT32 you can simply split your big file into parts. Most archive managers come with the split option and for the command line there's split, e.g. for your case:
See man split for the full documentation.
This will create the following files:
4,0G output.file.aa
1,6G output.file.ab
The filesize of output.file.aa matches exactly the maximum file size of your FAT32 formatted USB drive, which is 4 Gibibyte (GiB, that's not the same as Gigabyte GB) minus 1 Byte. Thanks to Gilles for this important addition.
Before you can access the file again you need to merge its parts first. On Linux systems you can do so with:
Different scenarios and files systems are examined looking for alternatives taking into account
the file size problem
which operating systems that should read/write the USB drive
Linux only
If you intend to use the drive only with Ubuntu (and other linux distros), it is a good idea to use a linux file system, for example ext4. This way you might get higher read/write speed (depending on which process is the bottleneck), and you will get higher flexibility concerning ownership and permissions.
You can use the GUI program gparted to create the ext4 file system.
Full compatibility with Linux, Windows and MacOS
Windows has problems with linux file systems, and I think MacOS has problems both with linux file systems and NTFS. So if you want 'full compatibility' for reading and writing, only FAT32, UDF and exFAT remain.
FAT32 has a 4GiB (gibibyte, base 2) limit for file size.
Can be created in all three operating systems.
Maintain (repair) in Windows, if you have access to Windows.
Can be maintained in Ubuntu with dosfsck, that comes with the package dosfstools,
sudo apt-get install dosfstools
sudo dosfsck -a /dev/sdxn # least destructive option
sudo dosfsck -r /dev/sdxn # more powerful option
where x is the drive letter and n is the partition number, for example /dev/sdb1 for the first partition in drive b.
exFAT is another option. It is new compared to FAT32 and UDF and claimed to work well
natively with Windows
with MacOS
with Linux
More about exFAT
Edit August 2021:
Since this answer was written, the support for exFAT is bundled in the new versions of standard Ubuntu, so you need no extra packages to run it.
end of edit
I have started to test exFAT in Ubuntu. I intend to edit this answer, when I have more experience of using it. Let us start with the following links,
ExFAT is a proprietary file system of Microsoft optimized for
> embedded systems because it is lightweight and is better suited for
> solutions that have low memory and low power requirements, and can be
> implemented in firmware.
and this command line to install [read/write] support for exFAT in Ubuntu
sudo apt-get install exfat-utils exfat-fuse
Can be created in Windows and MacOS and in Linux with the following command line
sudo mkfs.exfat -n YOUR-LABEL /dev/sdxi
where x is the drive letter and i is the partition number, for example /dev/sdb1.
Can be maintained in Windows.
My first test results:
Creating the exFAT file system worked well in Ubuntu (16.04 LTS (64-bit), installed system with the Xenial kernel series (4.4.0-93-generic), up to date).
Writing and reading a file greater than 4 GiB were successful. Ubuntu and exFAT co-operated correctly and fast (I checked with md5sum and the speed was limited by the USB system).
Ubuntu and Windows could read what was created in the other operating system. (I have no MacOS for testing, and have to rely on the reports from other people.)
Windows
So if you want full read/write access from Ubuntu and Windows, I would suggest that you use NTFS, which has journaling and is very debugged and polished as the [proprietary] file system for Windows. (It is also possible to use exFAT.)
In Ubuntu you can use the GUI program gparted to create an NTFS file system.
In Windows it is easy to create NTFS and exFAT file systems (they are native).
UDF probably lacks tools to repair the file system,
FOSS
Maybe it is possible to find repair tools in Windows via this link: fsck tools for UDF, and there is some tool available as source code
Can be created in Ubuntu
Compatible with linux style links.
Compatible with linux style permissions. You can create and modify permissions of individual files (which is not possible with FAT and NTFS).
A UDF partition will not be prompted for formatting by Windows 10 (while the linux ext4 file system is affected, and can be destroyed by mistake).
Wipe the first mibibyte of the partition to erase the previous file system information (or other remaining data), to prevent you USB stick from being detected as a FAT after it has been formatted with UDF.
The -b 512 is to force a file system block size equal to the USB stick's physical block size, as required by the UDF specification. Adapt it if you have the luck of having a USB stick with a more appropriate block size.
After that, your USB stick will be usable for reading and writing with GNU/Linux but also with current versions of Windows (read-only with the outdated version XP). Unfortunately this version of UDF created in Linux cannot be managed by MacOS (tested in several versions of MacOS in November 2020).
MacOS
Edit August 2021: HFS+ (journaled)
Since this answer was written, I discovered that Linux can read and write HFS+ (journaled), so use Disk Utility.app on your Mac to format the partition with HFS+ (journaled) in order to have a drive (for example an external drive) that can transfer or share data between Ubuntu and MacOS.
You can also use ext4 with a workaround, Ubuntu Server with an SSH server in a virtual machine. (I think the same workaround would work also with Windows.) This may be worthwhile when you intend to access a lot of files via the drive and its file system, but probably not with a small USB2 pendrive.
Having had a simular issue and unwilling to reformat the USB stick, I just used an archiver. More or less all modern GUIs (such as File Roller, 7Zip, etc.) or CLIs allow for splitting the archive file. Set the split limit below the FAT boundary (that somewhat 4GB), for speed you can choose a low compression rate, even "store", i.e. do not compress at all, an voila!
If you have access to a Windows machine you can convert you USB-stick file system without formatting.
You should use Windows command line as follows:
press Win + R, type cmd -> OK, in the open window enter command convert X: /FS:ntfs where X: is the letter for your mounted USB-stick. In less than a minute it is ready. Enjoy.
Reformatting or using split are great options, or you could try using zip to compress the file, just know that some files are already compressed, so zipping them will make them larger. (Also you may lose file ownership, timestamps etc.)
This is due to FAT32 limitation. Files larger than 4GB cannot be stored on a FAT32 volume. Formatting the flash drive as exFAT or NTFS will resolve this issue.
WARNING: Back up your data. Formatting will delete all the data on your device.
If you don't want to reformat your USB drive or need it to be FAT32 you can simply split your big file into parts. Most archive managers come with the split option and for the command line there's
split
, e.g. for your case:See
man split
for the full documentation. This will create the following files:The filesize of
output.file.aa
matches exactly the maximum file size of your FAT32 formatted USB drive, which is 4 Gibibyte (GiB, that's not the same as Gigabyte GB) minus 1 Byte.Thanks to Gilles for this important addition.
Before you can access the file again you need to merge its parts first. On Linux systems you can do so with:
If you're afraid that this could sort the files incorrectly read In Bash, are wildcard expansions guaranteed to be in order?
The corresponding command on Windows systems is:
Along with many other useful GNU utilities
split
can be installed in Windows too, see GNU utilities for Win32.Problem: FAT32 has a 4GiB limit for file size
Different scenarios and files systems are examined looking for alternatives taking into account
Linux only
If you intend to use the drive only with Ubuntu (and other linux distros), it is a good idea to use a linux file system, for example ext4. This way you might get higher read/write speed (depending on which process is the bottleneck), and you will get higher flexibility concerning ownership and permissions.
gparted
to create the ext4 file system.Full compatibility with Linux, Windows and MacOS
Windows has problems with linux file systems, and I think MacOS has problems both with linux file systems and NTFS. So if you want 'full compatibility' for reading and writing, only FAT32, UDF and exFAT remain.
FAT32 has a 4GiB (gibibyte, base 2) limit for file size.
Can be created in all three operating systems.
Maintain (repair) in Windows, if you have access to Windows.
Can be maintained in Ubuntu with
dosfsck
, that comes with the packagedosfstools
,where x is the drive letter and n is the partition number, for example
/dev/sdb1
for the first partition in drive b.exFAT is another option. It is new compared to FAT32 and UDF and claimed to work well
natively with Windows
with MacOS
with Linux
More about exFAT
Edit August 2021:
Since this answer was written, the support for exFAT is bundled in the new versions of standard Ubuntu, so you need no extra packages to run it.
end of edit
I have started to test exFAT in Ubuntu. I intend to edit this answer, when I have more experience of using it. Let us start with the following links,
ExFAT is a proprietary file system of Microsoft optimized for
and this command line to install [read/write] support for exFAT in Ubuntu
Can be created in Windows and MacOS and in Linux with the following command line
where
x
is the drive letter andi
is the partition number, for example/dev/sdb1
.My first test results:
md5sum
and the speed was limited by the USB system).Windows
So if you want full read/write access from Ubuntu and Windows, I would suggest that you use NTFS, which has journaling and is very debugged and polished as the [proprietary] file system for Windows. (It is also possible to use exFAT.)
In Ubuntu you can use the GUI program
gparted
to create an NTFS file system.In Windows it is easy to create NTFS and exFAT file systems (they are native).
UDF probably lacks tools to repair the file system,
FOSS
Maybe it is possible to find repair tools in Windows via this link: fsck tools for UDF, and there is some tool available as source code
Can be created in Ubuntu
Compatible with linux style links.
Compatible with linux style permissions. You can create and modify permissions of individual files (which is not possible with FAT and NTFS).
A UDF partition will not be prompted for formatting by Windows 10 (while the linux ext4 file system is affected, and can be destroyed by mistake).
How to create and use UDF: Using the UDF as a successor of FAT for USB sticks
So, to use it, assuming your USB stick is
/dev/sdx
:Install the package
udftools
Create a partition table and one partition with
gparted
orgnome-disks
Wipe the first mibibyte of the target partition with the risky
dd
(double-check the command line!)Run
mkudffs
,Wipe the first mibibyte of the partition to erase the previous file system information (or other remaining data), to prevent you USB stick from being detected as a FAT after it has been formatted with UDF.
The
-b 512
is to force a file system block size equal to the USB stick's physical block size, as required by the UDF specification. Adapt it if you have the luck of having a USB stick with a more appropriate block size.After that, your USB stick will be usable for reading and writing with GNU/Linux but also with current versions of Windows (read-only with the outdated version XP). Unfortunately this version of UDF created in Linux cannot be managed by MacOS (tested in several versions of MacOS in November 2020).
MacOS
Edit August 2021: HFS+ (journaled)
Since this answer was written, I discovered that Linux can read and write HFS+ (journaled), so use Disk Utility.app on your Mac to format the partition with HFS+ (journaled) in order to have a drive (for example an external drive) that can transfer or share data between Ubuntu and MacOS.
See: https://superuser.com/questions/392702/which-file-system-to-use-in-between-osx-and-linux
end of edit
In MacOS it is possible to use FAT32 and exFAT.
You can also use ext4 with a workaround, Ubuntu Server with an SSH server in a virtual machine. (I think the same workaround would work also with Windows.) This may be worthwhile when you intend to access a lot of files via the drive and its file system, but probably not with a small USB2 pendrive.
See this link: Using ext4 on OS X Yosemite, the long but safe way
Having had a simular issue and unwilling to reformat the USB stick, I just used an archiver. More or less all modern GUIs (such as File Roller, 7Zip, etc.) or CLIs allow for splitting the archive file. Set the split limit below the FAT boundary (that somewhat 4GB), for speed you can choose a low compression rate, even "store", i.e. do not compress at all, an voila!
If you have access to a Windows machine you can convert you USB-stick file system without formatting. You should use Windows command line as follows: press
Win + R
, typecmd
->OK
, in the open window enter commandconvert X: /FS:ntfs
whereX:
is the letter for your mounted USB-stick. In less than a minute it is ready. Enjoy.Reformatting or using split are great options, or you could try using zip to compress the file, just know that some files are already compressed, so zipping them will make them larger. (Also you may lose file ownership, timestamps etc.)