Jump to content
The Unraid Annual Cyber Weekend Sale is here 🔥 ×

(Solved) Do files survive reboots in unRAID? Moving from QNAP to unRAID.


Recommended Posts

Posted (edited)

Hi,

I'm planning to move from QNAP to unRAID.

 

Sorry in advanced if this was already addressed, but I couldn't find a simple answer if unRAID is a "real" OS. With QNAP, the OS is stored in a ramdisk so things stored outside of the array are generally lost on reboot without doing workarounds. Unlike a regular OS, files you save in, say, /etc, for example, will not survive reboots in QNAP. With a regular OS like Ubuntu, FreeBSD, CentOS/RHEL, etc., new/updated files stored in /etc will survive reboots. I see unRAID is based on Slackware so I'm assuming unRAID will behave like a normal OS and new/updated files in /etc will survive reboots. It's a bit of a pain, for me, the way QNAP works when I need files to come back after reboots. (I only used /etc as an example location)

 

TIA

 

[Solutions]

Links to related references on this topic

 

 Lists out what directories will survive a reboot

 

  Location of the script to edit to restore files after a reboot

 

Explanation of and sample script to restore files back to /

  

 

 

Edited by MrLinux
Updated title and added links to solutions
Posted

I'm a new user of unRAID, but I'll try to explain. unRAID OS is loaded from the flash drive to RAM on every boot. Changes to settings are written to the flash drive when needed. If you're worried about scripts and such (cron jobs), that's supported, and will work in unRAID. Other than that, files can be stored on the array, cache drive, or an individual drive that's not part of the array.

Posted (edited)

@Ademar, thanks for the explanation. Yes, I was concerned about losing cron jobs and also any custom script settings that I would choose to save on traditionally system level directories such as /etc, /var, /opt (or /usr/opt), etc.

 

If I update/create files in /etc, /var, etc.., would those save automatically to the flash drive and survive reboots?

Edited by MrLinux
Tried to @ and [Enter] submitted the comment too soon
Posted

Yes, changes are NOT lost on reboot because they are stored on the Flash drive and loaded to RAM at boot time. 

 

They are a Plugin system and it support Dockers (with a "app Store") and support Virtual machines (QEMU-based Hypervisor).

Posted

In case the previous explanation was not clear, files that are not under /mnt are normally in RAM so to survive a reboot they need to be stored elsewhere and put back into position during the boot process.   There are several mechanisms available for this.

Posted
56 minutes ago, MrLinux said:

Hi,

I'm planning to move from QNAP to unRAID.

 

Sorry in advanced if this was already addressed, but I couldn't find a simple answer if unRAID is a "real" OS. With QNAP, the OS is stored in a ramdisk so things stored outside of the array are generally lost on reboot without doing workarounds. Unlike a regular OS, files you save in, say, /etc, for example, will not survive reboots in QNAP. With a regular OS like Ubuntu, FreeBSD, CentOS/RHEL, etc., new/updated files stored in /etc will survive reboots. I see unRAID is based on Slackware so I'm assuming unRAID will behave like a normal OS and new/updated files in /etc will survive reboots. It's a bit of a pain, for me, the way QNAP works when I need files to come back after reboots. (I only used /etc as an example location)

 

TIA

Your definition of "real" OS is problematic. Loading stuff in RAM doesn't make it any more or less "real".

I can make any of the "regular" OS like Ubuntu, FreeBSD, CentOS, even Windows to load fully in RAM and it doesn't make it any less or more real.

 

Unraid does load to RAM so /etc will not survive reboot. But configurations are saved on the flash drive so it isn't lost on reboot. The key is what is it that you need that specifically needs to survive reboot outside of the configuration (done via the GUI)?

Posted (edited)
16 minutes ago, testdasi said:

Your definition of "real" OS is problematic. Loading stuff in RAM doesn't make it any more or less "real".

