NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.

Forum Discussion

Bent82's avatar
Bent82
Guide
Jan 19, 2016
Solved

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?

  • 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. 

17 Replies

Replies have been turned off for this discussion
  • JennC's avatar
    JennC
    NETGEAR Employee Retired

    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,

    • StephenB's avatar
      StephenB
      Guru - Experienced User

      Does AD still include the now-departed users?

    • Bent82's avatar
      Bent82
      Guide

      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.

      • StephenB's avatar
        StephenB
        Guru - Experienced User

        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? 

         

         

  • kohdee's avatar
    kohdee
    NETGEAR Expert

    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. 

    • Bent82's avatar
      Bent82
      Guide

      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.

NETGEAR Academy

Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology! 

Join Us!

ProSupport for Business

Comprehensive support plans for maximum network uptime and business peace of mind.

 

Learn More