media group gid changed (9.10.2-U6 to 11.2-U3)

asmodeus

Explorer
Joined
Jul 26, 2016
Messages
70
Hello,

I replicated all my data to a new box and just upgraded it from 9.10.2-U6 to 11.2-U3. Annoyingly, during this process, the media group gid changed from 1003 (what I had before the upgrade and still have on the backed up box) to 8675309 (11.2-U3). This of course borked the permissions on the datasets and does not play well with the plugins configuration.

How can I fix this? Is this a known bug? Changes made via vipw do not survive a reboot and editing guid is not available via the UI unless I create a new group.

Thank you,
Achim
 

cods69

Explorer
Joined
Sep 11, 2016
Messages
50
This is probably of no help, but have you tried importing your old config into the new system? Sounds like you are fortunate enough to have the original box and can afford to play, but I have no idea of cross version config compatibility, but may be worth a try.
Sounds like a very annoying problem, which is one of the reasons I'm still running 9.10.2-U6. I've got 7 groups with about 19 users so this is now another reason I'll avoid upgrading until I build a new system to replicate to.

I'd love to see a clear official upgrade path which includes clear caveats to all the problems that emerged over the years, for all the cautious users out there.
 

asmodeus

Explorer
Joined
Jul 26, 2016
Messages
70
Completely agree on delaying the upgrade - I would not upgrade my box if it was the only one.
The gid change is very annoying. I'm looking for a way to change the media gid on the freenas master/root volume, but no luck so far. Maybe this is even hard-coded, during startup I see some user/group stuff scrolling by.

Would importing a 9.10 config into 11.2 work at all?
 

KrisBee

Wizard
Joined
Mar 20, 2017
Messages
1,288
@asmodeus Your problem stems from iXsystems adding an in-built system group "media" with GID 8675309 to FreeNAS11 which I suspect did not exist in FN9.10. Importing a 9.10 config into 11.2 will have the same collision, lead to the same result, or may even fail.

As you can't change the GID of the "media group", and you can't have the same group name associated with two different GIDs, surely you must create a new group with a GID of 1003 on the your replicated system and then sort out the data's owner/group?
 

asmodeus

Explorer
Joined
Jul 26, 2016
Messages
70
Yes, I think that's where the problem originates from. I am looking for a solution that allows me to keep the jails running on both boxes and not touch their configuration. With the media group present on the target system, what would happen to the media group mapped in the jails? Does this create a conflict? They are set up/used as follows in /etc/passwd, /etc/group:

media:*:1003:1003:Media User:/nonexistent:/sbin/nologin

media:*:1003:nobody
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
adding an in-built system group "media" with GID 8675309 to FreeNAS11 which I suspect did not exist in FN9.10.
I believe the change happened somewhere during the 9.10 series, and the way it was initially implemented broke things for people who already had a media user/group (I think 816 was the typical uid/gid before then). But resolving this should be straightforward enough--delete Jenny's number, and create a new media user with uid/gid of 1003.
 

asmodeus

Explorer
Joined
Jul 26, 2016
Messages
70
I'm not 100% sure right now, but I believe last time I deleted the media group with Jenny's number it was re-created with that number after boot.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
I went to test this, and can't find a way to delete that user at all. That's odd. Though I guess it's consistent with what the manual says:
1557086915220.png

...though why this user would be considered "needed by the system" is beyond me.
 

asmodeus

Explorer
Joined
Jul 26, 2016
Messages
70
Right, I edited passwd/group directly, both with vipw and vi. The built-in users are reset to defaults during startup. Any hints on the "template" that drives this and a way to modify it?
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
I edited passwd/group directly,
Yeah, that definitely won't work. The config database is a SQLite file at (IIRC) /data/freenas-v1.db. I'm 99% sure you could make the necessary changes there. What might be safer would be to just remove the flag that makes media a system account (edit: specifically, that looks like the account_bsdusers and account_bsdgroups tables, and the bsdusr_builtin and bsdgrp_builtin columns), then you could delete it (and add the replacement with the correct uid/gid) through the GUI.
 
Last edited:

asmodeus

Explorer
Joined
Jul 26, 2016
Messages
70
Thank you @danb35! Got it sorted with sqlite:


sqlite3 /data/freenas-v1.db
update account_bsdgroups set bsdgrp_builtin=0 where bsdgrp_group='media';


Then re-created the group via the GUI and set the GID.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Excellent. I probably should have warned you to make a backup of the config file first, but looks like you were able to make it work without breaking anything.
 

Liriel

Dabbler
Joined
Mar 14, 2014
Messages
40
Thank you @danb35! If any one else comes across this thread and wants to set the media user to not builtin so they can delete it, the command is:

Code:
update account_bsdusers set bsdusr_builtin=0 where bsdusr_username='media';
 
Top