Change permissions to mounted ntfs drive

Hello, I connect second external drive HDD Seagate 6TB USB(with power supply) and want to add that drive as nfs share to my laptop. I did it with my first drive Toshiba 3TB HDD USB. That 6TB drive is formated as NTFS and it has root permissions. I change permissions to dietpi but after reboot it has root permissions again. It’s possible to change that permanently and do I have to change some parameters in my ubuntu laptop fstab and dietpi fstab if that drive is ntfs?

Ubuntu laptop:

 
# <file system>                             <dir>   <type>   <options>  <dump>	<pass>
192.168.0.24:/mnt/Toshiba/dietpi_userdata /mnt/nas  nfs      defaults    0       0
192.168.0.24:/mnt/Seagate /mnt/Seagate nfs      defaults    0       0

Dietepi:

#----------------------------------------------------------------
# PHYSICAL DRIVES
#----------------------------------------------------------------
PARTUUID=907af7d0-02 / ext4 noatime,lazytime,rw 0 1
PARTUUID=907af7d0-01 /boot vfat noatime,lazytime,rw 0 2
UUID=362a51c8-387b-4315-a814-8c3c2dd05f94 /mnt/Toshiba ext4 noatime,lazytime,rw,nofail,noauto,x-systemd.automount
UUID=60296AD270314115 /mnt/Seagate ntfs noatime,lazytime,rw,permissions,big_writes,nofail,noauto,x-systemd.automount

Regards,
Przemek

Hi,

there is a big difference between your 2 HDD. First one is ext4 file system while your 2nd is NTFS. On Unix-like operating systems such as Debian, you can run chown and chmod on ntfs file systems but they aren’t going to have any effect on the actual permissions. Does the file system absolutely need to be ntfs? I would recommend ext4 if you like to use user permission.

Hi, I can format that drive but already have 1,6 TB of data and I took very long to copy from Toshiba drive. But if it’s not possible to change permissions I will do that. I will format to ext4.

Regards,
Przemek

I was trying to mount a nfs and sshfs to test the docker of jellyfin (and failing miserably)

You might need to add ,uid=xxx,gid=xxx to the mount options…and remove defaults means it will always mount as root, make sure you use , (comma) with no spaces…also have it connected to mouse/KB/monitor in case fstab goes ape and doesn’t work

Did a quick google…you can specify mount options
https://askubuntu.com/questions/113733/how-do-i-correctly-mount-a-ntfs-partition-in-etc-fstab
uid=1000,gid=1000,dmask=027,fmask=137

1 Like

Thanks guys for help but I format that drive. If I would have problems with this disk later with this ntfs, I prefer to format and tire a bit with data transfer now.
Thanks for Your time and help.
Regards,
Przemek

Better to use ext4 if the disk is used on Linux based systems only.

Hi, I format that drive but I noticed that is mounted and has root permissions. My first HDD has dietpi permissions, that because I had dietpi_userdata on it? Do I have now t change permissions to that new drive to:

sudo chmod - R 777 /mnt/Seagate
sudo chown -R dietpi:dietpi /mnt/Seagate

I will have on it folder where I will make backup of my local laptops with deja-dup and second where I will make dietpi-sync my dietepi_userdata folder from /mnt/Toshiba.

regards,
Przemek

Joulinar I change permissions but still cannot mount that drive in my Ubuntu Laptop. I do everything like my Toshiba drive.

drwxrwxrwx 4 dietpi dietpi 4096 Dec 20 22:07 Seagate
drwxr-xr-x 5 dietpi dietpi 4096 Mar 23  2020 Toshiba

Ubuntu:

lusia@lusia-laptop:~$ sudo mount -t nfs -vvvv 192.168.0.24:/mnt/Seagate/ /mnt/Seagate/
[sudo] hasło użytkownika lusia: 
mount.nfs: timeout set for Mon Dec 21 18:56:03 2020
mount.nfs: trying text-based options 'vers=4.2,addr=192.168.0.24,clientaddr=192.168.0.229'
mount.nfs: mount(2): No such file or directory
mount.nfs: trying text-based options 'addr=192.168.0.24'
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: trying 192.168.0.24 prog 100003 vers 3 prot TCP port 2049
mount.nfs: prog 100005, trying vers=3, prot=17
mount.nfs: trying 192.168.0.24 prog 100005 vers 3 prot UDP port 33514
mount.nfs: mount(2): Permission denied
mount.nfs: access denied by server while mounting 192.168.0.24:/mnt/Seagate/

Dietpi /etc/fstab:

