You do not have the permissions necessary to view the contents of "HDD"

39,558

You should change owners. Run this command:

sudo chown $USER: /media/$USER/HDD

where $USER will complete to your current Ubuntu user and HDD is the name of the partition in question

Share:
39,558

Related videos on Youtube

kalenpw
Author by

kalenpw

Updated on September 18, 2022

Comments

  • kalenpw
    kalenpw over 1 year

    So I was recently doing an Arch install and ended up formatting my HDD in the process with fdisk. I gave up on Arch and reinstalled Ubuntu 14.04. Now whenever I try and open my HDD in Nautilus I get an error 'This Location could not be displayed. You do not have permissions necessary to view the contents of "HDD".'

    I can use sudo nautilus and am able to view the files just fine. I can also format and relabel it with sudo gnome-disks , but the issue is that is a pain to do and would rather just have access to it without being root. I've tried running sudo chmod -R ug+rw /media/kalenpw/HDD but that does not solve this issue.

    All the answers I find about this issue are about folders that always require elevated permissions, but this is the entire drive I can't access so they don't apply

    Thanks for the help.

    • David Foerster
      David Foerster almost 8 years
      What's the output of sudo LC_ALL=POSIX ls -ld "$HOME" /media/kalenpw/HDD?
  • kalenpw
    kalenpw almost 8 years
    Awesome thanks a million that fixed it. I'll accept your answer in 7 minutes when it lets me
  • Cerin
    Cerin almost 7 years
    This is not a long-term fix. These permissions will be lost as soon as you unplug the drive, so you'll have to run this command again every time you plug the drive back in.
  • derHugo
    derHugo over 6 years
    This will only work if you have the permissions to write on all the files/directories within that directory. Would be better to simply add the -R option (for recursive) to the chown command since anyway OP is already in the terminal
  • caw
    caw over 6 years
    At first you may have to run ls -l /media/$USER to find out which mount point your drive is located at. In this case, of course, it was known to be mounted at /media/$USER/HDD. Ultimately, you may even want to run chown -R instead of just chown. If there’s a lost+found directory on the drive, you can change it back to root using sudo chown -R root:root /media/$USER/HDD/lost+found. And, by the way, the wrong owner for the hard drive can happen, for example, if you formatted the drive using a live CD/DVD, where the user is 999 and that’s who the owner will be.