Most of us are aware of the need to remove large media files (and for those of us who are fond of virtual machine applications like VirtualBox to remove virtual disk images) from the filesystem before creating backup images so that the resultant *.iso image remains at a size less than 4 GB.
However, it is possible to sidestep this 4 GB limit when using USB flash drives (UFD's) if one desires to do so.
This discussion presumes that readers are already familiar with using remastersys and have previously created at least one *.iso image so that a reasonable estimate of the size of the *.iso image is possible. To accomplish this fully it will be necessary to rerun remastersys to create a new /home/remastersys/remastersys/ISOTMP folder which reflects changes that will be made to the source Ubuntu installation after certain modifications are made.
Step 1: Edit your /etc/modules file to add the following lines and restart Ubuntu:
#Hotplug USB Flash Drives
This should ensure that hotplugged USB drives are recognized and automatically mounted.
Step 2: Select a UFD which is considerably larger than required to store the *.iso image file. (Warning - contents of the UFD will be lost so use a blank UFD.)
Step 3: Plug in the UFD (it should be recognized and automatically mounted) and start Gparted. Click in drop down box in the upper right corner of Gparted and carefully select the device which represents your UFD device (/dev/sdb?). Unmount the drive's sole partition with Gparted and delete this partition.
Step 4: Create a new partition on the UFD of a size slightly smaller than the total capacity of the UFD minus the amount required to hold the *.iso image - e.g. if your anticipated image size is ~1.7 GB, and your UFD total capacity is 7.46 GB, size the first partition to be about 5.5 GB or slightly less. Format the partition with an NTFS filesystem. MS Windows recognizes only the first partition on a UFD (by design) and if the partition is formatted as NTFS, you will be able to read and write to this partition from within MS Windows as well as from Ubuntu. Label the partition with a name which is meaningful to you such as "shared".
Step 5: Create another partition on the UFD which uses the remaining space - e.g. 1.91 GB and format this partition with a FAT32 filesystem. This partition will be used for the *.iso image and I believe that Ubuntu's "Startup Disk Creator" requires a FAT32 filesystem. Label this partition with another meaningful name - e.g. "ubuntu". Now change the flag for this partition to mark it "boot". Close Gparted.
Step 6: Unplug the UFD and plug it in again. It should again be recognized and now the two partitions on the drive will automatically be mounted. (You may need to restart Ubuntu for this to happen.) With Ubuntu the partitions will typically be mounted under /media/your_partition_name e.g. /media/shared and /media/ubuntu, but verify the path for later use. This path should be repeatable each time the UFD is inserted and is part of the reason for labeling the partitions. Create folders on the NTFS partition and copy your large media files to the folders on this NTFS partition, and if you wish, also create a folder to hold your virtual disk files and copy these files to this folder.
Step 7: Change search paths for your media applications to include the new folders on the UFD and change the designated location for disk image files in your virtual machine application to point to the folder which contains the virtual disk files on the UFD. (These changes can be reversed after we are finished, if desired.)
Step 8: Run remastersys and create a "new" image file which will incorporate the changes made in steps 1,6, and 7.
Step 9: Open Ubuntu "Startup Disk Creator", select the new *.iso image and carefully select the "ubuntu" partition in the dropdown box - e.g. /dev/sdb2. (This is the other part of the reason for why we labeled the partitions.) Now make your UFD startup disk, as usual. (This step did not work for me in an Ubuntu virtual machine with VirtualBox running on a MS Windows host so it might be necessary for you also to perform this in a pure Ubuntu environment.)
Step 10: Test the UFD startup device on a machine. Once Ubuntu is fully booted, the NTFS partition should automatically mount at the predicted path - e.g. /media/shared and will be available to Ubuntu applications.
I found it difficult to state this clearly, so I apologize if some of the instructions are not clear.
It works great for me and has allowed me to have a UFD startup disk with access to virtual machines.
I hope it works for you!
p.s. There is a remote possibility that a clever individual could extrapolate this procedure to work with optical disks but I do not know how to do so. I vaguely remember once creating a CD which contained both a UDF and an ISO9660 filesystem on the same disk, so perhaps the *.iso could be placed in an ISO9660 filesystem and the "shared" folder in a UDF filesystem on the same DVD.