/etc/fstab bing a very important NTFS drive on boot

16 hours ago by Skullgrid to c/linux4noobs

Debian 13.

I have an FSTAB config that auto mounts a second drive , NTFS fstype that used to be on windows (same laptop) UUID=666 /media/userName/Data auto defaults,nofail,x-systemd.automount 0 2

Because the /media/userName/Data path was made in a way that didn't transfer ownership to my user, and because I am clueless about user/group management on linux, Virtual machine manager and jenkins and all the other program based users that don't really get a "real" user I can manage on cockpit or similar (AFAIK) can't use that disk for writing information to and etc.

I already tried to change owner to a shared group in a shitty way that locked me out of that very important drive. Also, it doesn't seem to work anyway, and just fucking sets it back to root or ignores it when I try to do it.

What's the simplest change I can make to the fstab entry or ownership to make use of that drive for jenkins pipelines , steam games and most importantly, Virtual Machine Manager guest machines?

This shit scares me, and I have very little time, so I will get back to you guys in due time, and appreciate your assistance.

timroerstroem 4 points 12 hours ago

Try adding uid=<your uid>,gid=<your gid> to the mount options. id will show your uid and gid (probably 1000). That should give you ownership of the file system.

path: 0 26291597, hotness: undefined, score: 4, children: 1
Skullgrid 1 point 7 hours ago

can I share it with a group like that too? like 1003?

UUID=666 /media/userName/Data auto uid=1000,gid=1000,groups=1003 defaults,nofail,x-systemd.automount 0 2
?

path: 0 26291597 26294572, hotness: undefined, score: 1, children: 0
stembolts 3 points 7 hours ago

You can't set permissions and ownership because NTFS doesn't support Linux style permissions and ownership.

Why not copy the data elsewhere, format drive to ext4 or btrfs, then copy the data back? Don't use NTFS on Linux unless you enjoy having less control, unless you're sharing the drive with Windows then you have no choice I suppose.

TLDR: NTFS bad (not really, but sort of).

If you are staying on NTFS, you can stop reading here.

Anyway if you decide to migrate off NTFS, and assuming your username is zapBrannigan:

(recursively sets user ownership to zapBrannigan, sets group ownership to root, setting the group to root is a nice default because it's effectively "no group" and limits access to non-privileged, non-you users)
sudo chown -R zapBrannigan:root /path/to/drive

(recursively sets user, group, other permissions, where 664 corresponds to "allow rw-rw-r--", in this representation, the mode bits 664 are a binary mask, 6=110, 4=100, so you're setting 110110100 which sets the allow described above)
sudo chmod -R 664 /path/to/drive

The first command sets ownership to you, the user. The second command allows the user to read and write every file, and other users to read every file, set to 660 to forbid other users.

After that I suspect your fstab issue will become solvable.

If anything scares you, audit the data and backup the critical segments before working with the drive. I am assuming you don't have free space to backup the entire drive, if you do, then just do that.

path: 0 26294491, hotness: undefined, score: 3, children: 0
linux4noobs
linux4noobs

@programming.dev

login for more options
4496
307
69

linux4noobs


Noob Friendly, Expert Enabling

Whether you're a seasoned pro or the noobiest of noobs, you've found the right place for Linux support and information. With a dedication to supporting free and open source software, this community aims to ensure Linux fits your needs and works for you. From troubleshooting to tutorials, practical tips, news and more, all aspects of Linux are warmly welcomed. Join a community of like-minded enthusiasts and professionals driving Linux's ongoing evolution.


Seeking Support?
  • Mention your Linux distro and relevant system details.
  • Describe what you've tried so far.
  • Share your solution even if you found it yourself.
  • Do not delete your post. This allows other people to see possible solutions if they have a similar problem.
  • Properly format any scripts, code, logs, or error messages.
  • Be mindful to omit any sensitive information such as usernames, passwords, IP addresses, etc.

Community Rules

  • Keep discussions respectful and amiable. This community is a space where individuals may freely inquire, exchange thoughts, express viewpoints, and extend help without encountering belittlement. We were all a noob at one point. Differing opinions and ideas is a normal part of discourse, but it must remain civil. Offenders will be warned and/or removed.
  • Posts must be Linux oriented
  • Spam or affiliate links will not be tolerated.

go to feed...