#----------------------------------------------------------------
# PHYSICAL DRIVES
#----------------------------------------------------------------
PARTUUID=907af7d0-02 / ext4 noatime,lazytime,rw 0 1
PARTUUID=907af7d0-01 /boot vfat noatime,lazytime,rw 0 2
UUID=362a51c8-387b-4315-a814-8c3c2dd05f94 /mnt/Toshiba ext4 noatime,lazytime,rw,nofail,noauto,x-systemd.automount
UUID=53e894de-6174-4b2e-9258-3508270674a9 /mnt/Seagate ext4 noatime,lazytime,rw,nofail,noauto,x-systemd.automount

did you add the new drive to /etc/exports on your NFS server?

Hi, I don’t remember I make something like that with my Toshiba drive.

root@DietPi:/# cat /etc/exports
# /etc/exports: the access control list for filesystems which may be exported
#		to NFS clients.  See exports(5).
#
# Example for NFSv2 and NFSv3:
# /srv/homes       hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check)
#
# Example for NFSv4:
# /srv/nfs4        gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)
# /srv/nfs4/homes  gss/krb5i(rw,sync,no_subtree_check)

that’s how you export files systems usually using NFS

Joulinar but if I don’t have any entry here it shouldn’t pass everyone?
I can mount that drive in nautilus as sftp://192.168.0.24:/mnt/Seagate but when I set that address in deja-dup to make backup it don’t work.

regards.

If you don’t have any entry, how will the system know what do you want to share? It is a huge security risk to “just allow everything”.

But It’s only in my local home network. My first drive works without any entry.

regards.

now I’m confused. Do you try to use SFTP or NFS?

sftp://192.168.0.24:/mnt/Seagate

Joulinar I want to use nfs mount on both drives. Now when I add entry to /ect/exports my Toshiba stop working on Ubutnu. I cannot access to /mnt/ folder on laptop.

root@DietPi:/# cat /etc/exports
# /etc/exports: the access control list for filesystems which may be exported
#		to NFS clients.  See exports(5).
#
# Example for NFSv2 and NFSv3:
# /srv/homes       hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check)
#
# Example for NFSv4:
# /srv/nfs4        gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)
# /srv/nfs4/homes  gss/krb5i(rw,sync,no_subtree_check)
/mnt/Seagate 192.168.0.*(rw,async,no_root_squash,fsid=0,crossmnt,no_subtree_check)
/mnt/Toshiba 192.168.0.*(rw,async,no_root_squash,fsid=0,crossmnt,no_subtree_check)

I try sfp to check it working.

regards.

When I reboot ubuntu lapton situation is even weirder. I have two times mounted that new drive. In /mnt/nas and in /mnt/Seagate.

lusia@lusia-laptop:~$ cat /etc/fstab 
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda2 during installation
UUID=07177a55-7bea-434d-876f-fe8550dec6ad /               ext4    errors=remount-ro 0       1
# /home was on /dev/sda3 during installation
UUID=27a6b203-1463-484d-b0b1-e29056ec074b /home           ext4    defaults        0       2
# swap was on /dev/sda4 during installation
UUID=44edea65-65b0-484c-a846-8f992e5e890e none            swap    sw              0       0
# <file system>                             <dir>   <type>   <options>  <dump>	<pass>
192.168.0.24:/mnt/Toshiba/dietpi_userdata /mnt/nas  nfs      defaults    0       0
192.168.0.24:/mnt/Seagate /mnt/Seagate  nfs      defaults    0       0

How is that possible?

Which is logical as the root directories are /mnt/Toshiba and /mnt/Seagate

SFTP has nothing to do with NFS.

An example of the fstab entry in the NFS client is:

10.0.2.5:/ /mnt/backup nfs _netdev,nofail,noauto,x-systemd.automount

In your case I am not sure how the server will distinguish the traffic for each share, so I suggest you merge them into one under /mnt and then use in clients the paths /Toshiba or /Seagate .

Hi trendy, can You tell me how it’s possible that when I do:
sudo mount -t nfs 192.168.0.24:/mnt/Toshiba/dietpi_userdata/ /mnt/nas/ my laptop mount me my second Seagate drive in /mnt/nas. While /mnt/Seagate from Dietpi is mounted in /mnt/Seagate in ubuntu?

OK, I find error. I have the same fsid=0 in /etc/exports

regards.

Hi, one more thing Joulinar. I start dietpi-sync now in my EasySSH terminal on ubuntu laptop. Can You tell me if I close that application window my sync will continue? Because when I copy folders in midnight commander it stops.

Regards.