Can't get permissions to write onto a simple HDD

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
holmzie
Level 1
Level 1
Posts: 20
Joined: Sun Oct 28, 2018 2:02 pm

Can't get permissions to write onto a simple HDD

Post by holmzie »

I'm soorry I'm here again. I just don't get it. Please accept my apologies in advanced.

First of all, I have trouble searching forums. I put in too many words. When searching External HDD permissions I get 500 results, and I cant filter through them in a timely fashion, It doesn't make sense to me, sorry. I ttried and tried, and even thought I thought i had the answer, I can't find it again, now that i am trying to again upgrade to Mint 19.

I have a external 1.5 Tb Samsung HDD with GUID PARTITION TABLE: with two 500 mb ext4 partitions and one ntfs partition. I want to back up my home directory with Backup Tool.

I get this message when I try to do this: "You do not have the permission to write in the selected directory"

I read in several places that Timeshift is "not the best way" to backup my home directory. So I figured I would use the Backup Tool that comes with Mint 18.3. Timeshift files ARE able to be created on this HDD without a problem. Is that all I need to do? What if I want to import some file in my home directory onto another computer?

Im feeling very stupid, because the solution I did find by Re: "can't write files to external hard disk" Post by phd21 (» Sun Sep 16, 2018 3:20 pm) I found the solution has nothing to do with what it is I want to do. Now I can't even get back to the pages in this forum to find the answer(s) again. I did copy PHD21's comments though.

But: I cant find the things phd21 said would be on File Browser or in Caja. First of all, I don't want to change the permissions on a folder, I want to just simply copy the contents of my home folder on the stupid external hard drive. I want to use Backup tool. What ever is easier or both. I already have timeshift files from another computer on this HDD and I dont want to reformat it as NTFS.

Why is this so hard? Again I am so frustrated and ashamed, as I have been using computer for 20 years, and this seems like the simplest thing to do. I have Seven Linux machines I care for, and now this.

Can someone please help me? Thanks in advance.

Pete
"holmzie" N2EXG
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.
philotux

Re: Can't get permissions to write onto a simple HDD

Post by philotux »

Hi,

It's more probable that this is a question of ownership rather than permissions. You could try the following:
With the drive plugged in, open a terminal and run:

Code: Select all

lsblk -f
to find out the mount point for the device. Then run:

Code: Select all

sudo chown $USER:$USER /path/to/mountpoint
Replace /path/to/mountpoint with the actual path.

Hope this helps!
holmzie
Level 1
Level 1
Posts: 20
Joined: Sun Oct 28, 2018 2:02 pm

Re: Can't get permissions to write onto a simple HDD

Post by holmzie »

Thank you for your quick response, philotux
Below is a past of the result from the terminal. I have a dual-boot with Win7, both OS's have a partition on a SSD, and both have their own 1Tb HDD for data. The sdc drive is the external USB3 connected drive. Doghouse is where I am trying to write to with Backup Tool. My intention is to use this drive for backup and snapshots between 2 -3 different machines. It is not at all obvious to me about mount points in general. I know what a path is, and I've used the terminal alot. I sort of know what a UUID is. Shouldnt the mount point be something like 6b2f7da5-58c8-41a6-8579-2b6252c42e9b/media/holmzie/doghouse?
---------------------------------------------------------------------------------------------------------
holmzie@holmzie-All-Series ~ $ lsblk -f
NAME FSTYPE LABEL UUID MOUNTPOINT
sdd
├─sdd2
├─sdd5 ext4 947eccf9-a2cb-41f3-bec2-fca1c227c66f /
└─sdd1 ntfs StuffitinurWin7System
76D6FAACD6FA6BAD
sdb
├─sdb4 ext4 Mint Backup Home 128768a2-4a1f-4f43-8532-1150e52c84e5
├─sdb2 ext4 9412d3d8-c5c8-42a0-93e4-194332f238a0 /home
├─sdb3 swap 5a3ce288-919e-46cd-8dba-0a75b916cc4d [SWAP]
└─sdb1 ext4 d6017d8c-4d86-44f1-9694-22f0bc9a4b8b /boot
sr0
sdc
├─sdc2 ext4 PlayPen 6d356c43-908d-4432-a37f-233994d2ad1f /media/hol
├─sdc3 ntfs PigWallow 227CAF3B7DA318D7 /media/hol
└─sdc1 ext4 DogHouse 6b2f7da5-58c8-41a6-8579-2b6252c42e9b /media/hol
sda
├─sda2 ntfs StuffitinurDataDrive
│ B640FBE040FBA571
├─sda3 ntfs StuffitinurCdriveImage
│ 56C4F142C4F124C1
└─sda1 ntfs System Reserved 1050F68750F67338
sr1
holmzie@holmzie-All-Series ~ $ sudo chown $USER:$USER /path/to/mountpoint
[sudo] password for holmzie:
chown: cannot access '/path/to/mountpoint': No such file or directory
holmzie@holmzie-All-Series ~ $
----------------------------------------------------------------------------------------------------------
philotux

Re: Can't get permissions to write onto a simple HDD

Post by philotux »

Code: Select all

NAME FSTYPE LABEL UUID MOUNTPOINT
sdc
├─sdc2 ext4 PlayPen 6d356c43-908d-4432-a37f-233994d2ad1f /media/hol
├─sdc3 ntfs PigWallow 227CAF3B7DA318D7 /media/hol
└─sdc1 ext4 DogHouse 6b2f7da5-58c8-41a6-8579-2b6252c42e9b /media/hol
 
Hi,

The mount point is a directory on your system where you "incorporate" another filesystem/device. From your output sdc1, DogHouse, is mounted at /media/hol. So the chown command will be:

Code: Select all

sudo chown hol:hol /media/hol/sdc1
(hol being your username)
WharfRat

Re: Can't get permissions to write onto a simple HDD

Post by WharfRat »

This is what I think you're trying to access sdb4 ext4 Mint Backup Home 128768a2-4a1f-4f43-8532-1150e52c84e5

In the terminal enter sudo mkdir /media/backup_home then sudo mount /dev/sdb4 /media/backup_home

Lastly sudo chown $USER:$USER /media/backup_home

The last step only needs to be done this one time.

If you want the partition to mount at boot time add

Code: Select all

# /dev/sdb4
UUID=128768a2-4a1f-4f43-8532-1150e52c84e5  /media/backup_home   ext4	  errors=remount-ro,user,noatime    0 2
to /etc/fstab

Good luck :wink:
philotux

Re: Can't get permissions to write onto a simple HDD

Post by philotux »

I am sorry holmzie, this

Code: Select all

sudo chown hol:hol /media/hol/sdc1
looks erroneous, after reading WarfRat's post, which is of course the proper way of doing it. At least, it should have looked more like:

Code: Select all

sudo chown holmzie:holmzie /media/holmzie/6b2f7da5-58c8-41a6-8579-2b6252c42e9b 
(holmzie being your username)
Anyways sorry for the "bad"command.
Last edited by philotux on Tue Dec 18, 2018 6:56 pm, edited 1 time in total.
holmzie
Level 1
Level 1
Posts: 20
Joined: Sun Oct 28, 2018 2:02 pm

Re: Can't get permissions to write onto a simple HDD

Post by holmzie »

Making progress, Philotux and WarfRat:

I found a rather stale post at viewtopic.php?t=142469
which gives me a little background too, but I'm staying here.

WarfRat, I thank you for your help, but that's not the drive i have a problem with, I can write to that drive, it's a too small partition on my original internal drive. Not only is the partition too small, it isn't an external drive. This conversation is about how I need to make my backup on the new external sdc drive I bought. I can however, see the example you have presented and I need to digest that. The partition in question is on the new external 1.5 Tb sdc drive, namely sdc1 the "DogHouse" partition.

AND I have a question about the output of lsblk -f I got:

sdc1 ext4 DogHouse 6b2f7da5-58c8-41a6-8579-2b6252c42e9b /media/hol

I ask again, isn't the end of that supposed to be "/media/holmzie/doghouse" ? where did the "/media/hol" come from? Confused...

Again, thanks for your help
holmzie
holmzie
Level 1
Level 1
Posts: 20
Joined: Sun Oct 28, 2018 2:02 pm

Re: Can't get permissions to write onto a simple HDD

Post by holmzie »

phylotux: Very good. I'll work on this.
And WarfRat: Im starting to get the picture.
I was typing while your reply(s) arrived. Tks to you both!

I'll be bock.
Last edited by holmzie on Tue Dec 18, 2018 7:13 pm, edited 1 time in total.
philotux

Re: Can't get permissions to write onto a simple HDD

Post by philotux »

holmzie wrote: Tue Dec 18, 2018 6:55 pm AND I have a question about the output of lsblk -f I got:
sdc1 ext4 DogHouse 6b2f7da5-58c8-41a6-8579-2b6252c42e9b /media/hol
I ask again, isn't the end of that supposed to be "/media/holmzie/doghouse" ? where did the "/media/hol" come from? Confused...
Ya, what happened to the rest of it? At least it should look like /media/holmzie/. And no DogHouse will not be there since it is just a label and not an actual directry/mount point.

