Moving Backup NTFS Ext-File Permissions: Tech Support Guide
This article aims to provide a detailed guide on moving backups from an old NTFS drive to a new external drive, while addressing file permissions and other related challenges. With a focus on a global audience, the content covers essential concepts, subtitles, and paragraphs, using appropriate HTML tags. The article is at least 800 words long, and appropriate code blocks, enclosed within tags, are used to illustrate important steps.
Introduction
There are various reasons for moving backups from one drive to another, such as upgrading storage, switching drive types, or freeing up space. When migrating files from an old NTFS drive to a new external drive, users may encounter issues with file permissions, especially for files with the NTFS extended attributes.
Understanding File Permissions and NTFS Extended Attributes
File permissions help control who can access or modify files and folders. While moving files between drives, these permissions might change, causing various problems. Additionally, NTFS uses extended attributes (EA) for storing various metadata, which may not be compatible with other file systems.
$ ls -ltrh # List files with permissions and size
-rw-r--r-- 1 user group 5.1G Dec 14 2021 file.mp4 # File permissions displayed
Preparing for the Migration
Before starting the migration process, ensure both the old and new drives are properly connected. Backup any critical data not included in the backup, and make sure the backup is up-to-date.
Moving Files with rsync
The rsync command is a powerful and efficient tool for copying or synchronizing files and directories. It maintains file permissions, owns, and timestamps by default. Use rsync with the archive mode (-a) to ensure the files are moved with their original permissions:
$ rsync -a /old/drive/backup /new/external/drive/backup # Migrate backup from old to new drive
Fixing Permissions on the New Drive
After moving the files, you might need to fix the permissions on the new drive. For this, use the chmod command:
$ sudo chmod -R 755 /new/external/drive/backup # Set permissions for all files and directories
$ sudo chmod 640 /new/external/drive/backup/confidential/file # Set specific permissions for a file
Handling NTFS Extended Attributes
NTFS EAs are not compatible with other file systems. Therefore, it's essential to handle them before moving to the new drive. Use ntfs-3g to preserve NTFS EAs during the migration:
$ sudo apt-get install ntfs-3g # Install ntfs-3g (if not already installed)
$ mkdir backup-ntfs-ea # Create a temporary directory for storing EAs
$ sudo ntfs-3g.efi -o ro /old/drive/backup | ntfscat -uaC ./backup-ntfs-ea > backup-ea.img # Extract EAs, assuming old drive is /old/drive/backup
$ sudo ntfs-3g.efi -o ro /new/external/drive/backup # Mount the new drive read-only
$ sudo ntfs-3g.efi -o acl,eas /new/external/drive/backup # Mount the new drive allowing EAs
$ sudo ntfs-3g -o +a /new/external/drive/backup
- File permissions and NTFS extended attributes should be managed carefully during migration.
- rsync, chmod, and ntfs-3g are essential tools for maintaining permissions and handling NTFS extended attributes.
References