[Solved] No permission for mounted hdd.

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
ALbin75

[Solved] No permission for mounted hdd.

Post by ALbin75 »

Replaced dvd with original 1tb hdd, using optical bay caddy.
At first, not able to mount. Solved that one by opening Gparted "merged" small boot partition with the other partition and formated it all in ext4.

Now my filesystem shows a 1.0 TB volume, that I can mount, (But there seems to still be some unnalocated space on it. The yellow part at the start of the disk?)
But the biggest problem is, I don't have permission to do anything with it. "you are not the owner so you can't change these permissions.

This disk was the original hdd in this laptop and I think it might have been preinstalled with windows 8. It was formated in NTFS before I changed it into ext4.

Anyone have a solution for how to get permission to use the hard drive?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
austin.texas
Level 20
Level 20
Posts: 12003
Joined: Tue Nov 17, 2009 3:57 pm
Location: at /home

Re: No permission for mounted hdd.

Post by austin.texas »

Mint 18.2 Cinnamon, Quad core AMD A8-3870 with Radeon HD Graphics 6550D, 8GB DDR3, Ralink RT2561/RT61 802.11g PCI
Linux Linx 2018
ALbin75

Re: No permission for mounted hdd.

Post by ALbin75 »

This is not a partition. It is a second hdd.

I solved the mount problem by format to ext4
Im trying to take ownership of it but the command lines are constantly failing, saying there is no such file or directory.

The instructions about creating a separate data partition seems to be good. But the unit is already physically a different hdd. Also after I formated it in ext4 it is already auto-moint at boot.
I don't ever want to boot from this hdd. The idea is to use the ssd for all os and software and recent files. this second hdd will be my built in mass storage device.

I tried folowing comand:

albin@PrototypAB ~ $ sudo chown -R albin: /sda
[sudo] password for albin:
chown: cannot access '/sda': No such file or directory
albin@PrototypAB ~ $

I have tried many different solutions to find out the correct name of the second hdd. The only one i find is sda. Since all instructions presume that the user have extensive knowledge about using the terminal they almost always leave important informations out of the picture since it is deemed to be obvious. For me, and anyone who don't know anything about programming, it is however just a miracle when something works and the rest of the time we are blind and have no idea about what we are doing in the terminal.

I need the correct comandline to take ownership of my hdd.
Last edited by ALbin75 on Sun Dec 11, 2016 6:15 am, edited 1 time in total.
ALbin75

Re: No permission for mounted hdd.

Post by ALbin75 »

I don't want to create any partitions at this point. It is already physically a different hdd. It is empty and formated in ext4

Do I have to create partitions on the hdd to be able to take ownership of it?
ALbin75

Re: No permission for mounted hdd.

Post by ALbin75 »

I changed the comand line. Added dev/

sudo chown -R albin: /dev/sda

This time the terminal didn't complain about no such file or directory.
However nothing happened accept now it's not even possible to determine the permissions of the harddrive.

And it's still not possible to use the harddrive.
User avatar
austin.texas
Level 20
Level 20
Posts: 12003
Joined: Tue Nov 17, 2009 3:57 pm
Location: at /home

Re: No permission for mounted hdd.

Post by austin.texas »

ALbin75 wrote:I don't want to create any partitions at this point. It is already physically a different hdd. It is empty and formated in ext4
Do I have to create partitions on the hdd to be able to take ownership of it?
Yes, you have to have a partition (or partitions) on the 1TB drive in order to use it.
The link I gave you: "HOWTO: Create & Use a Separate DATA Partition", covers 2 things:
Step 1) How to create a partition
Step 2) How to mount and use it

You have completed Step 1. You have deleted the small boot partition and resized the remaining partition to use that space, and formatted it ext4.
So now you are ready for Step 2 - Mount and use the partition.
Step 2 is detailed quite well in the link I gave you. Go to the section that begins with: "After partitions are created and you've installed Mint (or additional Linux distro's), create a mount point for the data partition:" and proceed from there.
Mint 18.2 Cinnamon, Quad core AMD A8-3870 with Radeon HD Graphics 6550D, 8GB DDR3, Ralink RT2561/RT61 802.11g PCI
Linux Linx 2018
ALbin75

Re: No permission for mounted hdd.

Post by ALbin75 »

Thanks.

I followed the steps, even if Im not sure it is what Im looking for.
Even if I dont really want to create a home map folder system on my extra hard-drive. I see it as a built in extra drive instead of external usb drive.
I have an external SSD disk but there are issues with it and it's not working optimal with mint. So I want to transfer everything to this built in hdd and sort it out.

