SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I wiped my portable harddrive and when I went to remount it as USER, it's not writeable.
/dev/sdc1 ---> /run/media/blah/123blahblah567/
When I ls -l /run/media/blah/123blahblah567 it's RWX------
This got me to thinking (since I have never really had to do this before):
What is the most Slackware correct way to set ownership and permissions on portable drives?
Do I CHOWN/CHMOD /dev/sdc1 ?
Do I CHOWN/CHMOD /media/run/blah ?
Do I CHOWN/CHMOD /media/run/blah/123blahblah567 ?
When you insert a removable disk, it is managed with udev.
On Slackware the udev rules for it are by default in private access for the user logged in.
You should not correct the permissions by hand with chmod and chown for those devices. It probably won't work.
If you want shared mounts, you can change the default in an udev rule above the default one in /usr/lib*/udev
The change will work with all removable devices. Or else select the one you want in the udev rule.
Else you can also mount with :
> udisksctl mount -b /dev/XXX in a console with your other user logged.
Unmount with :
> udisksctl unmount -b /dev/XXX
=========
/etc/udev/rules.d/99-udisks2.rules
# UDISKS_FILESYSTEM_SHARED
# ==1: mount filesystem to a shared directory (/media/VolumeName)
# ==0: mount filesystem to a private directory (/run/media/$USER/VolumeName)
# See udisks(8)
ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{UDISKS_FILESYSTEM_SHARED}="0"
Last edited by BrunoLafleur; 08-09-2023 at 03:31 AM.
I wiped my portable harddrive and when I went to remount it as USER, it's not writeable.
[snip]
If I were to say I "wiped a hard-drive", then the hard-drive would have NO partitions, and no formatting, and every byte would have been over-written at least once.
What file system did you choose when formatting? Some file systems does not care about the concept of users and groups. Other file systems lets you choose owner at formatting (default root).
Have you unplugged it without unmounting it first?
That's probably set the dirty bit so it now mounts with -o ro and you may have to run fsck on it before mounting it with -o rw again.
Ext4. All of my portable drives (not thumb drives) are Ext4.
Unless you give some special options to mke2fs, by default the ext4 file system will be owned by root and only the root user will have write access to the top level directory. This is even if you created the file system as a normal user. However, if you give the option:
Code:
mke2fs -t ext4 -E root_owner ...
The top level directory will be owned by the user that created the file system. Be aware that when moving a portable drive like this between different systems those systems need to have /etc/passwd and /etc/group syncronized in some way, manually or with a service like NIS or LDAP to have the same point of view of which user has which numerig uid and which group has which gid.
Have you unplugged it without unmounting it first?
I'm really good about umounting soooo, probably not. But, you may be right, I may have slipped. I was doing ALOT of drive swapping that day.
Quote:
Originally Posted by henca
Unless you give some special options to mke2fs, by default the ext4 file system will be owned by root and only the root user will have write access to the top level directory.
Good point... 99% of the time I'm root when using these drives. They are my backup drives and I always rsync as root to/from these. Now, I can't remember if I was USER when this happened. I may have been.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.