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

How to save your apps when destroying your main volume (OS6)

Sandshark
Sensei

How to save your apps when destroying your main volume (OS6)

Normally, destroying your primary volume will remove all your apps. Well, I don't think it actually totally removes all traces of them, it does delete their folders in /apps, and it must do something to remove them from the GUI database. I have discovered a way to retain your apps in this situation.

 

While this is a straightforward process, I take no responsibility if it doesn't work for you.  This is not a good time for someone unfamiliar with the Linux command line to try and become familiar with it.

 

For my example, my main volume I plan to destroy is /data and I added a second called /vol2 that will become the new main one. Substitute your volume names as needed.

 

The /apps directory in the main volume holds the files for your apps so that they don't fill the OS partition. In my case, thats /data/apps. But the real location of them is a BTRFS subvolume called /data/.apps (the leading dot makes it invisible to many operations), which is mounted to /apps by a .mount file /etc/systemd/system/multi-user.target.wants/apps.mount. When you destroy your primary volume, the OS creates a new subvolume for them (/vol2/.apps in my case) and updates the .mount file, but it does not copy your apps to it.

 

The simple solution is to create the new subvolume yourself, copy the contents of /apps to it, and modify /etc/systemd/system/multi-user.target.wants/apps.mount to point to the new location. Then re-boot so the new location gets actually mounted before destroying the main volume. When you copy the files, there are several invisible files you also may need to copy (I did, and I suggest you do, too). So, using my example volume names, here are the steps from SSH. Note that I have the nano editor installed (apt-get install nano), but you can use vi or an editor of your choice.

 

  • # btrfs subvolume create /vol2/.apps
  • # cp -rT /apps /vol2/.apps
  • # ls /apps -all
  • # ls /vol2/.apps -all

Now, make sure everything was copied by comparing the directory listings. DO NOT reboot until you complete the next step.

 

  • # nano /etc/systemd/system/multi-user.target.wants/apps.mount

Change /data/.apps to /vol2/.apps and save.

 

Reboot.

 

From the GUI, go to the Apps tab and make sure you see your apps and available apps. Might be good to see at least one works.

Now, on the System/Volumes tab, DESTROY your main volume. That takes a bit of time. Then, verify you still can see your apps. Finally, reboot again and re-check the apps.

 

Note, it is very important to check the things I have listed along the way. If you mess up, you'll lose the apps. And once you lose them, putting another copy back in the /apps folder doesn't work, because the GUI database never updates to show them.

 

If you have three or more volumes and you guessed wrong as to which the OS would decide is your new main volume, no problem. Just copy the /apps contents to the new /mainvolume/.apps directory and edit /etc/systemd/system/multi-user.target.wants/apps.mount again to point /apps to /mainvolume/.apps and re-boot. You could probably leave them in the other location, but I don't know what would happen with an OS update or installation of another app.

Message 1 of 6
StephenB
Guru

Re: How to save your apps when destroying your main volume (OS6)

If you have two volumes, I think that the NAS already will migrate /apps to the remaining volume if you delete the first (primary) one.  Though it's been a while since I tried that.

Message 2 of 6
Sandshark
Sensei

Re: How to save your apps when destroying your main volume (OS6)

I only tried this on a virtual machine, but it did not migrate the apps when I destroyed the main volume in OS 6.10.1.

 

I'll have to give it a shot on a real NAS when I have a chance, but I don't know why it would behave any differently.

Message 3 of 6
StephenB
Guru

Re: How to save your apps when destroying your main volume (OS6)


@Sandshark wrote:

but I don't know why it would behave any differently.


Me either, but I did find that the NAS did migrate my apps automatically (quite a while ago).

Message 4 of 6
Sandshark
Sensei

Re: How to save your apps when destroying your main volume (OS6)

I just tried it on a real NAS (Ultra4 running OS 6.9.5) and apps were not moved to the remaining volume.  The only thing is the Apps directory is DO_NOT_DELETE.

 

So, if the system is supposed to move the apps, there is a bug that Netgear has totally overlooked in their testing.

Message 5 of 6
StephenB
Guru

Re: How to save your apps when destroying your main volume (OS6)


@Sandshark wrote:

I just tried it on a real NAS (Ultra4 running OS 6.9.5) and apps were not moved to the remaining volume.  The only thing is the Apps

So, if the system is supposed to move the apps, there is a bug that Netgear has totally overlooked in their testing.


Well, it'd be great if it did move the apps directory (rather than requiring ssh to do that).

Message 6 of 6
Top Contributors
Discussion stats
  • 5 replies
  • 1007 views
  • 0 kudos
  • 2 in conversation
Announcements