So I stopped att the end, just before the last step.
"Now you have a choice to either use "symlinks" between /home and the data partition, or to "bind" each directory in the data partition to the existing directories in /home."

Im really happy with my current home folder system on my ssd that also contains all OS and software.

I did check my hdd and it has now gone back to say that it is owned by root.
And Im still confused over the 50gb on the hdd that is claimed to be in use.

Ill provide some pictures that illustrate it.

at first I put all the lines in the terminal. Then I also used text editor and put two lines in it and saved it.
This is something I see sometimes, it says, put it in a text dokument and save it. But I really don't understand why.
ALbin75

Re: No permission for mounted hdd.

Post by ALbin75 »

It somehow seems strange that it's supposed to be this difficult to use a secondary hdd.
That it wasn't working with ntfs, I understand, and formating it in ext4 was easy. But that should be enough.

That it is owned by root by default in itself seems strange.

I thought that root was for the operating system and software. But theres no OS on that drive, it's just empty space.
deleted

Re: No permission for mounted hdd.

Post by deleted »

FWIW, I add the fstab entry to mount a secondary drive to say,
/volumes/vol0
/usr
I create the /volumes/vol0 using sudo.

I then create subdirectories for my users like:
/volumes/vol0/users
then
/volumes/vol0/users/hinto
I then change ownership of /volumes/vol0/users/hinto to hinto instead of root.

This is similar to the way /home is.
I always try to work with the system first, rather than against it.

-Hinto
ajgreeny
Level 7
Level 7
Posts: 1652
Joined: Mon Nov 19, 2007 3:27 pm

Re: No permission for mounted hdd.

Post by ajgreeny »

I presume that new disk shows up in your file manager and can be mounted by clicking on it; correct?

Now to make proper use of it as your data drive you will need to create a mountpoint for it with command

Code: Select all

sudo mkdir /mnt/data
and then add a line to /etc/fstab.
First lets find its UUID with command

Code: Select all

sudo blkid -c /dev/null
, then we can edit /etc/fstab to make the disk's partition mount at boot using

Code: Select all

UUID=66E53AEC54455DB2 /mnt/data ext3 defaults 0 1
but change the UUID to your disk's, of course. Now run sudo mount -a and if no errors appear all is good with that edit.
Finally change ownership of that new mountpoint, (note; you change ownership of the mountpoint, not the /dev/sda name of the disk), to your user with

Code: Select all

sudo chown -R albin:albin /mnt/data
You should now find that you can read and write to the disk as your user.
User avatar
austin.texas
Level 20
Level 20
Posts: 12003
Joined: Tue Nov 17, 2009 3:57 pm
Location: at /home

Re: No permission for mounted hdd.

Post by austin.texas »

You did good so far, according to the terminal screenshot, except when you got to gksu gedit /etc/fstab
That command failed because you are using Mint 18, which does not have the gedit program installed. Mint 18 uses xed instead of gedit, so the command will be:

Code: Select all

gksu xed /etc/fstab
That will open the fstab text file in your text editor. where you can add these 2 lines at the end of the text file:

Code: Select all

# Mount sda2 at /mnt/DATA
UUID=9c1b3f85-4a25-4de8-a75a-12372fef6f31  /mnt/DATA   ext4   defaults,noatime   0   2
After adding those lines, save and exit the editor, then reboot.
After rebooting, your big partition on sda2 will be mounted at /mnt/DATA. You can access that in your file manager > FILE SYSTEM > /mnt/DATA
You can create a bookmark in your file manager, just as you do in your web browser, to make access even easier.

By the way, for terminal output, you do not have to post a screenshot. You can select and copy the text with your mouse or trackpad.
Mint 18.2 Cinnamon, Quad core AMD A8-3870 with Radeon HD Graphics 6550D, 8GB DDR3, Ralink RT2561/RT61 802.11g PCI
Linux Linx 2018
ALbin75

Re: No permission for mounted hdd.

Post by ALbin75 »

ajgreeny wrote:I presume that new disk shows up in your file manager and can be mounted by clicking on it; correct?

Now to make proper use of it as your data drive you will need to create a mountpoint for it with command

Code: Select all

sudo mkdir /mnt/data
and then add a line to /etc/fstab.
First lets find its UUID with command

Code: Select all

sudo blkid -c /dev/null
, then we can edit /etc/fstab to make the disk's partition mount at boot using

Code: Select all

UUID=66E53AEC54455DB2 /mnt/data ext3 defaults 0 1
but change the UUID to your disk's, of course. Now run sudo mount -a and if no errors appear all is good with that edit.
Finally change ownership of that new mountpoint, (note; you change ownership of the mountpoint, not the /dev/sda name of the disk), to your user with

