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

ReadyNAS 428 - Move Home Folders to different volume

timhood
Initiate

ReadyNAS 428 - Move Home Folders to different volume

I initialized my ReadyNAS 428 with a three-disk volume ("data") and migrated data to shares I created on that volume. Later, I disabled X-RAID so that I could add a separate five-disk volume ("backup"). When setting up private Time Machine backups, I noticed that the Time Machine backup is placed in the Home Folder for the user which is on the "data" volume. How can I migrate the Home Folders share from the "data" volume to the "backup" volume without destroying the "data" volume?

 

Firmware: 6.10.2

Model: RN428|ReadyNAS 428 – High-performance Business Data Storage - 8-Bays
Message 1 of 6

Accepted Solutions
Sandshark
Sensei

Re: ReadyNAS 428 - Move Home Folders to different volume

What follows appears to work.  After I did it, everything seemed to work correctly via the GUI and SMB.  I also successfully created a new user and a home folder was created when I accessed the NAS with that user name.  I created a private Time Machine for that user, and one was created in the .timemachine directory of the new volume, but have no way to test it.  I did this on a virtual machine, and probably haven't put it through all potential scenarios that affect or use home folders.  One thing to note is that the location of the shared Time Machine folder was also moved to the new volume.  I believe this is linked to the fact that you assign a user name for the shared Time Machine, even though that user is not visible on the GUI Accounts page.

 

As with any other "under the covers" manipulation with SSH, insure your backup (including home folders) is current in case you end up having to factory default to fix things.  And, of course, Netgear is not going to help you get out of any mess this creates.

 

Assuming original volume data and new volume newvol:

 

# btrfs subvolume create /newvol/home
# chown admin:admin /newvol/home

edit   /etc/frontview/account.conf, changing home_volume!!data  to  home_volume!!newvol

edit /etc/systemd/system/multi-user.target.wants/home.mount, changing What=/data/home  to  What=/newvol/home

(I like nano for editing, just apt-get install nano)


Reboot
Execute mkhomedir_helper <username> for every user to create home shares (including admin).  This is much easier than doing it manually, and insures file permissions are correct.  Make absolutely certain you have a home folder for each user before the next step, or it will create a folder instead of a share (subvolume) for users you missed, which will be problematic.

 

