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

Re: Deleting old home directories

Bent82
Guide

Deleting old home directories

A few years ago I upgraded from an old NV to a 314, OS 6.4.1.  I have gotten used to many of the differences, but there is something I still can't figure out how to do.  I use AD for users, and everyone has a home directory.  Over the years people come and go, and right now there are many old home directories that no longer have users associated with them.  However, I don't see a way to delete these old home folders.  Even connecting to the ReadyNAS by ssh and logging in as root, I get an "Operation not permitted" error when trying to remove an old user folder.  Any ideas on what I need to do?

Message 1 of 18

Accepted Solutions
kohdee
NETGEAR Expert

Re: Deleting old home directories

Hi everyone.

 

You can't just delete those old home folders because they're btrfs subvolumes.


Though this is not supported by NETGEAR Support, you can remove old home folders with:

root@rn314:~# btrfs subvolume list /data | grep home
ID 257 gen 516 top level 5 path home
ID 309 gen 133 top level 257 path home/admin
ID 330 gen 516 top level 257 path home/kohdee

root@rn314:~# btrfs subvolume delete /data/home/kohdee
Delete subvolume (no-commit): '/data/home/kohdee'
root@rn314:~# btrfs subvolume list /data | grep home
ID 257 gen 516 top level 5 path home
ID 309 gen 133 top level 257 path home/admin

 

 

By using SMB to connect to the ReadyNAS as admin, you're exposed to the btrfs subvolumes, but you can't delete; however, this lets you delete files and folders from private home shares to regain your missing space from old home folders. 

The subvolumes being there empty hurt nobody. Once you delete the data, the only benefit you get out of deleting the subvolume is for asthetics. 

Your subvolume list might be different because you were on a domain. The difference would look like btrfs subvolume delete /data/DOMAIN/USERNAME

 

Doing this is at your own risk and is not supported by NETGEAR Support. 

View solution in original post

Message 17 of 18

All Replies
JennC
NETGEAR Employee Retired

Re: Deleting old home directories

Hello Bent82,

 

When you map the NAS IP with admin login, you should be able to see a share name Home, this should have all the homes shares of users.

 

Regards,

Message 2 of 18
StephenB
Guru

Re: Deleting old home directories

Does AD still include the now-departed users?

Message 3 of 18
Bent82
Guide

Re: Deleting old home directories

Hi JennC,

 

I am not sure I exactly have what you are referring to, but let me see.  I can log on to the admin webpage of the ReadyNAS, go to the shares tab, and see and browse the home shares.  However, I am unable to delete them, right clicking brings up Browse and Copy, but not delete.  Current users show up as a folder with a figure of a person on it, while old, deleted users show up as just a folder, but both behave the same way.

 

I tried accessing the ReadyNAS though SMB, both as the domain\administrator, and as my own user account (also a domain administrator).  Neither allow me to see any home share other than my own in the shares list, and neither can access anything like \\ReadyNAS\home.

 

 

StephenB, the users I am trying to delete have already been deleted from AD.

Message 4 of 18
StephenB
Guru

Re: Deleting old home directories


@Bent82 wrote:

 

 

StephenB, the users I am trying to delete have already been deleted from AD.


My guess is that the NAS doesn't immediately delete users when they disappear from AD.  If the NAS did that, than any misbehavior in AD itself could result in loss of data.  But there should be some way to delete user accounts.  Maybe try the "Refresh ADS Accounts" control?

 

I don't use AD, so I can't offer much on this.  There are other people here who use it, perhaps one of them knows how to kill off these stale accounts.  You shouldn't be forced to use ssh.

 

Did you try changing the folder/subfolder owner before you deleted with ssh? 

 

 

Message 5 of 18
mdgm-ntgr
NETGEAR Employee Retired

Re: Deleting old home directories

Hi Bent82,

I have asked engineering for an update on this issue.

In the meantime, I have sent you a PM.

Message 6 of 18
nswafford
Aspirant

Re: Deleting old home directories

I am having the same issue. ReadyNAS 104 running 6.4.1. I connect to AD a couple of days ago and yesterday was trying to clean up the home directory. Even when logged on to the ReadyNAS as Admin I am unable to delete old home directories that were once tied to local accounts on the NAS. I only get the option to copy or browse.

 

 

Message 7 of 18
Bent82
Guide

Re: Deleting old home directories

Hi StephenB,

 

Well, the accounts themselves are gone, if I go look at the accounts page I see the same current list of users I see in AD.  That's why I am assuming the folders appear different in the web interface.  What I am concerned about is this folders in /home.  Most of these folders are empty even, it isn't even a space thing, I mostly want this list of folders up to date for a procedure I am trying to write.  In my old NV, I could just browse to /c/ and find the home folders using the domain admin account and delete them, but thyat doesn't work in OS 6.  I was suprised that logging in as root using ssh gave me permission errors as well.  Changing the owner didn't work either.  So I am stumped at the proper way to do this.

 