Edit: deleting the superfluous, and erroneous again, I guess, it's time for bed for me.
WharfRat

Re: Can't get permissions to write onto a simple HDD

Post by WharfRat »

I don't want to get into a long explanation here, but the /media folder will have one default subfolder being the user's login.

That folder is used by udisks to mount usb storage devices either by UUID or label name.

However it's under the control of access control lists (man acl) which is an additional layer of permission complexity.

Therefore I recommend not using that folder as a mountpoint.

You can revise my prior post with this:

Code: Select all

sudo mkdir /media/DogHouse

sudo mount /dev/sdc1 /media/DogHouse

sudo chown $USER:$USER /media/DogHouse
And the fstab entry

Code: Select all

# /dev/sdc1
UUID=6b2f7da5-58c8-41a6-8579-2b6252c42e9b  /media/DogHouse   ext4	  errors=remount-ro,nofail,user,noatime    0 0
Again good luck :wink:
philotux

Re: Can't get permissions to write onto a simple HDD

Post by philotux »

WharfRat wrote: Tue Dec 18, 2018 7:44 pm I don't want to get into a long explanation here, but the /media folder will have one default subfolder being the user's login.

That folder is used by udisks to mount usb storage devices either by UUID or label name.

However it's under the control of access control lists (man acl) which is an additional layer of permission complexity.

Therefore I recommend not using that folder as a mountpoint.

You can revise my prior post with this:

Code: Select all

sudo mkdir /media/DogHouse

sudo mount /dev/sdc1 /media/DogHouse

sudo chown $USER:$USER /media/DogHouse
And the fstab entry

Code: Select all

# /dev/sdc1
UUID=6b2f7da5-58c8-41a6-8579-2b6252c42e9b  /media/DogHouse   ext4	  errors=remount-ro,nofail,user,noatime    0 0
Again good luck :wink:
sdc1 is on an external usb drive. Wouldn't that make a difference? I mean if it is not plugged in at boot. Ofcource nofail takes care of it. Doesn't it?
Last edited by philotux on Tue Dec 18, 2018 7:50 pm, edited 1 time in total.
WharfRat

Re: Can't get permissions to write onto a simple HDD

Post by WharfRat »

I added the nofail option to fstab so there shouldn't be any problems.

And I'm pretty sure udisks checks for an fstab entry and uses it instead of /media/username
philotux

Re: Can't get permissions to write onto a simple HDD

Post by philotux »

Sure, I missed that. I was adding it to my previous post while you had posted already. Great!
holmzie
Level 1
Level 1
Posts: 20
Joined: Sun Oct 28, 2018 2:02 pm

Re: Can't get permissions to write onto a simple HDD

Post by holmzie »

IT WORKED!

I'm so lucky that WarfRat and philotux are around. Yes. I am the type to attempt to reverse engineer the solution so I learn something in the process.

I entered ...."$USER:$USER"...literally, and it worked! That could be some sort of wild card entry for my user and computer name...? Could/should i of entered "holmzie:holmzie" instead? So when move the external drive to one of the other machines, I suppose I would have to teach the next machine to like the new external HD like I just did today?

When I installed 18, I should of used names that are not the same as "holmzie holmzie, shouldn't I. It's not clear to me which is which, and why, in the process of installing. I don't know which goes where. I have to learn why it's not right to name different machines the same name!! Duh!

I will mark this thread as solved soon, and I look forward to any hints, threads, and tutorials you all can point me to. Thank you again.

holmzie N2EXG (I started with linux in ubuntu and migratred two years later into Mint 16)
WharfRat

Re: Can't get permissions to write onto a simple HDD

Post by WharfRat »

$USER is an environment variable that stores the login name as you can see from echo $USER:$USER

So entering that would be the same as using holmzie:holmzie for chown.

Each user will belong to a group of the same name that you can see with groups and id

Your user and group id number will be 1000. You can use ls -nh ~ that shows the ids in place of the names.
holmzie
Level 1
Level 1
Posts: 20
Joined: Sun Oct 28, 2018 2:02 pm

Re: Can't get permissions to write onto a simple HDD

Post by holmzie »

Tks Warf: Checked 'em in terminal, really amazing. Will check back in AM, gonna install 19 now, 'bout 10:55 pm here in Joisey. Hit the sack soon. Tks!
Locked

Return to “Beginner Questions”