Code: Select all

sudo chown -R albin:albin /mnt/data
You should now find that you can read and write to the disk as your user.
Thanks this, at first doesn't seem to complicated, but I don't know what fstab is and I dont know what UUID is. ANd the worst part is I do not know what to call my hdd, dev/sda?
I was reading about UUID the other day and just got confused?
Is fstab something that use a comand that I save in a text editor at boot?
What will hapen if I later move or delete that text file?

SO what is obvious here, is not easy att all for me. I need to change the UUID to my disk. That means exactly what? Should it say UUID= and then the identity of my disk? and Ill get that identity how?

Also Im not even sure that I want it to automount. All I want is for it to stop being owned by root. Im am perfectly happy if it stays quiet and turned of until I need to use it.
As I am using my current ssd for everything this 1tb hdd is only suposed to be a mass storage unit. Instead of using an external 1tb ssd usb disk. As I did before.
Since the problems with external usb hdd and mint cant be solved and data is randomly geting lost while transfering files or the whole computer freeze and I have to take out the batery to force restart.

So the hdd I put in the optical bay is replacing my exteranl drive. It doesnt need to be mounted at all time. It's really noisy after your used to a silent computer.

Am also thinking about remove the 1 screw that locks the hdd in the optical bay slot. If I do that I can easily swap the hdd for the dvd at any time without having to open the computer.
ALbin75

Re: No permission for mounted hdd.

Post by ALbin75 »

hinto wrote:FWIW, I add the fstab entry to mount a secondary drive to say,
/volumes/vol0
/usr
I create the /volumes/vol0 using sudo.

I then create subdirectories for my users like:
/volumes/vol0/users
then
/volumes/vol0/users/hinto
I then change ownership of /volumes/vol0/users/hinto to hinto instead of root.

This is similar to the way /home is.
I always try to work with the system first, rather than against it.

-Hinto
what is fstab entry?
/volumes/vol0 means?? I think my volume has the identity sda
/usr I guess it's short for user
what is the volumes/vol0
who are my users?

Is it possible to just change the ownership of the hdd so it becomes my hdd instead of root?

This is getting worse than windows right now. It' my hdd, why is it owned by root by default?

I can create mount points using one of the 4 disk partitions programs that I installed, But I have no idea what mount point to choose.
I also don't have any problems with mounting or unmounting the unit there is one problem only and that is that it's owned by root.

ANd this is why people give up on linux one week to access a harddrive?

I see that for someone who is really good at linux this is all kid work, easy as pie.

But I am not a computer programmer. I am a cosntructions worker and a designer. I use my computer everyday for 3d drawings and account management. I would love to learn how to be a computer programmer but I really don't have all that time right now. Is it really impoosible to just change the hdd from owned by root to owned by me?

It should be the most simple thing to do. I could easily remove the partitions on it and change it from ntfs to ex4
But then it's like hiting a mountan wall. How is anyone going to be able to change from windows to linux if they cant even access their usb hdd or built in extra hdd without being a computer engineer?
ALbin75

Re: No permission for mounted hdd.

Post by ALbin75 »

austin.texas wrote:You did good so far, according to the terminal screenshot, except when you got to gksu gedit /etc/fstab
That command failed because you are using Mint 18, which does not have the gedit program installed. Mint 18 uses xed instead of gedit, so the command will be:

Code: Select all

gksu xed /etc/fstab
That will open the fstab text file in your text editor. where you can add these 2 lines at the end of the text file:

Code: Select all

# Mount sda2 at /mnt/DATA
UUID=9c1b3f85-4a25-4de8-a75a-12372fef6f31  /mnt/DATA   ext4   defaults,noatime   0   2
After adding those lines, save and exit the editor, then reboot.
After rebooting, your big partition on sda2 will be mounted at /mnt/DATA. You can access that in your file manager > FILE SYSTEM > /mnt/DATA
You can create a bookmark in your file manager, just as you do in your web browser, to make access even easier.

By the way, for terminal output, you do not have to post a screenshot. You can select and copy the text with your mouse or trackpad.
ah okay, that makes sence. It's better if I just copy the text.

So far so good.

mount: special device /dev/sda5 does not exist
albin@PrototypAB ~ $ sudo mount /dev/sda /mnt/DATA
mount: wrong fs type, bad option, bad superblock on /dev/sda,
missing codepage or helper program, or other error

