Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

In my experience, the remaining difficulties with Linux tend to revolve around managing ownership and permissions of files and directories.

I recently plugged in my external hard drive into my Linux PC and it just wouldn't read it. "You do not have permission to access this drive" or something like that. The solution after googling ended up being (for some reason) some combination of sudo chown -R user /dev/sda1 and unplugging and reconnecting the drive.

No way to do that from the GUI (on KDE at least) and I'm not sure how I'd even solve that problem if I didn't know the super user password.

Still glad to be using Linux, of course, but sometimes these problems still pop up.



Don't make block devices directly read/write-able to your user unless you want every user process to be able to have raw disk access to it.

Your distro should have been set up so that you can mount USB drives indirectly through the options your DE exposes.


This shouldn't happen with external disks formatted with ntfs, ext or udf. If you have an EXT4 or something like that external disk things get more hazy...


Whether it should or shouldn't, it did. But I think the issue is less that it happened, and more that the user interface doesn't respond to the "no permission" error by offering up a button you can click to attempt to grant yourself permission. If it can be done through the terminal, there should be a novice friendly way as well.

(For that matter, a novice user shouldn't even have to know how their external hard drive is formatted! It might not even be their drive; it could be a family member attempting to share photos with them. If they're just plugging it in for the first time and seeing errors, they'd be pretty hesitant to mess around with the terminal typing in commands they don't understand).


Sorry, I didn't mean to imply this isn't an important problem that needs to be addressed. I mostly agree with what you say and I bet the right way to deal with this is to have it be mounted with a special user space filesystem like fuse that wraps the permissions to always look correct for the user that mounted it, but I guess no one so far has decided to take upon such task...


Can't it just do what I _mean_ if it's a Desktop install and mount it like ntfs, udf, or etc?


no? A file system is the format that the data on the disk is stored as. If you mount an ext4 disk as ntfs, it wouldn't load properly. It's not just the interface for loading the data, it's how the data is actually stored.


What I mean is that it should ignore permissions on external ext4 by default in Desktops.


There's no concept of "external". What would it be, "USB" or anything mounted under /mnt or /media? What if it's the root OS drive of another computer you're trying to fix connected through a USB-SATA adapter? Should any program running with minimized privileges get to overwrite even root files in that OS drive?

I think that it's a pretty good heuristic that if permissions exist in the filesystem, they matter and shouldn't be ignored.


They shouldn't be ignored. but they can be ignored, is the problem. File permissions are not encryption or security: If I can't read a file on this machine, because I'm not root, I'll just move the drive to a different machine where I am root.

But I agree with you, they do have a use and to some use cases matter, and we shouldn't arbitrarily decide to ignore them.


I don't doubt you had that problem. But it, and the solution you want, sound a bit strange. You want a button that gives your user access to everything despite its access settings... Than login and work as root.

I mean it's hard to tell what really happened. But a different user could have created this files with access rights only for himself on purpose. Something one can do with NTFS on Windows too. It also could have been a distro bug.

> but sometimes these problems still pop up.

I'm a 90% Windows- 9.5% Linux- 0.5% Mac-Admin at day job: Don't tell me Windows has no problems poping up. ;-)


Yes. Another user could have restricted access rights on purpose, maybe? But I can still apparently seize them for myself by typing an arcane command into the terminal. Why shouldn't the UI give me a way to do this more easily?

If it requires typing in an admin password to solve, so be it, but at least the UI could lead me to the answer while offering a password prompt.

And yes, I wasn't telling you that Windows has no problems. In fact, Windows probably caused this problem -- this drive worked just fine with Linux the night before; then I transferred some files into it from Windows and plugged it back into my Linux computer and suddenly this happened. I have no doubt that Windows was responsible for messing up the drive state and causing the problem. But to a non-technical user, it's not a question of who is to blame; Windows reads the drive fine whereas Linux gives an error that has no obvious solution. And it can't be solved by right clicking the drive in the explorer and selecting "take ownership and mount" or something like that, it requires using an unfamiliar command into the terminal to fix the problem. And that's basically the case with most file-permission errors that I encounter on Linux systems.


>Windows reads the drive fine whereas Linux gives an error that has no obvious solution. And it can't be solved by right clicking the drive in the explorer and selecting "take ownership and mount" or something like that, it requires using an unfamiliar command into the terminal to fix the problem. And that's basically the case with most file-permission errors that I encounter on Linux systems.

That definitely seems like a feature that could/should be added to some (most? all?) linux file managers. In fact, it doesn't even sound like that difficult to implement with standard system calls[0].

It's not really an issue for me (I prefer the command line -- heck, I still use octal when setting permissions instead of 'rwx'), but it sounds like it bugs you a lot.

You don't mention which Desktop Environment (DE) you're using, but I imagine the file manager in your DE is open source. As such, I'm sure you could make yourself and the (I'm sure) many others who'd like to be able to modify file/dir/filesystem permissions/ownership via their GUI file manager much happier.

Try doing that with Windows Explorer or Finder. I think not.

Good luck!

[0] https://www.tutorialpedia.org/blog/how-to-change-show-permis...

Edit: Clarified prose.


Hm, I'm a KDE user. I just tested what happens when I try to open a folder I don't have access rights for. The standard file browser Dolphin says authentication is required. "Act as administrator." If clicked there comes a warning and I can enter my password. Than it shows the content.

https://i.postimg.cc/VLgkWpy7/image.png

This feature exists since 2022.

https://kde.haraldsitter.eu/posts/kio-admin/


Good! That's exactly what I would like to have happen! I think the error was more like that it didn't have permission to mount the drive. I logged the message at the time, but I don't have access to that computer this week, so I'm going from memory.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: