× NETGEAR will be terminating ReadyCLOUD service by July 1st, 2023. For more details click here.
Orbi WiFi 7 RBE973
Reply

How to recreate user home share?

Korack
Aspirant

How to recreate user home share?

Somehow I deleted all the users home directories and I cannot recreate them via command line.

I have already shares with the users names for example \\ReadyNAS214\Bob which is located at /data/Bob but /home/bob does not exist. As root/admin am not allowed to create a new one.  This is only an issue if the user wants to ftp or ssh into the NAS.

 

I've tried many options but cannot seem to find a way to fix it. I even attempt to change the home directory in /etc/passwd which works for a while. For example, I changed Bob's home from /home/bob to /data/Bob which worked but is eventually reset to /home/bob but /home/bob does not exist. Is there a tool to recreate the end user's home directory?

 

Thanks in advance for any help.

 

Cannot recreate home or import ssh keysCannot recreate home or import ssh keys

Model: RN214|4 BAY Desktop ReadyNAS Storage
Message 1 of 13
StephenB
Guru

Re: How to recreate user home share?


@Korack wrote:

Somehow I deleted all the users home directories and I cannot recreate them via command line.

I have already shares with the users names for example \\ReadyNAS214\Bob which is located at /data/Bob but /home/bob does not exist. 

No idea how you deleted them.

 

But as far as recreating them goes: You can't have two shares with the same name (and the home folder is a share, just locked down). SMB is case-insensitive, so Bob and bob are treated as the same name.

 

First,  delete the Bob share. 

 

Then try accessing the NAS with Bob's user credentials via SMB - e.g., using File Explorer (Windows) or Finder (MacOS).  Alternatively, log in with ssh (as root) and enter rnutil mkhomedir_helper Bob .  Match the case of the actual user account (e.g., enter bob if the username is lowercase).

 

Message 2 of 13
Korack
Aspirant

Re: How to recreate user home share?

Thanks for the reply. I deleted the share Bob. Tried logging in via SMB & ssh as "bob", It still does not create /home/bob.

Your command was helpful but did not actually fix it.

 

I get the following error:

# rnutil mkhomedir_helper bob
INFO: Checking homedir for user bob
ERROR: /home is on the root fs.

 

FYI - I deleted the home directories with a bad rsync command. Funny I could delete the directories but not create them.

 

Message 3 of 13
StephenB
Guru

Re: How to recreate user home share?


@Korack wrote:

I get the following error:

# rnutil mkhomedir_helper bob
INFO: Checking homedir for user bob
ERROR: /home is on the root fs.

 

FYI - I deleted the home directories with a bad rsync command. Funny I could delete the directories but not create them.

 


Does /data/home exist?  I am guessing not, but we should confirm.

 

/home is a mount point for /data/home - and I think the error message is telling you that /data/home is not mounted on /home.

 

 

Message 4 of 13
Korack
Aspirant

Re: How to recreate user home share?

That does actually appear to be the case. Not sure how to fix on ReadyNAS.

 

# ls /home
root@READYNAS:/data/homeadmin user1 user2 user3 user4 user5 user6 user7

 

I own 2 ReadyNAS 214. One @ my home and my adult kids home to backup between them. The other is working fine and mounting /home to /data/home. The mount is not done via /etc/fstab.

 

Not Working:

# cat /etc/fstab
LABEL=50333ce8:data /data btrfs defaults,nodatasum 0 0


Working:

# cat /etc/fstab
LABEL=2db97e6f:data /data btrfs defaults,nodatasum 0 0

 

So it appears to be a Netgear method that I cannot find.


Any tools to fix this? 

 

Message 5 of 13
StephenB
Guru

Re: How to recreate user home share?

Have you tried rebooting the NAS?

 

Maybe delete anything in /home first (as it should be empty, since it is just a mount point).

Message 6 of 13
Korack
Aspirant

Re: How to recreate user home share?

/home is empty

Message 7 of 13
Sandshark
Sensei

Re: How to recreate user home share?

The home volume is mounted by /etc/systemd/system/multi-user.target.wants/home.mount .

Message 8 of 13
Korack
Aspirant

Re: How to recreate user home share?

Not sure how to run /lib/systemd/system/home.mount

It's not a script but rathe a configuration file.

Message 9 of 13
StephenB
Guru

Re: How to recreate user home share?

Again, the simplest way is to reboot.

Message 10 of 13
Korack
Aspirant

Re: How to recreate user home share?

I actually did a reboot when I noticed /home was not mounted. 

 

I think it might be related to recently I disabled X-RAID because I added a Media Sonic Proxbox with (4) 3TB drives for a actual backup. I did not want to add the drives to the current RAID because the sizes are different and I don't want issues if the external enclosure loses power or fails.

 

I see another post which I cannot relocate but them mentioned /home not mounting after disabling X-RAID. I'm not sure it is the same cause but it seems related.


The only truly negative effect of no /home that I have found so far is I cannot import or update SSH keys or ssh in as my regular user. I can still SSH as root which is OK but I prefer NOT to be root.

Message 11 of 13
StephenB
Guru

Re: How to recreate user home share?


@Korack wrote:

 

I think it might be related to recently I disabled X-RAID


I doubt it.  I don't use X-RAID on one of my OS-6 NAS, and home is mounted as normally. 

 

Do you know what that rsync command over-wrote?

 

You can of course manually mount it.  

# mount --bind /data/home /home

That works around the problem for now, but you'd need re-do it every time you reboot the NAS.

 

You could also try

# systemctl daemon-reload

That should remount everything.  In your case it likely won't, but there might be an error that could give a clue.

 

Message 12 of 13
Sandshark
Sensei

Re: How to recreate user home share?


@Korack wrote:

Not sure how to run /lib/systemd/system/home.mount

It's not a script but rathe a configuration file.


You don't normally run it.  Systemd does at start-up.  What results do you get from systemctl list-units --type=mount  and  systemctl status home.mount?   If you get no status, I suppose something could have disabled the mount, so try  systemctl enable home.mount and then reboot if it gives you no error.  I've never tried to manually start a .mount, but systemctl start home.mount may work or at least give you a useful error message.  You may have to specify the entire path to home.mount.

 

Also, the content of /lib/systemd/system/home.mount should look something like this:

 

[Unit]
Description=Home Directory
Before=readynasd.service
ConditionPathIsDirectory=/data/home

[Mount]
What=/data/home
Where=/home
Type=none
Options=bind

[Install]
WantedBy=multi-user.target

And the attributes like this: -rw-r--r-- 1 root root .

Message 13 of 13
Top Contributors
Discussion stats
  • 12 replies
  • 1881 views
  • 0 kudos
  • 3 in conversation
Announcements