In some cases useful info is found in syslog - try
dmesg | tail or so.
albin@PrototypAB ~ $ sudo chown -R albin: /mnt/DATA
albin@PrototypAB ~ $ cd /mnt/DATA
albin@PrototypAB /mnt/DATA $ mkdir Documents Downloads Music Pictures Videos
mkdir: cannot create directory ‘Documents’: File exists
mkdir: cannot create directory ‘Downloads’: File exists
mkdir: cannot create directory ‘Music’: File exists
mkdir: cannot create directory ‘Pictures’: File exists
mkdir: cannot create directory ‘Videos’: File exists
albin@PrototypAB /mnt/DATA $ sudo blkid
/dev/sda2: UUID="9c1b3f85-4a25-4de8-a75a-12372fef6f31" TYPE="ext4" PARTUUID="4dd72df0-02"
/dev/sdb1: UUID="d8f0d64d-cd1d-4896-bbc6-3273ced18265" TYPE="ext4" PARTUUID="6f25ac22-01"
/dev/sdb5: UUID="ddd63915-bbc6-4239-b3b1-bc320d352e61" TYPE="swap" PARTUUID="6f25ac22-05"
albin@PrototypAB /mnt/DATA $ gksu xed /etc/fstab
albin@PrototypAB /mnt/DATA $

I will restart now... lets see.
User avatar
austin.texas
Level 20
Level 20
Posts: 12003
Joined: Tue Nov 17, 2009 3:57 pm
Location: at /home

Re: No permission for mounted hdd.

Post by austin.texas »

ALbin75 wrote:SO what is obvious here, is not easy att all for me. I need to change the UUID to my disk. That means exactly what? Should it say UUID= and then the identity of my disk? and Ill get that identity how?
That information is in one of the screenshots you posted.
ALbin75 wrote:Also Im not even sure that I want it to automount. All I want is for it to stop being owned by root. Im am perfectly happy if it stays quiet and turned of until I need to use it.
This is relevant. When you follow the instructions I gave you, add noauto to the second line, like this:

Code: Select all

# Mount 1TB DATA partition at /mnt/DATA
UUID=9c1b3f85-4a25-4de8-a75a-12372fef6f31  /mnt/DATA   ext4   defaults,noatime,noauto   0   2
That will allow you to remove the 1TB drive whenever you want with no problem, but if it is connected, it will auto-mount at /mnt/DATA

You have already changed the ownership of /mnt/DATA, so that is taken care of.
Mint 18.2 Cinnamon, Quad core AMD A8-3870 with Radeon HD Graphics 6550D, 8GB DDR3, Ralink RT2561/RT61 802.11g PCI
Linux Linx 2018
ALbin75

Re: No permission for mounted hdd.

Post by ALbin75 »

But now I cant mount the hdd also I cant mount the ssd and theres even less inforamtion about the hdd.

Is this something that should be added to the fstab dockument that I created?

# Mount 1TB DATA partition at /mnt/DATA
UUID=9c1b3f85-4a25-4de8-a75a-12372fef6f31 /mnt/DATA ext4 defaults,noatime,noauto 0 2
ALbin75

Re: No permission for mounted hdd.

Post by ALbin75 »

austin.texas wrote:
ALbin75 wrote:SO what is obvious here, is not easy att all for me. I need to change the UUID to my disk. That means exactly what? Should it say UUID= and then the identity of my disk? and Ill get that identity how?
That information is in one of the screenshots you posted.
ALbin75 wrote:Also Im not even sure that I want it to automount. All I want is for it to stop being owned by root. Im am perfectly happy if it stays quiet and turned of until I need to use it.
This is relevant. When you follow the instructions I gave you, add noauto to the second line, like this:

Code: Select all

# Mount 1TB DATA partition at /mnt/DATA
UUID=9c1b3f85-4a25-4de8-a75a-12372fef6f31  /mnt/DATA   ext4   defaults,noatime,noauto   0   2
That will allow you to remove the 1TB drive whenever you want with no problem, but if it is connected, it will auto-mount at /mnt/DATA

You have already changed the ownership of /mnt/DATA, so that is taken care of.
Yes at one point I posted a screenshot from the terminal. There are 3 different UUID on it. Somehow I remember from seing somewhere else that it was sda.
But this one says sda2. As I remember sda2 is something like and old partitions that is still inside sda somehow. Even after I removed it and made it into one disk with no partitions on it.
There was a comand to list drivers but I dont remember it and I cant find it. I find many comands for listing drivers, however no one is actually listing any drivers.
If it is going to be arround 30 random characters, that is unreadable for the human mind it would be good to list this UUID identity. Even if I still dont know what UUID is. "Universally unique identifier" perhaps it means the identity of my hdd?