Copy home folder content with cp  -rp  /data/home/*  /newvol/home

 

If any users have a private Time Machine, go back into the GUI Backup page and select Time Machine.  Then open the settings (gear icon) for that share and re-apply them.

 

Reading I have done seems to say that you can just copy the Time Machine files, so cp  -rp  /data1/.timemachine/*  /newvol/.timemachine should do that.  Again, I have no way to test this.  As is the case with user shares, make certain you've re-created the time machine for each user before you do this.  Oddly, the user private Time Machine shares are subvolumes, but the shared one is just a normal subdirectory.

 

Reboot and check all is OK via the GUI and any protocols you use (SMB, FTP, etc.).

 

Now you can delete the old home folders and /data/home, but note that btrfs subvolume delete is not recursive and rm and rmdir don't work on btrfs subvolumes, so you have to do it in steps.  If you can spare the space for a while, I'd leave them there till you are sure everything is working right.  So long as the subvolumes are still there, you can revert back just by reversing the edits of the two files above, and you should probably create a home directory for any users added since you initially switched, using mkhomedir_helper.  Just be sure to update any content of the folders from the new ones back to the old.

 

 If you do go through this, please report back your results, especially with regard to Time Machine.

View solution in original post

Message 4 of 6

All Replies
Marc_V
NETGEAR Employee Retired

Re: ReadyNAS 428 - Move Home Folders to different volume

@timhood

 

Welcome to the Community!

 

Migrating or moving the location where the Home folders will be saved is not currently possible. it always uses the first volume, You can backup the Home folders to another volume or NAS though migrating or relocating the Home folders and Private time machine shares will not be possible.

 

This is a good Idea and might possibly get Kudos so I would encourage you to post it on the ReadyNAS Ideas Exchange Board.

 

HTH

 

 

Regards

 

 

 

Message 2 of 6
Sandshark
Sensei

Re: ReadyNAS 428 - Move Home Folders to different volume

It's not possible within the GUI.  It looks like it can be done via SSH, but I have no idea what the repercussions could be for future actions taken by the GUI.  Contained within this post Changing-the-volume-name-on-an-OS6-based-NAS-and-things-you-can-learn-from-it You will find what I have found regarding the "secret sauce" of home folders.  Note that it is all or nothing -- all home folders must be on the same volume.

 

I have successfully moved the apps directory, but only as a precurser to destroying the original volume.  So the end reasult was apps back on the main volume.  I have not tried moving the home folders, as I don't use them.

 

If you already have personal time machine folders you need to retain, nothng I have done will point you in the right direction for that.  If you have snapshots enabled for hme folers, you're going to lose them.  It would probably be best to disable and destroy them before the move and re-enable after so the indexing doesn't get messed up.

 

If you decide to give it a try, I suggest you do so on a virtual machine (ReadyNAS/sdk/wiki/Setup-ReadyNAS-OS-on-VirtualBox ) or unused NAS first.  And if you succeed, please come back and share the details.

Message 3 of 6
Sandshark
Sensei

Re: ReadyNAS 428 - Move Home Folders to different volume

What follows appears to work.  After I did it, everything seemed to work correctly via the GUI and SMB.  I also successfully created a new user and a home folder was created when I accessed the NAS with that user name.  I created a private Time Machine for that user, and one was created in the .timemachine directory of the new volume, but have no way to test it.  I did this on a virtual machine, and probably haven't put it through all potential scenarios that affect or use home folders.  One thing to note is that the location of the shared Time Machine folder was also moved to the new volume.  I believe this is linked to the fact that you assign a user name for the shared Time Machine, even though that user is not visible on the GUI Accounts page.

 

As with any other "under the covers" manipulation with SSH, insure your backup (including home folders) is current in case you end up having to factory default to fix things.  And, of course, Netgear is not going to help you get out of any mess this creates.

 

Assuming original volume data and new volume newvol:

 

# btrfs subvolume create /newvol/home
# chown admin:admin /newvol/home

edit   /etc/frontview/account.conf, changing home_volume!!data  to  home_volume!!newvol

edit /etc/systemd/system/multi-user.target.wants/home.mount, changing What=/data/home  to  What=/newvol/home

(I like nano for editing, just apt-get install nano)


Reboot
Execute mkhomedir_helper <username> for every user to create home shares (including admin).  This is much easier than doing it manually, and insures file permissions are correct.  Make absolutely certain you have a home folder for each user before the next step, or it will create a folder instead of a share (subvolume) for users you missed, which will be problematic.

 

Copy home folder content with cp  -rp  /data/home/*  /newvol/home

 

If any users have a private Time Machine, go back into the GUI Backup page and select Time Machine.  Then open the settings (gear icon) for that share and re-apply them.

 

Reading I have done seems to say that you can just copy the Time Machine files, so cp  -rp  /data1/.timemachine/*  /newvol/.timemachine should do that.  Again, I have no way to test this.  As is the case with user shares, make certain you've re-created the time machine for each user before you do this.  Oddly, the user private Time Machine shares are subvolumes, but the shared one is just a normal subdirectory.

 

Reboot and check all is OK via the GUI and any protocols you use (SMB, FTP, etc.).

 

Now you can delete the old home folders and /data/home, but note that btrfs subvolume delete is not recursive and rm and rmdir don't work on btrfs subvolumes, so you have to do it in steps.  If you can spare the space for a while, I'd leave them there till you are sure everything is working right.  So long as the subvolumes are still there, you can revert back just by reversing the edits of the two files above, and you should probably create a home directory for any users added since you initially switched, using mkhomedir_helper.  Just be sure to update any content of the folders from the new ones back to the old.

 

 If you do go through this, please report back your results, especially with regard to Time Machine.

Message 4 of 6
timhood
Initiate

Re: ReadyNAS 428 - Move Home Folders to different volume

I was successfully able to move the home folders share and Time Machine backups using the instructions you provided with a couple of minor notes/changes:

 

In editing /etc/systemd/system/multi-user.target.wants/home.mount,I found and additional entry that referenced /data/home:

 

[Unit]

Description=Home Directory

Before=readynasd.service

ConditionPathIsDirectory=/data/home

 

I changed this to refer to the new volume.

 

In migrating the .timemachine directory, I noticed you referenced data1 instead of simply data, which I believe was merely a cut-and-paste omission from when you were doing your testing and validation on the Virtual NAS. I mention it only in case someone later views these instructions and does not spot the issue.

 

cp  -rp  /data1/.timemachine/*  /newvol/.timemachine should be

cp  -rp  /data/.timemachine/*  /newvol/.timemachine

 

I may pass along a suggestion to Netgear to update the ReadyNAS documentation to include a note that the Home Folders share is automatically created on the first volume and that Time Machine backups are located on the same volume as the Home Folders share. This bit of information could have saved me considerable time and trouble. 🙂

Message 5 of 6
Sandshark
Sensei

Re: ReadyNAS 428 - Move Home Folders to different volume

Great!

 

Yes, the data1 was an unedited cut-and-paste, that's the actual name on my VM (well, one of them).

 

Interestingly, the VM does not have that additional line in the home mount, but my real NAS do (at least, the two I checked).

Message 6 of 6
Top Contributors
Discussion stats
  • 5 replies
  • 2163 views
  • 1 kudo
  • 3 in conversation
Announcements