Setting permissions / ownership

Line 13, after auto add: umask=0000
Make sure to have space before and after (not touching auto or nosuid)

3 Likes

Sorry, I'm lost about what to type into the terminal - I'm new to this. :frowning:
Also, the articles I looked at said 0 = no permissions, 7 = all, so wouldn't 0000 be the opposite of what I need?
I just want to make sure all the files and folder on my data drive (not the OS drive) won't ever lock me out if I reinstall the OS, copy them to a new PC, access them via an emergency USB OS etc.

I checked my currently mounted external drive in fstab:

My entry is like this
(drive UUID) / ext4 errors=remount-ro 0 1

I saw your drive is set to
0 0

While mine is
0 1

2 Likes

I'm really sorry, I have no idea what the numbers mean! Permissions etc is a total mystery to me. The more I read, the less I can get my head round how it translates into real world scenarios like mine ... :frowning:

I wonder what @Aravisian might think about your fstab.

1 Like

It's an octal not the regular permission numbers and is equivalent to 777. You can look it up online.

I gave you everything you need to make it work....in steps....so I'm not doing it again. You were in the file as root...so you followed them fine once.

Good Luck

3 Likes

Aravisian thinks that Karl has a very good reason to be paranoid.

But... is being paranoid and over-worrying the issue. :wink:

karl, I think that given your profession as an author, with a large number of essential files, you fear that you will lose permissions to these files and lose access to them. This will not happen.
The Worst Case Scenario would actually be only that you may not have read / write access to a file on a separate drive. While annoying, this is not only not data loss, but due to its very nature cannot create data loss. You are actually more secure.
What you want it to eliminate the annoyance.
But first, we must establish whether or not you have this annoyance. Can you clarify this?

3 Likes

Ah, I'm learning a lot, sorry for being slow. And thank you for your patience. :slight_smile:

1 Like

Ha ha, you have me to rights!

Yep, maybe it is just paranoia. Basically I have my personal files (work etc) all on a separate HDD (it was D: in Windows). I've always done that. Sometimes I have reinstalled an OS (with or without the same "username") on the separate OS drive, but access my data files as before; sometimes it has been a new PC, so the data drive has then been filled with my files from the backup drive.

As such, my personal/data files have been created and modified on various computers and operating systems over the years. So I have a kind of worry that their metadata is in a bit of a mess - that different files and folders will be tied to different ownerships and permissions. I am worried about that potentially causing problems like I had once in Windows, where I couldn't make changes to some of my files because Windows seemed to think they weren't mine. So that's where the pranoia sets in.

Now, it may be that when I copied all my files off my backup drive to my new Linux PC all the permissions and ownerships got reset anyway and became the same. Or maybe when I reformatted half of the drive as an ext4 partition and put the files and folders on that they got reset. Maybe everything is fine there. It partly stems from the fact that there's no way to look at a drive as a whole, with its 100,000+ files and folders, and check that they all have whatever permissions and ownership they should, which is why I thought resetting them in some way might achieve that.

This is purely for my data drive, not the OS drive. I'm happy to let Linux do whatever it needs to do to that!

The situation was probably complicated by my inability to load Linux last week. I could boot into Windows but that couldn't read my data drive partition that is ext4. But that was fine. I knew I could reinstall Linux and I'd be able to (hopefully!) access my data drive as before, even though I might appear like a new user then.

However, I knew that reinstalling Linux would wipe my OS drive. And that, by default, Linux stores all my Desktop files on that drive. So I needed to pull them off before reinstalling Linux. But when I booted into Zorin from USB and tried to copy the Desktop files off my OS drive, it wouldn't let me, saying I didn't have permission or wasn't the owner, which is an example of the security being a barrier that got me more worried.

That's why I also thought that it could be a good idea to make sure my Desktop is stored on the data drive, not the OS drive. That would prevent that problem ever happening again. I'd be able to reinstall the OS, then follow whatever procedure put the Desktop on my data drive in the first place, and nothing would be lost. (Assuming that moving the Desktop to the data drive didn't keep restricted permissions that might lock me out - that there's be some way to make sure it acted like any other folder on my D drive).

So Desktop on D: would perhaps remove one of the problem scenarios where I know I could lose important files. This is fresh in my mind after last week's scare! My Desktop is my workspace for projects before they go into long term D: storage. The Desktop has current drafts of books, cover designs, current Kickstarter projects and fulfilment levels etc.