I can make any of the "regular" OS like Ubuntu, FreeBSD, CentOS, even Windows to load fully in RAM and it doesn't make it any less or more real.

 

Unraid does load to RAM so /etc will not survive reboot. But configurations are saved on the flash drive so it isn't lost on reboot. The key is what is it that you need that specifically needs to survive reboot outside of the configuration (done via the GUI)?

Yes, by "real," I only meant a traditional system where added/updated files are not lost after a reboot without workarounds needed (add/edit, save, reboot, it is still there). I didn't mean to downplay OS's loaded into RAM but waned to make a separation between the user experience.

 

I'm a bit confused now. 

 

One person says that changes are not lost on reboot

18 minutes ago, Pducharme said:

changes are NOT lost on reboot

 

 

However the two additional comments contradict it (or lost at my understanding of how unRAID works). It appears files will be lost on reboot unless a workaround is done by saving it (assuming somewhere like /mnt) then restoring back to /etc on boot. Similar to what's needed with QNAP.

17 minutes ago, itimpi said:

files that are not under /mnt are normally in RAM so to survive a reboot they need to be stored elsewhere and put back into position during the boot process.

 

16 minutes ago, testdasi said:

Unraid does load to RAM so /etc will not survive reboot

 

 

Thank you all for helping me understand how unRAID works. This is a super fast/responsive community..even at 3AM (PT) :) 

 

My goal is to be able to create/install scripts/tools on the OS using commonly used system paths. For example, I usually have a /scripts directory for all my custom scripts (shell/python) and use /var/log/ to store the logs of these scripts. Upon reboot, it seems /scripts and logs created in /var/log/ would disappear unless I do a workaround to save/restore before/after rebooting. 

 

Additionally, would my ~/.bashrc, ~/.bash_profile, ~/.ssh, etc files in my home directory be lost as well upon reboot?

 

Any documentation that lists out what does/doesn't survive reboots?

Edited by MrLinux
Posted
12 minutes ago, MrLinux said:

I'm a bit confused now. 

 

One person says that changes are not lost on reboot

22 minutes ago, Pducharme said:

changes are NOT lost on reboot

 

 

However the two additional comments contradict it (or lost at my understanding of how unRAID works). It appears files will be lost on reboot unless a workaround is done by saving it (assuming somewhere like /mnt) then restoring back to /etc on boot. Similar to what's needed with QNAP.

Configuration changes made via the GUI are not lost on reboot as Unraid will make sure they are re-instated on reboot.  Other changes made by the user by-passing the GUI require action to be taken to get them to survive a reboot, and a number of mechanisms are available to help with this.

 

Without knowing more about the exact type of changes you are talking about is is hard to tell if this is likely to be an issue for you or not.

 

Posted (edited)
33 minutes ago, itimpi said:

Configuration changes made via the GUI are not lost on reboot.  Other changes made by the user by-passing the GUI require action to be taken to get them to survive a reboot, and a number of mechanisms are available to help with this.

 

Without knowing more about the exact type of changes you are talking about is is hard to tell if this is likely to be an issue for you or not.

How do people usually use unRAID in terms of using it as a server where we would ssh to the box to run custom scripts and such? I was planning to use it as a server box similar to RHEL/Ubuntu which has a nice NAS feature set to easily manage multiple disks along with a laundry list of Plugins.

 

For sake of argument, lets say I have the following files

/script/myscript.py - custom script

/etc/myscript.yaml - script config files

/var/log/myscript.2020-07-23.log - output log file of the script

~/.bash_profile - custom settings in here

~/.vimrc - custom vi settings

~/.ssh/ - ssh keys in here

 

Would I need to use the available mechanisms to have these files survive reboots? If so, could you reference some of these?

 

Thanks again!

 

For anyone else that comes here with the same question, here are some related posts

 

 Lists out what directories will survive a reboot

 

  Location of the script to edit to restore files after a reboot

 

Explanation of and sample script to restore files back to /

  

 

 

Edited by MrLinux
  • Like 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...