I formatted a new USB external hard drive using GParted and now it mounts as Root so I cannot copy files to it. How can I change this?

Asked by Merlinpilot

I formatted a new Hard Drive installed in a USB external case, using GPARTED. This is fine, but when I connect the external disk, it mounts as Root and I do not have permissions to write anything to the disk.

How do I change this disk so that it behaves like my other external hard disks (Automount into /media), and why should it have been created as root in the first place - what did I do wrong?

Many thanks in advance.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu util-linux Edit question
Assignee:
No assignee Edit question
Solved by:
actionparsnip
Solved:
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

You need to change its mount options. It is owned by root because root mounted it. You need to add mount options so it is owned by your user.
If the mount is present in /etc/fstab you can add options there, if not, there's some magic you can work in gconf which I am not familiar with. You will add mount options in fstab with a line like this:
/dev/sdc1. /media/usb. ext2. rw,auto.uid=1000

Ignore the dots in that line, stupid g1 phone browser adds then for me (annoying). Anyway the important bit is the uid bit which will give the mount to your user (which to the system is user 1000). You will then have write access without sudo etc. If you want to mount at command line (using the same above example) it would be:
sudo mount /dev/sdc1 /media/usb -t ext2 -o rw,auto,uid=1000
And it will be user writable. The formatting does not dictate who has what access, its the mount options on the partition
By the way your partition may not be /dev/sdc1. I simply used that as an example so don't directly copy the text you see here as it wonlt work

Revision history for this message
Merlinpilot (nigel-talbot) said :
#2

Hi actionparsnip. Thank you for your help - sorry not to respond immediately - lack of time as usual.

The disk partition is /dev/sdc1 using ext3 as the file system, so I imagine that your script should work. However I have tried both methods with no success. Terminal shows:

nigel@nigel-laptop:~$ sudo mount /dev/sdc1 /media/usb -t ext2 -o rw,auto,uid=1000
mount: mount point /media/usb does not exist
nigel@nigel-laptop:~$

when I try to use command line (I also tried ext3 instead of ext2 on the basis that the disk is formatted as ext3, but this made no difference and probably amply demonstrates my lack of knowledge)

The disk is showing in /media when I switch it on but when I look at the information in GParted, it says 'Unable to find mount point'

I will be grateful for any other suggestion or for you to point out the obvious error I am making!

Many thanks

Revision history for this message
Best actionparsnip (andrew-woodhead666) said :
#3

sudo mkdir /media/usb

Then try again.

Revision history for this message
Merlinpilot (nigel-talbot) said :
#4

Hi - I tried this and successfully created the directory, but no success in reading to the external disk, using either the fstab mod or terminal. It still automounts into /Media but without rw privileges.

However.........I appear to have solved the problem by accessing the disk via

sudo nautilus

and then changing the owner and permissions via the Properties tab.

Do you think this method is appropriate and could cause future problems?

Revision history for this message
Merlinpilot (nigel-talbot) said :
#5

Actionparsnip,

Thanks for your help - without it I would not have found the solution I used in the end.

Thanks again,

Merlinpilot

Revision history for this message
Merlinpilot (nigel-talbot) said :
#6

Thanks actionparsnip, that solved my question.