[SOLVED] Can't change directory ownership

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
utamav

[SOLVED] Can't change directory ownership

Post by utamav »

I used option 3 described in this http://forums.linuxmint.com/viewtopic.php?f=42&t=74321 to bind my Windows partitioned folders to my /home.

I this procedure seems to have changed the ownership of all the files and folders that I bound. chown also does not work on it. Am I doing something wrong, or this method will always result in giving these folders root?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Mute Ant

Re: Can't change directory ownership

Post by Mute Ant »

chown won't work on mounted NTFS or VFAT partitions, they don't have anywhere to store ''owned-by-uid-1000'' data. The owner and permissions have to be specified when the filesystem is first mounted. I got this from plugging in a USB drive formatted with FAT32 and looking at the output of the ''mount'' command.
  • rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0022,dmask=0077,codepage=437,iocharset=utf8,shortname=mixed,showexec,utf8,flush,errors=remount-ro,uhelper=udisks2
I can't make NTFS filesystems, but from the...

Code: Select all

man mount
...output text for NTFS options...
  • uid=value, gid=value and umask=value
    Set the file permission on the filesystem. The umask value is given in octal.
    By default, the files are owned by root and not readable by somebody else.
That last line is where you are now? I suggest you use the File Manager to mount one of the partitions and then just...

Code: Select all

mount
...to see what options it uses.
altair4
Level 20
Level 20
Posts: 11447
Joined: Tue Feb 03, 2009 10:27 am

Re: Can't change directory ownership

Post by altair4 »

utamav wrote:I used option 3 described in this http://forums.linuxmint.com/viewtopic.php?f=42&t=74321 to bind my Windows partitioned folders to my /home.

I this procedure seems to have changed the ownership of all the files and folders that I bound. chown also does not work on it. Am I doing something wrong, or this method will always result in giving these folders root?
Bind doesn't actually change permissions of anything on it's own but in order for this to work the windows partition needs to be mounted at boot.

So we need to see how the partition is being mounted by posting the output of the following command:

Code: Select all

cat /etc/fstab
If you are not automounting the partition at boot you need to add an entry into fstab to do so and the procedure goes something like this:

[1] Run the following command to find the correct UUID number for your partition:

Code: Select all

sudo blkid -c /dev/null
[2] Create a mount point for the Windows partition to live in, example:

Code: Select all

sudo mkdir /mnt/WinC
[3] Then add a line to the end of fstab that looks something like this:

Code: Select all

UUID=DA9056C19056A3B3 /media/WinC ntfs defaults,nls=utf8,umask=000,uid=1000,windows_names 0 0
[4] If you mounted the partition manually through the file manager unmount it.

[5] Then run the following command to mount the partition with the new fstab settings:

Code: Select all

sudo mount -a
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
utamav

Re: Can't change directory ownership

Post by utamav »

Thanks, that was it. I was mounting my partition with default settings and hence root.

Unfortunately, this morning after updating that I made changes to my network and now I can't access it from work. :roll:

Once I go home and verify it, I'll mark this as solved.
milangru

Re: [SOLVED] Can't change directory ownership

Post by milangru »

I have fresh install of Linux Mint over w8. Now I have among linux partitions one ntfs partition which i cant ged permissions to write and delete files. Have done like you written in the post but it is not working for me. please help. My fstab looks like that

Code: Select all

# /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/sda5 during installation
UUID=64e5352b-16db-41aa-996a-461b4669e684 /               ext4    errors=remount-ro 0       1
# /home was on /dev/sda6 during installation
UUID=b82a9bd0-3a56-4d47-a25d-58b51160f53d /home           ext4    defaults        0       2
# swap was on /dev/sda7 during installation
UUID=8c33fab8-3040-4395-9f3e-44d6d4c47e20 none            swap    sw              0       0
/dev/disk/by-uuid/FAD8C3ADD8C3670B /mnt/FAD8C3ADD8C3670B auto nosuid,nodev,nofail,x-gvfs-show 0 0
Locked

Return to “Beginner Questions”