You are not logged in.

#1 2015-07-31 19:49:36

Somnus
Member
Registered: 2013-07-16
Posts: 105

[solved] chown at bootup

[Solve: The fix was to mount it to a fixed mount point and add that to fstab]

Hello guys,

I'd like to chown /run/media/user at bootup, and was wondering if anyone could help me figure out how. I've searched around but most of the answers say to add it to /etc/rc.local. I don't have this on my system and I'm not sure if it's still used, or if I need to create it.

Thanks for the help!

Last edited by Somnus (2015-08-01 00:55:59)

Offline

#2 2015-07-31 19:56:50

clfarron4
Member
From: London, UK
Registered: 2013-06-28
Posts: 2,163
Website

Re: [solved] chown at bootup

IIRC, /etc/rc.local goes back to the initscripts way of doing things, and Arch hasn't done that in years.

One way to do it could be startup scripts for systemd? This might be relevant?

To be fair, I might be talking absolute rubbish, because I haven't messed around with file-systems like that in a while.

EDIT: Welp, looks like, unless we get more context, I might be right on my last comment, given WorMzy's post below.

Random Thought: I know it can be quite annoying that if user X is logged in and mounts a drive USB1 (mounted at /run/media/X/USB1), a user Y logs in (whilst user X is logged in and USB1 is still mounted at /run/media/X/USB1) and wants to access USB1, but can't. Is this thought relevant to the discussion we're having here?

EDIT2: 2ManyDogs' suggestion is a good one and should work.

Last edited by clfarron4 (2015-07-31 20:25:40)


Claire is fine.
Problems? I have dysgraphia, so clear and concise please.
My public GPG key for package signing
My x86_64 package repository

Offline

#3 2015-07-31 20:04:03

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,894
Website

Re: [solved] chown at bootup

Why do you want to do this? /run/media/ doesn't even exist at boot up.

http://mywiki.wooledge.org/XyProblem

Last edited by WorMzy (2015-07-31 20:04:47)


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#4 2015-07-31 20:09:44

Somnus
Member
Registered: 2013-07-16
Posts: 105

Re: [solved] chown at bootup

The reason I want to do it is that I have an external hdd attached, and when it's loaded it's mounted at /run/media/user/My Passport.

I have a plex media server set up, and I cannot use it to stream content from the "My Passport" device because the /run/media/user is owned by root. If I manually chown it, then I can stream media. However, when I reboot, the folder reverts back to root ownership.

Can you help me get to X if Y isn't right?

Last edited by Somnus (2015-07-31 20:10:44)

Offline

#5 2015-07-31 20:16:20

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,645

Re: [solved] chown at bootup

Mount it at a persistent mount point, and put it in fstab.

https://wiki.archlinux.org/index.php/Fs … al_devices

Offline

#6 2015-07-31 20:27:10

Somnus
Member
Registered: 2013-07-16
Posts: 105

Re: [solved] chown at bootup

2ManyDogs wrote:

Mount it at a persistent mount point, and put it in fstab.

https://wiki.archlinux.org/index.php/Fs … al_devices

That sounds like a better way. Now, on boot it was automatically being mounted at /run/media/user. By putting it in fstab it will override that?

Offline

#7 2015-07-31 20:38:47

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: [solved] chown at bootup

Keep in mind that if you go the fstab route, you'll either need to always have it attached when booting or put 'nofail' or 'noauto' in the options. If I were you I'd use 'nofail' regardless... I use it even on non-removable volumes if they aren't boot essential:

/dev/vg0/v_build	/home/alphaniner/build	ext4	defaults,stripe=512,data=ordered,nofail	0 2
/dev/vg0/v_kvm		/mnt/kvm		ext4	defaults,stripe=512,data=ordered,nofail	0 2

But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#8 2015-07-31 20:41:45

Somnus
Member
Registered: 2013-07-16
Posts: 105

Re: [solved] chown at bootup

That worked perfectly (at least with the drive attached. I haven't tried booting with it removed, though I plan on leaving it attached, and did put in the nofail option.)

Thank you. This route didn't immediately spring to mind because it was automatically being mounted somewhere else. I've never fstab'd external media before.

Thanks again for, as always, being so prompt with help!

Offline

#9 2015-07-31 20:58:07

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,645

Re: [solved] chown at bootup

alphaniner wrote:

Keep in mind that if you go the fstab route, you'll either need to always have it attached when booting or put 'nofail' or 'noauto' in the options.

Oh look! "nofail" is specifically mentioned in the wiki entry I linked! (-:

Somnus, you're welcome, and thanks for marking it [solved].

Last edited by 2ManyDogs (2015-07-31 20:58:58)

Offline

Board footer

Powered by FluxBB