0

I have now just one vfat USB stick in travelling but I still need to take backups. I get gzip: stdout: File too large because vfat's limiting files bigger than 4.3 Gb. My backup command

sudo tar czf /media/masi/KINGSTON/backup_home_9.7.2016.tar.gz $HOME/

I need to split the backup to parts. Merge it later if possible. I could start to do --exclude=/home/masi/books/ etc to limit things but it would be great to get many .jar files for the whole thing. I do empty the trash of vfat USB stick because GUI does not work for it

rm -rf /media/masi/KINGSTON/.Trash-1000/ \
    /media/masi/KINGSTON/.Trashes/ \
    /media/masi/KINGSTON/.Spotlight-V100/

I check the filesystem after emptying trash

df -T | grep KINGSTON

Filesystem     1K-blocks   Used Available Use% Mounted on
/dev/sdb1        7553040 412240   7140800   6% /media/masi/KINGSTON

I try Law29's proposal. I do

  • With 4000MB filesizes, since 4200MB not working TODO with bigger USB stick

    # http://unix.stackexchange.com/a/61776/16920
    sudo tar czf - $HOME | split /
       --bytes=4000MB - /media/masi/KINGSTON/backup_home_9.7.2016.tar.gz
    
  • I do ls -l /media/masi/KINGSTON/backup_home_9.7.2016.tar.gzaa

    -rw-r--r-- 1 masi masi 0 Jul  9 19:49 /media/masi/KINGSTON/backup_home_9.7.2016.tar.gzaa
    
  • I do df -i /media/masi/KINGSTON/ after getting an error TODO

But problem now: too big backup size for USB stick. How can you estimate the size of the tar command?

System: Linux Ubuntu 16.04 64 bit
Hardware: Macbook Air 2013-mid
USB stick: 8GB, vfat

  • @ilkkachu Here bigger file so cannot reproduce the answer of the thread here. Please, see the body. Probably, 4200 MB is too big size for backupping. However, it should not be. – Léo Léopold Hertz 준영 Jul 09 '16 at 12:18
  • 1
    Apart from the different size to split to, I can't see the distinction. split shouldn't need any extra space on the disk, so double-check that you have enough space on the drive. (That df command still shows only ~2 GB). Also, if you mean you need to split the files to multiple drives, the other question has an answer with an example of that, too – ilkkachu Jul 09 '16 at 12:35
  • 1
    Can you confirm that you have the same problem if you write --bytes=4000M? Can you add the output of ls -l /media/masi/KINGSTON/backup_home_9.7.2016.tar.gzaa and of df /media/masi/KINGSTON/ and df -i /media/masi/KINGSTON/ after you get the error? – Law29 Jul 09 '16 at 15:08
  • I think there are a lot of files on your USB stick, and that you need to delete some to make space for your backups :) You can find them using Linux even if it's Windows trash. – Law29 Jul 09 '16 at 16:57
  • I don't think you updated your df /media/masi/KINGSTON/ after emptying the trash. You may want to do a du /media/masi/KINGSTON/ | sort -g, that will show you where you have files. Also, how big is /media/masi/KINGSTON/backup_home_9.7.2016.tar.gz? – Law29 Jul 09 '16 at 17:33
  • @Law29 Yes, you are right. The backup size is too big for my USB stick. I need to get a new USB stick to do it. – Léo Léopold Hertz 준영 Jul 09 '16 at 18:22

1 Answers1

1

If you have an USB stick bigger than 4 GB and you want to put big files on it, try NTFS. (You could also use Ext[234], but you wouldn't be able to read it on Windows, while NTFS naturally works on Windows). No more worrying if your file is bigger or smaller than than 4GB.

Some graphical formatting programs will suggest NTFS as an option, otherwise man mkfs.ntfs should be enough to get you started.

I first tested Linux NTFS on an Ubuntu 12.04 and it's always worked for me.

Law29
  • 1,156