Here in disk manage it looks like I can see the identity, but I can't copy it. But isn't it possible to do the corect settings from here? moint point and no longer owned by root?

albin@PrototypAB ~ $ ls -l
total 48
drwxr-xr-x 2 albin albin 4096 Dec 12 13:37 Desktop
drwxr-xr-x 2 albin albin 4096 Nov 28 15:04 Documents
drwxr-xr-x 14 albin albin 4096 Dec 9 15:20 Downloads
-rw-r--r-- 1 albin albin 127 Dec 11 16:29 fstab
drwxr-xr-x 6 albin albin 4096 Dec 7 21:30 Linux-Windows
drwxr-xr-x 3 albin albin 4096 Dec 4 18:42 Music
drwxr-xr-x 2 albin albin 4096 Nov 23 19:43 Pictures
drwxr-xr-x 2 albin albin 4096 Nov 23 19:43 Public
drwxr-xr-x 2 albin albin 4096 Nov 27 20:00 System
drwxr-xr-x 2 albin albin 4096 Nov 23 19:43 Templates
drwxr-xr-x 2 albin albin 4096 Nov 23 19:43 Videos
drwxr-xr-x 3 albin albin 4096 Nov 25 23:34 VirtualBox VMs
ALbin75

Re: No permission for mounted hdd.

Post by ALbin75 »

Okay. I can still mount it with g parted. It starts up and become noisy and all that. But the computer can no longer "mount the location" "can't mount file"
User avatar
austin.texas
Level 20
Level 20
Posts: 12003
Joined: Tue Nov 17, 2009 3:57 pm
Location: at /home

Re: No permission for mounted hdd.

Post by austin.texas »

Did you use the command:

Code: Select all

gksu xed /etc/fstab
:?:
What happened when you did that?

If you want to see what drives and partitions you have, and the UUID for each one, run the command:

Code: Select all

lsblk -f
Mint 18.2 Cinnamon, Quad core AMD A8-3870 with Radeon HD Graphics 6550D, 8GB DDR3, Ralink RT2561/RT61 802.11g PCI
Linux Linx 2018
ALbin75

Re: No permission for mounted hdd.

Post by ALbin75 »

austin.texas wrote:Did you use the command:

Code: Select all

gksu xed /etc/fstab
:?:
What happened when you did that?

If you want to see what drives and partitions you have, and the UUID for each one, run the command:

Code: Select all

lsblk -f
Yes I did. I changed the previous comand from the guide to the new one.
What hapened was that it opened a text editor of some sort. I then posted the two lines at the end of that dokument and saved it.

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda1 during installation
UUID=d8f0d64d-cd1d-4896-bbc6-3273ced18265 / ext4 errors=remount-ro 0 1
# swap was on /dev/sda5 during installation
UUID=ddd63915-bbc6-4239-b3b1-bc320d352e61 none swap sw 0 0
# Mount sda2 at /mnt/DATA
UUID=9c1b3f85-4a25-4de8-a75a-12372fef6f31 /mnt/DATA ext4 defaults,noatime 0 2

Then I turned that text editor orff and reeboted.
After that I cant open the hdd or the ssd. However I still have access to my filesystem on ssd and everything seems to work.

Thanks, lsblk was the comand I was looking for. And this is the result.

albin@PrototypAB ~ $ lsblk -f
NAME FSTYPE LABEL UUID MOUNTPOINT
sda
└─sda2 ext4 9c1b3f85-4a25-4de8-a75a-12372fef6f31 /mnt/DATA
sdb
├─sdb1 ext4 d8f0d64d-cd1d-4896-bbc6-3273ced18265 /

This lists the drivers ok. It doesnt tell me what driver is who? But I remember from the disk programs that sda is the 1tb driver and sdb is the ssd drive.
Also it doesnt tell me what of this information is the UUID something something. is it:
sda?
sda
└─sda2?
sda
└─sda2 ext4 ?
sda
└─sda2 ext4 9c1b3f85-4a25-4de8-a75a-12372fef6f31 /mnt/DATA?
9c1b3f85-4a25-4de8-a75a-12372fef6f31 /mnt/DATA?
9c1b3f85-4a25-4de8-a75a-12372fef6f31?

my guess is that UUID in this case stands for the identity of my hdd and that that identity is 9c1b3f85-4a25-4de8-a75a-12372fef6f31 or perhaps 9c1b3f85-4a25-4de8-a75a-12372fef6f31 /mnt/DATA?
I previoulsy thoguht that it was sda or sda2
Locked

Return to “Storage”