Recovering Deleted Shared Link Permissions on NTFS

Abstract: Fix NTFS permission denied errors on Linux by configuring uid, gid, and mask options in /etc/fstab to map Windows ownership correctly.

Created: 2026-08-21 by

NTFS shared link permissions on Linux are restored by remounting the partition with explicit uid, gid, and fmask options, not by recovering deleted ACLs. The ntfs-3g driver maps Windows ownership to Linux users at mount time. This guide explains how to configure these parameters in /etc/fstab to resolve access issues.

Understanding NTFS Permission Mapping on Linux

When you connect an NTFS drive to a Linux system, the kernel does not natively understand Windows Access Control Lists (ACLs) in the same way it understands POSIX permissions. Instead, the ntfs-3g driver (or the newer ntfs3 driver in recent kernels) presents the entire filesystem as a single user or group. This is why you often see files owned by root or your current user regardless of their actual Windows permissions. The concept of "deleted shared link permissions" is a misnomer in this context. You are not recovering lost metadata from the disk. Rather, you are configuring how the Linux kernel translates the static NTFS structure into dynamic Linux permissions. If your links or files appear inaccessible, it is because the mount options do not grant your user account the necessary read or write capabilities. This behavior is distinct from standard ext4 or btrfs partitions. On those systems, permissions are stored in the inode. On NTFS, they are virtualized at the point of entry. Therefore, fixing the issue requires adjusting the mount configuration rather than running data recovery tools. For more context on managing dual-boot environments where such drives are common, you might find our guide on Double Booting Windows 11 and Ubuntu 20.04 LTS on a New HDD helpful for understanding cross-platform storage challenges.

Identifying the Current Mount Configuration

Before making changes, you must identify how the drive is currently mounted. Open a terminal and use the mount command filtered for ntfs:
mount | grep ntfs
You will likely see output similar to this:
/dev/sdb1 on /media/user/Data type ntfs-3g (rw,nosuid,nodev,allow_other,default_permissions,uid=1000,gid=1000)
Pay close attention to the uid and gid values. These numbers represent the User ID and Group ID of the user who should own all files on that partition. If these IDs do not match your local user account, you will encounter permission denied errors when trying to create or modify files. To find your current user's ID, run:
id -u
id -g
Compare these outputs with the uid and gid in your mount line. If they differ, this is the root cause of your access issues. Additionally, check the fmask and dmask values if present. These masks determine the default permissions for files and directories respectively. A mask of 0077 means only the owner has access, while 0002 allows group write access.

Editing fstab for Permanent Permissions

The most robust solution is to edit the /etc/fstab file. This ensures that your permissions settings persist across reboots and are applied consistently every time the drive is connected. First, back up your current fstab:
sudo cp /etc/fstab /etc/fstab.bak
Then, open the file for editing:
sudo nano /etc/fstab
Locate the line corresponding to your NTFS partition. It will look something like this:
/dev/disk/by-uuid/XXXX-XXXX  /media/data  ntfs-3g  defaults  0  0
Replace defaults with specific options that define your desired ownership and permissions. Here is a template for a typical home user setup:
/dev/disk/by-uuid/XXXX-XXXX  /media/data  ntfs-3g  uid=1000,gid=1000,fmask=113,dmask=002  0  0
Let's break down these parameters:
  • uid=1000: Sets the owner of all files to the user with ID 1000 (usually the first created user).
  • gid=1000: Sets the group owner to the primary group of that user.
  • fmask=113: This octal value removes execute permissions for others and read/write for others. It effectively sets files to 644 (readable by all, writable by owner).
  • dmask=002: This allows group members to write to directories, setting them to 775.
If you want broader access for other users on the machine, you can adjust the masks. For example, fmask=000,dmask=000 would make all files world-readable and writable, which is generally insecure but useful for temporary media sharing. After saving the file, unmount and remount the drive to apply changes:
sudo umount /media/data
sudo mount -a
Verify the new permissions using ls -l /media/data. All files should now show your user as the owner.

Alternative: Using udisksctl for Temporary Access

If you cannot edit /etc/fstab due to administrative restrictions, or if you need a quick fix for a removable drive, you can use udisksctl. This tool manages storage devices via the D-Bus interface and respects user policies. To mount a drive with specific permissions without editing fstab, use:
udisksctl mount --block-device /dev/sdb1 --no-block -o uid=1000,gid=1000
This command mounts the device temporarily. Once you log out or reboot, the drive will be unmounted, and the next manual mount will revert to system defaults unless you update your policykit rules. This method is less reliable for persistent workflows but useful for troubleshooting. For users experiencing hardware-related issues during such operations, such as sudden disconnects causing corruption, refer to our article on Troubleshooting System Freezes after Changing Processors or GPUs on Linux, as unstable power delivery can sometimes corrupt mount states.

Troubleshooting Common Errors

Even with correct fstab entries, you may encounter errors. The most common is "Wrong fs type, bad option, bad superblock." This usually indicates a mismatch between the driver specified in fstab and the installed kernel modules. Ensure you have ntfs-3g installed:
sudo apt install ntfs-3g
Another issue is the drive mounting as read-only. This happens if the NTFS volume has an inconsistent journal state, often caused by unsafe removal from Windows. In this case, boot into Windows and perform a full shutdown (not hibernation), or use the Windows chkdsk utility to fix the volume. If you still face permission issues, check the SELinux context. Some distributions enforce strict security policies that override standard Unix permissions. Use restorecon -Rv /media/data to reset contexts to their default values.

Frequently Asked Questions

Why do my files show as owned by root?

This occurs when the mount options specify uid=0 or omit the uid parameter entirely. By default, some systems mount removable media as root for security. Explicitly setting uid=your_user_id in fstab resolves this immediately.

Can I recover original Windows ACLs on Linux?

No, the standard ntfs-3g driver does not preserve or map Windows ACLs to Linux permissions. It uses a flat mapping strategy. You can view raw ACLs using getfattr if they are stored on the disk, but Linux applications will ignore them unless you use specialized drivers or WSL.

What is the difference between fmask and dmask?

fmask applies to regular files, stripping bits from the default 777 permission set. dmask applies to directories. For example, fmask=113 results in 644 permissions, while dmask=002 results in 775 permissions.

Is ntfsfix safe to use for permission errors?

ntfsfix repairs basic filesystem inconsistencies and clears dirty flags, but it does not change ownership or permission mappings. It is useful if the drive won't mount due to corruption, but it will not fix "Permission Denied" errors caused by UID/GID mismatches.

How do I handle multiple users needing access?

Create a shared group (e.g., smbshare) and add all relevant users to it. Set the gid in fstab to this group's ID. Then, use dmask=002 and fmask=013 to allow group write access to directories and group read access to files.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More