Unable to write to a second hard disk

Asked by Mike K on 2008-10-22

Ubuntu 8.04

I have added a second hard disk to an already functioning system. The disk was connected to the Primary IDE Slave interface and formatted to EXT3 with Gparted. I want to be able to use a second disk for cloning my system, making backups and for storing data when my HOME partition is full. My hard disks are mounted in plug-in drawers and easily exchanged.

If I go to PLACES/COMPUTER I see an icon for it labelled 160.0 GB Media. Click on the icon and the disk opens with one file already present, “lost+found”.

My problem: I am unable to write to this disk. If I try to copy something to the disk I am informed “There was an error copying the file into /media/disk. Permission denied.”

What have/haven't I done?

Many thanks for your help,
Mike

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu util-linux Edit question
Assignee:
No assignee Edit question
Solved by:
Wyatt Smith
Solved:
2008-10-25
Last query:
2008-10-25
Last reply:
2008-10-24
Wyatt Smith (wyatt-smith) said : #1

Your new drive is probably owned by root and you do not have permission to write to it.

Please read this community document regarding file permissions. It is essential for linux users to have a good understanding of file ownership / permissions.
https://help.ubuntu.com/community/FilePermissions

The command to change ownership and permission will look something like this

sudo chown -R $USER:$USER /media/mountpoint
sudo chmod -R 750 /media/mountpoint

where /media/mountpoint is the directory where the disk is mounted.

To have the disks automatically mounted when the computer starts, you should put an entry into your /etc/fstab file.
Here is another community document which may help.
https://help.ubuntu.com/community/Fstab

Since this file is owned by root you need to have superuser privileges to edit it.

gksudo gedit /etc/fstab

Hope this helps

Mike K (emay-kirk) said : #2

Thanks for your help, Wayne.

I had to read up on the chown command. Which comes first – the “from” user or the “to” user? I sorted this one out and changed the permissions. Then it appeared that I had not created a mountpoint for the second hard disk – so, an entry in mnt. At this point things seemed to work OK: there was my 160.0 GB Media in Places and an icon appeared on my desktop when I clicked on it. However, I don't understand how the mountpoint is tied to sdb1. I thought that this was via a line in fstab, and I hadn't yet changed fstab. When I made an entry in fstab, the 160.0 GB Media just disappeared. There was no longer any reference to it in Places. I don't understand this and I can only say that things work as I want without editing fstab and that the second drive is accessible in Places whenever I want it.

The problem is solved although I do not really understand how.

Many thanks for your assistance,
Mike

Tobias Wolf (towolf) said : #3

This has a simple explanation. When you don’t make a fixed entry in fstab, then the drive is considered a removable drive that is only mounted when you click on it. Then you get an entry in Places. But when you make the fstab entry, then the drive is not considered removable and it is always mounted by the system at boot. A fixed mount does not show in Places because you can mount anything anywhere.
If you want a shortcut while having the fstab mountpoint, then just make a bookmark of this path in Nautilus.

Best Wyatt Smith (wyatt-smith) said : #4

i think you just need to change the mountpoint. Only drives mounted in the /media folder will show an icon on the desktop / places. If you mounted the drive in the folder /mnt it will not do this.

Mount command may look like this
sudo mkdir /media/DATA
sudo mount -t ext3 /dev/sdb1 /media/DATA

fstab entry may look like this
/dev/sdb1 /media/DATA ext3 relatime,errors=remount-ro 0 1

Hope this helps

Mike K (emay-kirk) said : #5

Thanks Wyatt Smith, that solved my question.

Mike K (emay-kirk) said : #6

Thanks Wyatt (and my apologies for getting your name wrong.) Changing permissions and using media instead of mount fixed things.

Mike