(Note: I don't want to move the whole Home set of folders to my D: - I don't use any of them, and when I reinstall an OS I like everything to be reset apart from my personal files. If the Home folders is anything like Windows User folders, it can fill up with all sorts of crud put in there by software, one of the reasons I never back that up - losing all the old stuff is part of a fresh install for me.)

Does that make sense? Sorry for writing another novella.

Yes, there is an easy way to do this and it was covered by @FrenchPress and @337harvey above.

It's actually safer than you worry. But please bear in mind, you are trying to flood your brain with a lot of learning quickly. You are impatient to get right to work.
I struggle with this mindset, so I understand it. I am impatient and I wish to have all the knowledge I need and I want it Now, Right Now.
Sadly, we must, at times, sit back and let experience teach us rather than attempting immersive learning. As long as your data is safely stored on the "D" drive, it is safe. So, you can afford to relax a little. And should you run into a permissions issue, which can happen and has happened to me recently even : One or Two commands issued in terminal will fix it right up.

Your real worry should be about the D drive developing bad sectors and failing.

Yes, this can happen. I always overcame this easily by mounting the drive as me, then entering my password. Easy peasy.

Yes, you can have your Home Directory on the Data Drive if you want to. And this would also have the bonus of backing up your Home Directory and all personal settings and configurations. :slight_smile:

I do not advise this. I understand your reasoning, but Home does not fill up on Linux like it does on Windows. Windows tends to mix Root and Home together in an illogical way.
But you can get most of what you need by creating the directories you want on the primary drive and using them instead of the ones in home. For example, redirect "Downloads" to the primary drive instead of to the home ~/Downloads directory.

2 Likes

Excellent, okay, that set my mind at rest. As long as there's a way to override ownership/permissions if I needed to, I can cross it off my list! Thanks.

It's why I do regular backups (and keep them off site). I once had a failure, bought a new (bigger, faster) drive, installed it, copied the files off my backup. I think I lost a bit of work from between backups but not much. But I am very keen on a good backup system (and have two backup drives which I alternate).

Excellent, it makes sense for me to do that. I had thought it would be easier to just do the one folder I want (Desktop), because when I was in
gedit .config/user-dirs.dirs
I saw that other folders could maybe be individually moved, though Desktop wasn't one of them (and as you know, I couldn't alter that file anyway without changing another setting which then stopped the right click New Document menu item from appearing). So storing my Home dir on my data drive would be a good thing to do.

If I did that, would the Home directories on my data drive have the same permissions/ownership as the other files on my data drive, or would they have the restricted permissions of their previous location on the OS drive?

It's okay, no need for that. I don't use any of these:

XDG_DOWNLOAD_DIR="$HOME/Downloads"
XDG_TEMPLATES_DIR="$HOME/Templates"
XDG_PUBLICSHARE_DIR="$HOME/Public"
XDG_DOCUMENTS_DIR="$HOME/Documents"
XDG_MUSIC_DIR="$HOME/Music"
XDG_PICTURES_DIR="$HOME/Pictures"
XDG_VIDEOS_DIR="$HOME/Videos"

It's why I was keen to get rid of them from the file manager, since they were just clutter for me. Thunar and Nemo do that nicely, easily letting me hide them, so that's no longer an issue.

Can I also just confirm something. If I install Linux and set a username of KarlD and a PC name of Ryzen, then a year later reinstall Zorin (maybe a different version) and pick a different username of karl and a PC name of Zorin, does that cause any problems? In the past I have always picked the same username and PC name (e.g. NA) even when I reinstall an OS or move to a new one, in the hopes that it means any files with permissions for NA from the old OS will think I am the original owner so I won't run into problems. Or is that a red herring, and I can pick any username and PC name each time and it makes no difference whether it is the same, or different from, whatever I used on the last install?

(I am referring to my data drive of personal files here, accessed by the OS. Obviously the OS drive would have been completely wiped, so it is only the data drive files that would have been shared between them.) Thanks!

No, it doesn't and I have done this many times.

It Is a red herring. The permissions are set up at time of install and the computer does not remember your name.:wink:

3 Likes

Awesome, many thanks. Now I can go back to more interesting usernames each time I install an OS. :slight_smile:

1 Like

Okay, next is: how do I move my home folders to my Data Drive rather than OS drive?

Also, if I did that, would the Home directories on my data drive have the same permissions/ownership as the other files on my data drive, or would they have the restricted permissions of their previous location on the OS drive?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.