How to mount NTFS partition so I have ownership?

Forum rules
Before you post please read this
Post Reply
adpace
Level 1
Level 1
Posts: 5
Joined: Tue Mar 05, 2019 1:18 am

How to mount NTFS partition so I have ownership?

Post by adpace » Tue Mar 05, 2019 1:29 am

I just built my first Linux box with Mint 19.1 Cinnamon. I used a windows pc that has 2 hard drives that were both ntfs. I formatted the c drive and successfully installed Mint. It shows me as the owner of the drive, and everything is great. The second drive however shows as root owner. My account name is ari. I've tried
sudo chown ari:ari /media/ari/[the name of the drive] -R
sudo chown ari:ari /media/ari/[the name of the drive] -R -v
sudo chown ari: /media/ari/[the name of the drive] -R

The terminal shows the hard drive and all of it's directories being updated with no failure message. It successfully returns to a ready command prompt. It is not changing the ownership however. I can cd into it and and ls -l and see ownership as root, no matter what I try. Every thread I've read says the same thing, but it's not working. I can see the drive from linux (it is read only), I have no trouble getting it to automatically mount.

I spoke with a buddy who said he came across this an vaguely remembers it being how the drive was mounting in his case. Any help would be greatly appreciated, I'm pulling my hair out with this one!
Last edited by xenopeek on Tue Mar 05, 2019 2:57 am, edited 1 time in total.
Reason: split from solved topic and moved here, clarified subject assuming the second drive is still NTFS

User avatar
WharfRat
Level 21
Level 21
Posts: 13142
Joined: Thu Apr 07, 2011 8:15 pm

Re: How to mount NTFS partition so I have ownership?

Post by WharfRat » Tue Mar 05, 2019 8:56 am

Hello adpace Image

Welcome to Linux Mint and the Linux Mint forum :)

You can chown and chmod til the cows come home and owner:group and permissions will not change because the NTFS file system does not store that information.

There are mount options uid=1000,gid=1000 to set the owner:group and dmask=002,fmask=111 to set permissions.

Basically they are faked via the ntfs-3g NTFS driver mount options.

So mount -t ntfs-3g -o defaults,noatime,utf8,dmask=002,fmask=111,uid=1000,gid=1000 /device /mointpoint will allow read/write

Good luck :wink:
ImageImage

adpace
Level 1
Level 1
Posts: 5
Joined: Tue Mar 05, 2019 1:18 am

Re: How to mount NTFS partition so I have ownership?

Post by adpace » Tue Mar 05, 2019 11:50 pm

Awesome, going to give this a try. I'll let you know how it turns out. Thanks again!

adpace
Level 1
Level 1
Posts: 5
Joined: Tue Mar 05, 2019 1:18 am

Re: How to mount NTFS partition so I have ownership?

Post by adpace » Thu Mar 07, 2019 5:18 am

Can you elaborate a bit on the /device and /mountpoint ? I'm not able to get it to work. I've tried a few combinations, but get different errors.
/media/ari/6E2EA16F2EA1314F is the hard drive. I've tried:

Code: Select all

 sudo mount -t ntfs-3g -o defaults,noatime,utf8,dmask=002,fmask=111,uid=1000,gid=1000 /6E2EA16F2EA1314F /media/ari
ntfs-3g: Failed to access volume '/6E2EA16F2EA1314F': No such file or directory

Code: Select all

sudo mount -t ntfs-3g -o defaults,noatime,utf8,dmask=002,fmask=111,uid=1000,gid=1000 /media/ari/6E2EA16F2EA1314F
mount: /media/ari/6E2EA16F2EA1314F: can't find in /etc/fstab.

Code: Select all

sudo mount -t ntfs-3g -o defaults,noatime,utf8,dmask=002,fmask=111,uid=1000,gid=1000 /6E2EA16F2EA1314F /media/ari/6E2EA16F2EA1314F
ntfs-3g: Failed to access volume '/6E2EA16F2EA1314F': No such file or directory
Thanks again for your help!

User avatar
AndyMH
Level 9
Level 9
Posts: 2510
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: How to mount NTFS partition so I have ownership?

Post by AndyMH » Thu Mar 07, 2019 7:52 am

On my dual boot desktop I mount my NTFS partitions in mint in fstab (so they are mounted automatically), the entries are:

Code: Select all

# mount point for windows D:
UUID=1A7C80714BFAF6B2 /home/andy/data           ntfs    windows_names,auto,users,uid=1000,gid=1000,noatime        0       2
# mount point for windows C:
UUID=40E45A0AE45A0298 /home/andy/win10           ntfs    windows_names,auto,users,uid=1000,gid=1000,noatime        0       2
fstab lives in /etc and has to be edited as root (navigate to /etc in your file manager, right click and select open as root). You can find out the UUID of the partitions by typing blkid in a terminal.

I've mounted mine in home but you can mount them wherever you like.
Homebrew i5-8400+GTX1080 Cinnamon 19.0, 3 x Thinkpad T430 Cinnamon 19.0, i7-3632 , i5-3320, i5-3210, Thinkpad T60 19.0 Mate

User avatar
WharfRat
Level 21
Level 21
Posts: 13142
Joined: Thu Apr 07, 2011 8:15 pm

Re: How to mount NTFS partition so I have ownership?

Post by WharfRat » Thu Mar 07, 2019 9:28 am

adpace wrote:
Thu Mar 07, 2019 5:18 am
Can you elaborate a bit on the /device and /mountpoint ? I'm not able to get it to work. I've tried a few combinations, but get different errors.
/media/ari/6E2EA16F2EA1314F is the hard drive. I've tried:
The device is its designation e.g, /dev/sda1 or /dev/sda2 etc.etc.

The mountpoint is the folder you would mount the NTFS filesystem to. e.g., /media/NTFS or /media/windows ect.,ect.

If you follow AndyMH advice and mount it from /etc/fstab it will make things easier.

So if your device designation is /dev/sda2 and you create the folder /media/windows you would enter the following to mount it

Code: Select all

sudo mount -t ntfs-3g -o defaults,noatime,utf8,dmask=002,fmask=111,uid=1000,gid=1000 /dev/sda2  /media/windows
ImageImage

adpace
Level 1
Level 1
Posts: 5
Joined: Tue Mar 05, 2019 1:18 am

Re: How to mount NTFS partition so I have ownership?

Post by adpace » Thu Mar 07, 2019 5:45 pm

Getting closer but got this...

Code: Select all

ari@linux-mint-server:~$ sudo mount -t ntfs-3g -o defaults,noatime,utf8,dmask=002,fmask=111,uid=1000,gid=1000 /dev/sda1 /home/ari/Storage
Mount is denied because the NTFS volume is already exclusively opened.
The volume may be already mounted, or another software may use it which
could be identified for example by the help of the 'fuser' command.
unmounted the drive, then got this...

Code: Select all

ari@linux-mint-server:~$ sudo mount -t ntfs-3g -o defaults,noatime,utf8,dmask=002,fmask=111,uid=1000,gid=1000 /dev/sda1 /home/ari/Storage
The disk contains an unclean file system (0, 0).
Metadata kept in Windows cache, refused to mount.
Falling back to read-only mount because the NTFS partition is in an
unsafe state. Please resume and shutdown Windows fully (no hibernation
or fast restarting.)
This drive was in a windows box, but is not anymore. It is just a secondary drive on my linux machine now, which holds my media.

adpace
Level 1
Level 1
Posts: 5
Joined: Tue Mar 05, 2019 1:18 am

Re: How to mount NTFS partition so I have ownership?

Post by adpace » Thu Mar 07, 2019 6:02 pm

I ran...

Code: Select all

sudo ntfsfix /dev/sda1
and that fixed it. I can now mount the drive with read write permissions and access it from my windows pc on the network. Thank you guys so much for your help, I couldn't have gotten this working without it! :D

For anyone else running into the ntfs issue, this was the post I found that helped with it...
https://askubuntu.com/questions/145902/ ... ibernation

User avatar
AndyMH
Level 9
Level 9
Posts: 2510
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: How to mount NTFS partition so I have ownership?

Post by AndyMH » Fri Mar 08, 2019 7:10 am

Hah... a windows problem. One of the first things I did when I set up my desktop dual boot with win10 was switch off hiberfil.sys. If nothing else it was a multi-GB file.
Homebrew i5-8400+GTX1080 Cinnamon 19.0, 3 x Thinkpad T430 Cinnamon 19.0, i7-3632 , i5-3320, i5-3210, Thinkpad T60 19.0 Mate

Alx_Blanco
Level 1
Level 1
Posts: 1
Joined: Fri Sep 28, 2018 11:49 am
Location: Mexico

Re: How to mount NTFS partition so I have ownership?

Post by Alx_Blanco » Wed Mar 27, 2019 12:12 pm

Hi guys,
I followed step by step the solution you posted -Im struggling with the same thing- when I ran "sudo ntfsfix /dev/sda1" send me the following error message:

Mounting volume... Windows is hibernated, refused to mount.
FAILED
Attempting to correct errors...
Processing $MFT and $MFTMirr...
Reading $MFT... OK
Reading $MFTMirr... OK
Comparing $MFTMirr to $MFT... OK
Processing of $MFT and $MFTMirr completed successfully.
Setting required flags on partition... OK
Going to empty the journal ($LogFile)... OK
Windows is hibernated, refused to mount.
Remount failed: Operation not permitted

I read that AndyMH mentioned that he had "Switch Off" hiberfil.sys on Windows, how do you did it??
Im not Windows expert either,

thanx in advance

User avatar
AndyMH
Level 9
Level 9
Posts: 2510
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: How to mount NTFS partition so I have ownership?

Post by AndyMH » Wed Mar 27, 2019 2:34 pm

Google hiberfil.sys, this is just one:
https://www.techrepublic.com/blog/tr-do ... -function/
Also check in your BIOS that fast boot is disabled.
Homebrew i5-8400+GTX1080 Cinnamon 19.0, 3 x Thinkpad T430 Cinnamon 19.0, i7-3632 , i5-3320, i5-3210, Thinkpad T60 19.0 Mate

Mark Phelps
Level 7
Level 7
Posts: 1852
Joined: Mon Jun 10, 2013 4:39 pm

Re: How to mount NTFS partition so I have ownership?

Post by Mark Phelps » Fri Mar 29, 2019 11:31 am

It's more likely Fast Startup -- which is a Win10 feature -- as that enables Hibernation by default.

Fast Boot is similar, but is a BIOS/UEFI option, not a Windows option.

rushiloke7
Level 1
Level 1
Posts: 3
Joined: Sat Jul 20, 2019 8:10 am

Re: How to mount NTFS partition so I have ownership?

Post by rushiloke7 » Fri Jul 26, 2019 11:50 am

WharfRat wrote:
Tue Mar 05, 2019 8:56 am

So mount -t ntfs-3g -o defaults,noatime,utf8,dmask=002,fmask=111,uid=1000,gid=1000 /device /mointpoint will allow read/write
This command is working. But now I want to run it on startup?

I tried running this command from "Startup Application" but it failed. Probably because of root access. Is there a simple fix for this?

ajgringo619
Level 6
Level 6
Posts: 1425
Joined: Thu Mar 01, 2018 8:36 pm
Location: San Diego, California

Re: How to mount NTFS partition so I have ownership?

Post by ajgringo619 » Fri Jul 26, 2019 12:08 pm

You should add it to your /etc/fstab, like this:

Code: Select all

/device /mountpoint ntfs defaults,noatime,utf8,dmask=002,fmask=111,uid=1000,gid=1000 0 0
Mint 19.2 XFCE
kernel 4.15.0-65-generic
AMD FX-8350 Eight-Core w/16 GB RAM
Nvidia GeForce 960 w/2GB RAM (440.26)
Image

Post Reply

Return to “Mounting Partitions”