I'm trying to backup my VirtualBox, but when I try to copy the .VirtualBox directory to my external hard drive I get an "File too large" error:
[130 amanda@luna ~]$ cp -r .VirtualBox /media/LACIE/Luna/Jun012011/VirtualBox
cp: writing `/media/LACIE/Luna/Jun012011/VirtualBox/Machines/Astro/Snapshots/{9fe69a30-d308-4754-b4e4-928eb90f93d2}.vdi': File too large
cp: writing `/media/LACIE/Luna/Jun012011/VirtualBox/HardDisks/Astro.vdi': File too large
[1 amanda@luna ~]$ ls -alh .VirtualBox/HardDisks/Astro.vdi
-rw------- 1 amanda amanda 5.0G 2010-04-30 17:41 .VirtualBox/HardDisks/Astro.vdiWhat should I be looking for here?
02 Answers
/media/LACIE sounds like you're handling a pre-formatted drive, most likely with the FAT32 filesystem. According to Wikipedia, the maximum file size for FAT32 is about 4GB.
I suggest to reformat the drive to either ext4 (for supporting Linux file permissions) or NTFS (if you need to share the drive with windows users).
How funny, but you've now to backup your backup first before reformatting ;)
2If you need to keep the fat32 filesytem there is a way around the limit.
There is a command called split that will let you split an archive into smaller parts.
-b, --bytes=SIZE put SIZE bytes per output file
Example:
dd if=/dev/zero bs=1M count=150 >test
150+0 records in 150+0 records out 157286400 bytes (157 MB) copied, 0.439344 s, 358 MB/s split test -b 10000000
ls -l 157286400 2011-06-01 21:18 test 10000000 2011-06-01 21:20 xaa 10000000 2011-06-01 21:20 xab 10000000 2011-06-01 21:20 xac 10000000 2011-06-01 21:20 xad 10000000 2011-06-01 21:20 xae 10000000 2011-06-01 21:20 xaf 10000000 2011-06-01 21:20 xag 10000000 2011-06-01 21:20 xah 10000000 2011-06-01 21:20 xai 10000000 2011-06-01 21:20 xaj 10000000 2011-06-01 21:20 xak 10000000 2011-06-01 21:20 xal 10000000 2011-06-01 21:20 xam 10000000 2011-06-01 21:20 xan 10000000 2011-06-01 21:20 xao 7286400 2011-06-01 21:20 xap
Oh and cat puts them back together.