1

I'm wondering if there's an easy way to backup files from a linux (Ubuntu, ext4) and Windows (ntfs) partition to an external harddrive (FAT32). I mainly use the linux partition and I tried using rsnapshot but I always get a slew of errors regarding copying of symlinks. I guess this is normal because FAT32 doesn't support symlinks.

Is there another way to back all these files up incrementally like what rsnapshot does while preserving permissions, symlinks, etc?

2
  • Is there a reason the external has to be FAT32? Why not reformat it to NTFS or ext2/3/4? You can use Ext2 IFS or Ext2fsd so Windows can access it, too. Commented Oct 3, 2010 at 3:06
  • ntfs won't preserve symlinks. ext you have to add drivers to windows. that's why most removable media is ntfs or fat. ntfs would be a better idea than fat though...it supports a large max file size to the method in my solution could have larger pseudo partitions. Commented Oct 3, 2010 at 4:22

3 Answers 3

1

make large files on the fat partition and mount them as a filesystems. then they can be formatted to look like native filesystems and all your symlinks/etc are preserved

3
  • Sorry, can you expand on this a bit more? Commented Oct 3, 2010 at 2:58
  • make a 4GB file of random data(think dd if=/dev/rand of=/pathtofat32/pathtofile bs=whatever count=whatever). format the file like it's a partition(mkfs.ext3 /pathtofat32/pathtofile). mount it like you would a partition(mount -o loop -t ext3 /pathtofat32/pathtofile /mountpointforthenewfilesystem). linux doesn't care if it's a file or a device. all devices are treated like files anyway Commented Oct 3, 2010 at 3:04
  • This is a good option. Your desire to back up onto a broken file system like FAT32 is going to end in tears otherwise.
    – user3463
    Commented Oct 3, 2010 at 3:21
1

Since FAT32 doesn't support symlinks, permissions, ACLs and other advanced file features of ext4 and NTFS, you can't just copy system files from a Linux or Windows system partition to a FAT32 partition.

Anyways, you can create archive packages using applications that are able to preserve those features, and save those packages to your FAT32 partition.

For example, on Ubuntu Linux you can use tar to create a backup, in a way similar to the following (I guess one can do something similar also on Windows):

# tar czvf /path/to/fat32/backup.tar.gz /

Still, you may run in problems, since FAT32 file systems can't save files bigger than 4 GB, and often happen that a system backup needs to be bigger than that.

As a workaround for this problem, you can use a command similar to this to split the archive in chunks that can be saved on your FAT32 partition (see here for details):

# tar czvf - / | split --bytes=4000MB - backup.tar.gz.

Exists other tools, like dar, that let you create backup archives and natively support automatically split on 4GB.

The 4GB limitation is really annoying, but if you use a system modern enough can be avoided formatting the partition in exFAT instead. exFAT is like FAT32, but can save files bigger than 4GB, and any system newer than Windows Vista or Mac OS X 10.6 can read and write on it.

To use it with Ubuntu, you just need to install the packages exfat-utils and exfat-fuse that should be in universe repository.

0

For Linux backup please refer to @gerlos 's answer. tar is the best practice for backing up ext filesystem.
For Windows, it's best to reboot to another installed Windows, or a Windows PE. Currently the most preferrable method to back up a NTFS volume is to use WIM. Windows has a built-in tool, the Deployment Image Servicing and Management Tool Dism.exe that can handle wim. Remember You can never back up a running Windows on itself. In the alternative Windows system (or Windows PE), run this command (case-insensitive)

Dism.exe /Capture-Image /CaptureDir:D: /Name:First /ImageFile:E:\capture.wim
Dism.exe /Split-Image /ImageFile:E:\capture.wim /SWMFile:F:\split.wim /FileSize:4000

Note that D: is the volume you want to back up, E: is a temporary place, which must support files over 4GB, and F: is the FAT32 volume.
If you are backing it up to a exFAT or NTFS place (recommended), then you don't need to split the image.
To get your backup back, go to an alternative system again and run

Dism.exe /Apply-Image /ImageFile:F:split.swm /SWMFile:F:\split*.swm /ApplyDir:D:

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .