777 on NTFS partition by default?

Questions about other topics - please check if your question fits better in another category before posting here
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
User avatar
Makrand
Level 1
Level 1
Posts: 19
Joined: Sun Jun 05, 2016 1:05 pm

777 on NTFS partition by default?

Post by Makrand »

Hi all,

on my laptop, I have 1TB HDD and 120G SSD. SSD is boot and ext4. On other hand my 1TB (/dev/sdb1) drive is catering storage as NTFS partition.

/dev/sdb1 932G 16G 917G 2% /media/makrand/ntfs-store

1TB NTFS was created using Gparted few months back. I was running a vagrant to spin up few VMs. All vagrant boxes are stored on NTFS partition folder, so the vagrantfile. While I was spinning up VM using vagrant, I faced some error with auth_key. I looked up and realized that ALL things on NTFS are 777 the moment I create anything on that partition. chmod or chown (with and without sudo) just DO NOT work. Your run it and it neither give success or error message.

I never used NTFS with linux before. For some reasons I need to stick with NTFS here. Is it the case that all things on NTFS goes to 777 by default? Very strange indeed.

This is Mint XFCE 19 latest.

Code: Select all

makrand@mint-gl63:/media/makrand/ntfs-store$ ls -l
total 12
drwxrwxrwx 1 makrand makrand 4096 Oct 15 18:20 nix-data
drwxrwxrwx 1 makrand makrand 4096 Oct 15 17:58 tmpl
drwxrwxrwx 1 makrand makrand 4096 Oct  8 20:00 vbox_vms
drwxrwxrwx 1 makrand makrand    0 Jul 27 22:49 win-data
makrand@mint-gl63:/media/makrand/ntfs-store$ cd nix-data/
makrand@mint-gl63:/media/makrand/ntfs-store/nix-data$ ls -l
total 327876
-rwxrwxrwx 1 makrand makrand 54090226 Sep  1 15:50 google-chrome-stable_current_amd64.deb
-rwxrwxrwx 1 makrand makrand     1630 Jul 30 18:49 graphics

makrand@mint-gl63:/media/makrand/ntfs-store/nix-data$ chmod 700 google-chrome-stable_current_amd64.deb 
makrand@mint-gl63:/media/makrand/ntfs-store/nix-data$ sudo chmod 700 google-chrome-stable_current_amd64.deb 
[sudo] password for makrand: 
makrand@mint-gl63:/media/makrand/ntfs-store/nix-data$ ls -l
total 327876
-rwxrwxrwx 1 makrand makrand 54090226 Sep  1 15:50 google-chrome-stable_current_amd64.deb
-rwxrwxrwx 1 makrand makrand     1630 Jul 30 18:49 graphics
-rwxrwxrwx 1 makrand makrand   116420 Oct 15 18:20 libpng12-0_1.2.54-1ubuntu1.1_amd64.deb

Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Laptop1:- Fujitsu Lifebook A555.
Core-i3 5005U, 16GB DDR3L, 480GB Kingston HyperX SSD,
Linux Mint 18.3 Cinnamon
Laptop2:- MSI GL-63 8RD.
Core-i5 8300H, 32GB DDR4-2666Mhz, 120GB NVME/1TB HDD 7200rpm
Linux Mint 19.1 XFCE
User avatar
catweazel
Level 19
Level 19
Posts: 9763
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: 777 on NTFS partition by default?

Post by catweazel »

Makrand wrote: Wed Oct 17, 2018 5:52 am Very strange indeed.
It's not strange. NTFS simply doesn't support linux permissions.
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
User avatar
Makrand
Level 1
Level 1
Posts: 19
Joined: Sun Jun 05, 2016 1:05 pm

Re: 777 on NTFS partition by default?

Post by Makrand »

So I just need to live with 777 all time? thats bummer.
Laptop1:- Fujitsu Lifebook A555.
Core-i3 5005U, 16GB DDR3L, 480GB Kingston HyperX SSD,
Linux Mint 18.3 Cinnamon
Laptop2:- MSI GL-63 8RD.
Core-i5 8300H, 32GB DDR4-2666Mhz, 120GB NVME/1TB HDD 7200rpm
Linux Mint 19.1 XFCE
altair4
Level 20
Level 20
Posts: 11460
Joined: Tue Feb 03, 2009 10:27 am

Re: 777 on NTFS partition by default?

Post by altair4 »

I don't understand the nature of the question.

chown and chmod do not work on NTFS because there are no Linux permission bits to change. What Linux does is create a "view" of the ntfs partition that makes it look - to both the user and the system - that it does have Linux permissions. This "view" is completely under your control.

So if the question is can I change the permissions of the mounted ntfs partition to say 700 the answer is yes:

[1] Create a mount point outside of /media/makrand:

Code: Select all

sudo mkdir /media/ntfs-store
[2] Add the following to the end of /etc/fstab - edit: changed mount point:

Code: Select all

UUID=bunch-of-numbers /media/ntfs-store ntfs defaults,uid=markrand,umask=077 0 0
You can find "bunch-of-numbers" by running this command:

Code: Select all

sudo blkid -c /dev/null
[3] Unmount the partition if it is currently mounted:

Code: Select all

sudo umount /media/markrand/ntfs-store
[4] Then remount with this command:

Code: Select all

sudo mount -a
If however the question is can I cange the permissions on a specific file the answer is no. This "view" is immutable. Every single file and folder in this new view will have owner = markrand and permissions of 700.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
User avatar
Makrand
Level 1
Level 1
Posts: 19
Joined: Sun Jun 05, 2016 1:05 pm

Re: 777 on NTFS partition by default?

Post by Makrand »

@altair4

Appreciate the detailed reply.

So one needs to set xyz permission while mounting the NTFS. That permission will be propagated to all the DIR & FILES under that partition.

My question was - Why I can't change or set permission to specific entities. But your point about VIEW made my view clear about this :D

1) From what source did you read/grasp about view for NTFS?
2) I read somewhere - NTFS is a POSIX-compatible filesystem. So logically permissions should be available under Linux.
Laptop1:- Fujitsu Lifebook A555.
Core-i3 5005U, 16GB DDR3L, 480GB Kingston HyperX SSD,
Linux Mint 18.3 Cinnamon
Laptop2:- MSI GL-63 8RD.
Core-i5 8300H, 32GB DDR4-2666Mhz, 120GB NVME/1TB HDD 7200rpm
Linux Mint 19.1 XFCE
altair4
Level 20
Level 20
Posts: 11460
Joined: Tue Feb 03, 2009 10:27 am

Re: 777 on NTFS partition by default?

Post by altair4 »

An NTFS partition has no Linux user or permissions bits so ntfs-3g uses FUSE to create a translation layer on top of the partition - creating a virtual filesystem - that makes it appear to you and the system itself that is does have them.

That is why an ntfs partition in Linux is slower ( comparatively speaking ) then the same partition in WIndows.

I don't remember when I stated to call it a "view". Maybe it came from using the term dealing with databases when I was young and incredibly good looking. Maybe it's because my view from Linux is different from how Windows views it.
Last edited by altair4 on Fri Oct 26, 2018 5:56 pm, edited 1 time in total.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
User avatar
catweazel
Level 19
Level 19
Posts: 9763
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: 777 on NTFS partition by default?

Post by catweazel »

Makrand wrote: Fri Oct 26, 2018 9:05 am 1) From what source did you read/grasp about view for NTFS?
It comes from years of experience.
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
Locked

Return to “Other topics”