First create a mount-point:
sudo mkdir /media/data
Change the ownership of the mount-point:
sudo chown johanna: /media/data
Set the permissions:
sudo chmod 755 /media/data
Now open the fstab-file:
sudo nano /etc/fstab
Add the following line at the end of the file:
/dev/sda3 /media/data ext4 defaults 0 2
Press Ctrl+o and then hit Enter
Press Ctrl+x
Close the terminal and reboot. You will be able to write to your mounted partition now without root-privileges.
Note
On german keyboards the Ctrl-key should be the left Strg-key.
Explanation
It looks like you mounted the partition via the desktop-icon or opening the partition in the file-manager. Doing so will automatically create the directory /media/<username>/<partition-name>
, the partition-name might be the label of the partition (if one exists) or the UUID of the partition.
This automatically created folder should be owned by and you should have read- and write-permissions, but mysteriously this doesn't seems to be the case. Also, this folder will be removed as soon as the partition is unmounted, if you don't unmount the partition yourself, the partition will be unmounted whenever the system shuts down. This explains that any changes (ownership, permissions) will not survive a reboot.
To ship around this we create a directory which we use as mount-point, adjust ownership and permissions of the directory and at last we add an entry to the fstab-file, so the partition will be auto-mounted at start-up. This directory is not going to be removed when the partition is unmounted.
Addition
I also have the impression that you wanted to set up your installation with a separate /home
-partition. It seems you created the partition, but you didn't specify the mount-point (which would be /home
) during installation. As the result you got a system with your system-partition and a big, but empty partition. Don't worry, you still can achieve this by copying the contents of the /home
-folder to the partition and after doing so changing the mount-point of the partition to /home
, here is a nice "How to do that":
https://help.ubuntu.com/community/Partitioning/Home/Moving
fstab
or something to mount your device? – Ravexina May 02 '17 at 19:39grep '^[^#]' /etc/fstab
, also specify which device is your hard drive which got the problem. – Ravexina May 02 '17 at 19:43mount | grep 'media/myname/home'
? – Ravexina May 02 '17 at 20:08