Saturday, May 18, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 2229  / 3 Years ago, mon, june 28, 2021, 3:46:29

I have a 128GB partitioned SSD with Ubuntu 18.04 and Windows 10 installed, and I want both systems to use the internal 1TB HDD (which has one NTFS partition) for data such as the Downloads, Pictures, Videos and Music folders which should be common between the two OSs.



In order to achieve this, I set up the HDD to be automatically mounted on boot at /mnt/sda1 (using gnome-disks), moved the stuff already in the folders on Ubuntu to the HDD and created symbolic links in /home for those folders (by using ln -s /mnt/sda1/Downloads ~/Downloads etc).



Everything seems to work fine, except all the files I moved are now owned by root and have permissions set to 777. I didn't do this manually so I assume it's a consequence of moving them to the mounted drive, hence my question: how can I change ownership and permissions for these files? I tried using both chown -R and chmod -R but neither worked (nor did they give an error message).


More From » dual-boot

 Answers
1

You don't change change ownership and permissions of an automatically mounted HDD. Microsoft file systems (NTFS, FAT32, exFAT) get their ownership and permissions when mounted, and directories and files inherit them.



Instead you




  • control the mounting with a line for the partition(s) in the file /etc/fstab


  • if already mounted, you unmount and remount the partition(s) using umount and mount with mount options to get the ownership and permissions, that you want.




The same mount options can be used in /etc/fstab and with mount.



This is described in a detailed way in the following links,



How do I use 'chmod' on an NTFS (or FAT32) partition?



Mount USB with exec flag by default


[#7991] Tuesday, June 29, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
anatta

Total Points: 326
Total Questions: 128
Total Answers: 96

Location: Jordan
Member since Sun, Jun 26, 2022
2 Years ago
;