mdgm, thanks, PM sent.

Message 8 of 18
JennC
NETGEAR Employee Retired

Re: Deleting old home directories

Hello Bent82,

 

What happens when you map the NAS IP (SMB) and login as admin? This is using the default admin user account of NAS.

 

Regards,

Message 9 of 18
Bent82
Guide

Re: Deleting old home directories

I tried this and I don't seem to be able to map.

 

net use q: \\10.50.38.6 /user:admin password

 

I get system error 67, the network name cannot be found.  Adding the home path to the end of the NAS IP gives me system error 5 Access is denied.

 

By the way I had completely forgotten about this, but here is a topic I made 2 years ago when I got this ReadyNAS.

 

https://community.netgear.com/t5/Using-your-ReadyNAS/ReadyNAS-314-No-Home-Share-Access/m-p/834936

 

Looking at this now, I wonder if something is still non-standard from when this happened?  It could explain why no suggestions are working.

Message 10 of 18
BrianL2
NETGEAR Employee Retired

Re: Deleting old home directories

Hi Bent82,

 

This feature is being worked on at the moment. Did you receive a reply from @mdgm-ntgr?

 

 

Kind regards,

 

BrianL
NETGEAR Community Team

Message 11 of 18
StephenB
Guru

Re: Deleting old home directories


@Bent82 wrote:

I tried this and I don't seem to be able to map.

 

net use q: \\10.50.38.6 /user:admin password

 

 


net use q: \\10.50.38.6\data /user:admin password

 

If you have renamed the data volume, then of course use whatever you renamed it to.

Message 12 of 18
Bent82
Guide

Re: Deleting old home directories

StephenB,

Hmm, even adding the \data to the end I'm unable to map using the admin user.

 

BrianL,

Thank you, yes, I replied to his PM earlier today, I just haven't heard back yet from him.  Do you mind if I ask specifics of what this new feature is?  Just easier management of home directories by the admin?

Message 13 of 18
StephenB
Guru

Re: Deleting old home directories


@Bent82 wrote:

StephenB,

Hmm, even adding the \data to the end I'm unable to map using the admin user.

 

And your volume name is data ???

 

That definitely should work.

 

Try doing a net use * /delete first.

Message 14 of 18
mdgm-ntgr
NETGEAR Employee Retired

Re: Deleting old home directories

nswafford, I have also sent you a PM.

Message 15 of 18
Bent82
Guide

Re: Deleting old home directories


@StephenB wrote:
And your volume name is data ???

That definitely should work.

Try doing a net use * /delete first.


 

The problem seems to come when I try to use the admin user, I seem unable to do so.  I get messages about being unable to find the user.  The system I was using had no drives mapped and wasn't a member of the domain.  I tried using a domain member machine as well.

 

mdgm has used the support logon to help me delete the folders.  I am not sure yet why I am unable to do so myself using the root login with ssh, but for now, I am all set.  I am still interested in doing this by myself in the future though, so any more information anyone has is appreciated.

Message 16 of 18
kohdee
NETGEAR Expert

Re: Deleting old home directories

Hi everyone.

 

You can't just delete those old home folders because they're btrfs subvolumes.


Though this is not supported by NETGEAR Support, you can remove old home folders with:

root@rn314:~# btrfs subvolume list /data | grep home
ID 257 gen 516 top level 5 path home
ID 309 gen 133 top level 257 path home/admin
ID 330 gen 516 top level 257 path home/kohdee

root@rn314:~# btrfs subvolume delete /data/home/kohdee
Delete subvolume (no-commit): '/data/home/kohdee'
root@rn314:~# btrfs subvolume list /data | grep home
ID 257 gen 516 top level 5 path home
ID 309 gen 133 top level 257 path home/admin

 

 

By using SMB to connect to the ReadyNAS as admin, you're exposed to the btrfs subvolumes, but you can't delete; however, this lets you delete files and folders from private home shares to regain your missing space from old home folders. 

The subvolumes being there empty hurt nobody. Once you delete the data, the only benefit you get out of deleting the subvolume is for asthetics. 

Your subvolume list might be different because you were on a domain. The difference would look like btrfs subvolume delete /data/DOMAIN/USERNAME

 

Doing this is at your own risk and is not supported by NETGEAR Support. 

Message 17 of 18
Bent82
Guide

Re: Deleting old home directories

Hi kohdee,

 

Ah, that would explain what's going on.  Thanks for the steps.  As I mentioned earlier, I was looking for a way to do this because of a policy management wants implemented to remove accounts when people leave.  Sometimes, asthetics do matter, especially to people who don't know how it works.  Armed with this information however, I will attempt to convince management that this will not be required.

 

Thanks to everyone for their help in this thread.

Message 18 of 18
Top Contributors
Discussion stats
  • 17 replies
  • 8885 views
  • 3 kudos
  • 7 in conversation
Announcements