Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: can't read / change permissions for files on ntfs drive

  1. #1
    Join Date
    Jan 2008
    Beans
    5

    can't read / change permissions for files on ntfs drive

    Hi,
    I have an external hd (filesystem: ntfs 3.1) that was originally used with windows, then ubuntu. Somewhere along the way permissions got messy... really messy. Somehow I wound up with a folder or two full of files that I can't even read from (or copy, or edit, ...) or change their permissions - with windows or ubuntu.

    I have tried sudo chmod/chown, and the equivalent 'advanced' file ownership options in windows to try and fix the problem, to no avail. The files still say they are owned by root, but I can't access them as root.

    Does anyone have a notion as to how I might get access to these files?

    thanks.

  2. #2
    Join Date
    Apr 2008
    Location
    Plano, Texas
    Beans
    156
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: can't read / change permissions for files on ntfs drive

    Quote Originally Posted by Ellen2 View Post
    I hope you have used the commands for setting permissions something like this:

    sudo chown someusername -R * (change ownership of all files and folders to someusername)
    sudo chmod 777 -R * (allow read, write execute on all files and folders by everybody)

    Otherwise your problem may be related to how you are mounting your external drive. Search for fstab, mounting and permissions.
    For at least a week, I have been struggling with the question: how do I change the owner and the permissions of an NTFS partition? I tried several different terminal commands using chown and chmod and none of these worked. I eventually figured out a coomand that works.

    In my etc/fstab file the usual boot comand for me is:
    /dev/sda1 /media/Disk\040C:\040ntfs ntfs-3g defaults,locale=en_US.UTF-8 0 0

    This command was automatically generated in the fstab file when I installed the NTFS Configuration Tool. When I boot my computer this command automatically mounts the NTFS partition on my computer.

    To change the permissions and the owner of the NTFS partition, I disabled the above command, and now this is the command in etc/fstab:
    /dev/sda1 /media/Disk\040C:\040ntfs ntfs-3g defaults,umask=007,uid=1000,gid=1000,relatime 0 2

    Now when I boot up my computer, root is not the owner of the NTFS partition. In the permissions the owner and the group of the NTFS partition is now me "jim". In the permissions, for Others > Folder access it says "none". I have no idea why that happened, but it really doesn't matter as I am the only one who uses this computer.


    JBA2337
    Last edited by aysiu; June 15th, 2009 at 05:26 AM. Reason: Removed spam link from quoted post

  3. #3
    Join Date
    Jul 2007
    Location
    Burlington, NC
    Beans
    1,995
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: can't read / change permissions for files on ntfs drive

    Yes, naturally NTFS cannot properly store Unix style file permissions so you have to fake them at mount time.

    the ``umask=007'' part is what is forcing no access for other users,
    you could change this to ``umask=002'' to force "read only" for other users.

  4. #4
    Join Date
    Dec 2008
    Location
    India
    Beans
    37
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: can't read / change permissions for files on ntfs drive

    try unmounting your drive and remounting it with the required read and write privilages....
    reply if that still does not work!
    we`re here to help...

  5. #5
    Join Date
    Jan 2008
    Beans
    5

    Re: can't read / change permissions for files on ntfs drive

    Ok. Thanks folks. Upgraded to Jaunty and am now just getting back to this problem.

    So, I tried the suggestion from JBA2337, with the tweak from asmoore82. Thanks folks, but no dice.

    I put into /etc/fstab the following:
    /dev/sdb1 /media/extHD ntfs-3g defaults,umask=002,uid=1000,gid=1000,relatime 0 2
    My hd mounts nicely (as root) and I see that the permissions on the problem files have changed to me as the owner. But... I still get
    You do not have the permissions necessary to open the file.
    when trying to open them, either as me or as root. I can chown and chmod without apparent errors till my fingers ache, but nothing seems to do actually let me open these files.

    Ideas?

  6. #6
    Join Date
    Sep 2007
    Beans
    Hidden!

    Re: can't read / change permissions for files on ntfs drive

    My fstab entry looks similar to post #5 in this thread:

    HowTo Automount NTFS Drives

    There may be some additional tricks for external drives in that thread.
    The mark of an honest man ... is that he means what he says and knows what he means.
    A.R.

  7. #7
    Join Date
    Sep 2008
    Beans
    40

    Re: can't read / change permissions for files on ntfs drive

    Bump!

  8. #8
    Join Date
    Jan 2008
    Beans
    5

    Re: can't read / change permissions for files on ntfs drive

    Ok. From reading, it appears that ntfs doesn't exactly always support permissions. So I tried:
    Code:
    sudo cp -r /media/extHD/folderIwant /home/placeIwantIt/
    I get all kinds of permission denied errors. Specifically:
    Code:
    cp: cannot open `/media/extHD/folderIwant/someFileIwanted' for reading: Permission denied
    .

    I'm trying to copy as sudo but get permission denied - what gives?

    I'm about to give up on these files, wipe the drive, and start over. Does anyone know what is up with this?

  9. #9
    Join Date
    Jan 2011
    Beans
    1

    Re: can't read / change permissions for files on ntfs drive

    The sad thing is that some of us are dual booting Windows and Ubuntu, and to some (like me) this requires a lot of experimentation with Wine. Having to copy the executables to ext4 filesystem to be able run it is a real pain.

    But why is NTFS by default locked? I've set my fstab options to rw,exec, umask=000,dmask=000 and it still doesn't work. Perhaps my attempts on setting fstab is futile because NTFS does not support permission fields.

  10. #10
    Join Date
    Sep 2007
    Beans
    9

    Re: can't read / change permissions for files on ntfs drive

    As you are accessing the Hard drive on a non NTFS operating system, it is not the NTFS protections(hahaha) that you need to concern yourself with.

    In linux: open a terminal window and type in: "gksudo nautilus"

    This opens up a nautilus window where you have super-user privileges.

    Browse to the relevant external hard-drive and open up the properties window and select the permissions tab.

    Make yourself the owner and make sure that you have read and write privileges.

    Also click on the tab labeled: "Apply permissions to enclosed files" that is about two thirds of the way down the pages

    Job done

    good luck

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •