When working with NTFS-formatted drives in Linux (Kubuntu 10.04 in this case), you need to ensure proper filesystem support. Modern Linux kernels handle NTFS well through NTFS-3G, but there are some special considerations:
# First verify NTFS support is installed: sudo apt-get install ntfs-3g mount | grep ntfs
For a complete mirror between two NTFS drives (source to destination), use this robust rsync command:
rsync -avhW --progress --delete --size-only --modify-window=1 /media/source/ /media/destination/
Let's break down these important parameters:
-a : Archive mode (preserves permissions, ownership, timestamps) -v : Verbose output -h : Human-readable numbers -W : Copy whole files (better for remote drives) --progress : Show transfer progress --delete : Remove files in destination not present in source --size-only : Quicker comparison method for NTFS --modify-window=1 : Accommodate NTFS timestamp precision differences
For large video/media backups where checksums matter:
rsync -cavhW --progress --delete --modify-window=1 \ --exclude='*.tmp' --exclude='Thumbs.db' \ /media/video_archive/ /media/backup_drive/
For scheduled backups via cron (add to crontab -e):
0 3 * * * rsync -aq --delete --modify-window=1 /mnt/primary/ /mnt/backup/ >> /var/log/rsync_ntfs.log
If you encounter permission problems due to NTFS limitations:
rsync -rltDv --no-p --no-g --chmod=ugo=rwX --modify-window=1 /source/ /destination/
For handling very large files (>4GB) on NTFS:
rsync --partial --progress --bwlimit=50000 -av /source_large_files/ /destination/
For faster transfers on local NTFS drives:
rsync -avW --inplace --no-whole-file --delete /fast_source/ /fast_dest/
When network is involved (remote NTFS share):
rsync -azv --compress-level=3 --bwlimit=10000 user@remote:/ntfs_share/ /local/backup/
When working with large storage drives (in this case, two 1.5TB NTFS-formatted drives) in a Linux environment (specifically Kubuntu 10.04), rsync emerges as the ideal tool for creating reliable backups. The challenge involves mirroring diverse file types (videos, audio, documents) while maintaining NTFS compatibility.
The fundamental command structure would be:
rsync -avh --progress /source/drive/mount/point/ /destination/drive/mount/point/
For NTFS-specific considerations, we should add:
rsync -avh --progress --modify-window=1 --no-owner --no-group /mnt/source/ /mnt/backup/
Important flags when dealing with NTFS:
--modify-window=1
: Accommodates NTFS timestamp precision differences--no-owner
and--no-group
: Avoids permission issues between filesystems--size-only
: Useful if timestamp comparisons prove unreliable
For a complete mirror that removes deleted files from destination:
rsync -avh --delete --progress --modify-window=1 \ --no-owner --no-group /mnt/media_drive1/ /mnt/backup_drive1/
Create a bash script for regular backups:
#!/bin/bash LOG_FILE="/var/log/ntfs_backup.log" echo "Starting backup at $(date)" >> $LOG_FILE rsync -avh --delete --progress --modify-window=1 \ --no-owner --no-group /mnt/media_drive1/ /mnt/backup_drive1/ >> $LOG_FILE 2>&1 rsync -avh --delete --progress --modify-window=1 \ --no-owner --no-group /mnt/media_drive2/ /mnt/backup_drive2/ >> $LOG_FILE 2>&1 echo "Backup completed at $(date)" >> $LOG_FILE
Always test with --dry-run
first:
rsync -avh --dry-run --progress --modify-window=1 \ --no-owner --no-group /mnt/source/ /mnt/destination/
For large transfers, consider these optimizations:
rsync -avh --delete --progress --modify-window=1 \ --no-owner --no-group --bwlimit=50000 /mnt/source/ /mnt/destination/
The --bwlimit
parameter (in KB/s) prevents system overload during backups.
If encountering permission errors, try:
rsync -avh --progress --modify-window=1 \ --no-perms --no-owner --no-group /mnt/source/ /mnt/destination/