Results 1 to 7 of 7

Thread: Changing a Directory’s Ownership in linux

  1. #1
    Join Date
    May 2011
    Posts
    22

    Changing a Directory’s Ownership in linux

    I recently purchased a PC. I normally use my PC for surfing, gaming, downloading movies and especially for chatting. I wanted to change the ownership of a directory to my user name. I have a directory called "Data" in /media that is currently owned by "root" and I would like to change the ownership to "tmr". But I don’t know how to do that. I tried a lot but failed to do that. The directory "Data" is actually an NTFS partition so maybe Linux won't let me do this. Is anyone aware about such issues? If yes then please do the needful.

  2. #2
    Join Date
    Nov 2009
    Posts
    1,416

    Re: Changing a Directory’s Ownership in linux

    It is quite interesting issue that you have posted. Many people have encountered this issue before. I am a Windows user so I don’t have much knowledge about Linux. I haven’t used linux in my system. So I don’t know how it functions. If you had this problem in Windows then I would have definitely given you the accurate solution. But to solve the issue related to linux is almost impossible for me. So I won’t be able to give you the necessary suggestions you need to overcome the issue. Maybe someone else can help you out.

  3. #3
    Join Date
    Nov 2009
    Posts
    1,292

    Re: Changing a Directory’s Ownership in linux

    The issue that you have posted is not complicated. You can easily overcome such issues. To overcome such issues you need to execute some commands in your system. The commands that you need to execute are as follows: tmr@compaqowner:~$ sudo chown tmr /media/Data
    [sudo] password for tmr:
    tmr@compaqowner:~$ cd /media
    tmr@compaqowner:/media$ chown -R tmr Data
    tmr@compaqowner:/media$ After executing the above commands the ownership of the directory will be changed to the user name that you needed.

  4. #4
    Join Date
    May 2011
    Posts
    22

    Re: Changing a Directory’s Ownership in linux

    I am very grateful to you for interacting with me to overcome my issue. I executed all the commands that you specified but it didn’t change the ownership of the directory to the user name that I needed. The user name of the directory was the still the same. I don’t know why your solution didn’t work out. I have also discussed this issue with my colleagues they were not aware about such issues. I also executed the commands that I knew but they were of no use. Are you aware about other solutions? If yes then please inform me about it.

  5. #5
    Join Date
    Nov 2009
    Posts
    1,269

    Re: Changing a Directory’s Ownership in linux

    The solution that I gave you before should have worked out but it is not so in your case. As you are not having much knowledge about linux that is the reason you are finding this issue even more difficult. I know another way to overcome the issue. For that you need to change the directory permissions before you mount the NTFS. After you change the directory permission then be sure to mount it with the “users” option so that it is available to more than just root.

  6. #6
    Join Date
    May 2011
    Posts
    22

    Re: Changing a Directory’s Ownership in linux

    I did the NTFS partition configured to auto-mount at start-up as you suggested me to do. But this time I noticed the error while executing the commands. The commands that I executed are as follows: tmr@compaqowner:/media$ sudo umount Data -v
    /dev/sda2 umounted
    tmr@compaqowner:/media$ chown -R tmr Data
    chown: changing ownership of `Data': Operation not permitted
    tmr@compaqowner:/media$
    Now I don’t know how to overcome this issue. If you know then please tell me about it.

  7. #7
    Join Date
    May 2008
    Posts
    962

    Re: Changing a Directory’s Ownership in linux

    The issue that now occurred is a minor issue. You haven’t changed the ownership as super user that is the reason you are getting the error while executing the commands. To change the ownership as a super user is not a complicated task. Use the word “sudo” at the beginning of the command. If still it doesn’t work then use the word “sudo su” it will definitely work out. Try changing the ownership as super user with the commands that I have specified and your issue will be solved. The ownership of the directory will be changed to the user name that you need.

Similar Threads

  1. Restoring NVIDIA directory in Linux
    By Fragman in forum Operating Systems
    Replies: 3
    Last Post: 24-02-2010, 11:48 PM
  2. Replies: 2
    Last Post: 26-01-2010, 07:50 PM
  3. Active Directory in Linux
    By Benjamin in forum Networking & Security
    Replies: 3
    Last Post: 16-07-2009, 11:54 AM
  4. How To remove directory in linux
    By Vespera in forum Operating Systems
    Replies: 3
    Last Post: 16-05-2009, 02:41 PM
  5. Changing File System Permissions and Ownership in Powershell
    By David Eisner in forum Windows Server Help
    Replies: 1
    Last Post: 21-10-2008, 10:45 PM

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
  •  
Page generated in 1,711,630,621.89830 seconds with 16 queries