Disappears settings after reboot


d3m3zs

Recommended Posts

Hi! I switched from OMV to Unraid, continue setup process and did not get a few things:

1. Why after each reboot my mc and htop looks like default, all previous settings just disappeared.

 And if for mc I can see that settings present in path before reboot

/root/.config/mc/

(probably I have to copy them to somewhere), but for htop folder

/root/.config/htop/

is empty.

For example I setup everything in htop

image.thumb.png.9321c236dfcf778cb6edc45ef065000e.png

But it looks like stored somewhere else.

 

2. I pasted a few files (for fast access from console) in folder

/usr/local/bin/

But again after reboot they disappear.

 

All these manipulations I made as root. 

 

Thanks in advance.

Edited by d3m3zs
Link to comment
4 minutes ago, itimpi said:

Those locations are only in RAM (like most of Unraid OS) which is why they do not survive a reboot.    You need to add something to the Unraid boot sequence (such as entries in the config/go file) to re-instate any such changes after the Unraid OS has been loaded into RAM.

Do we have plugin for this? 

Which folders are RAM folders? 

 

I see probably 1 option - write script that will copy all my files and settings to RAM folders after each reboot.

Link to comment
Just now, d3m3zs said:

Do we have plugin for this? 

Which folders are RAM folders? 

 

I see probably 1 option - write script that will copy all my files and settings to RAM folders after each reboot.


in principle anything that is not under /boot or /mnt is normally RAM based.

 

you may find this section of the online documentation accessible via the ‘Manual’ link at the bottom of the GUI or the DOCS link at the top of each forum page helps with understanding this.  The Unraid OS->Manual section in particular covers most features of the current Unraid release.

Link to comment
On 10/16/2023 at 12:15 AM, itimpi said:


in principle anything that is not under /boot or /mnt is normally RAM based.

It is interesting, because I pasted in 

root/.ssh/

my file 'authorized_keys' from previous server and it is successfully saved after each reboot.

 

Ah, probably because I found the same file in path

/boot/config/ssh/root/

 

So, the question is - what is the best place where I have to store my files and copy after each start?

And also I don`t understand why even .bash_history and other very useful files don`t stored somewhere as default behavior? In my point of view it would be a good practice.

Link to comment
16 minutes ago, d3m3zs said:

It is interesting, because I pasted in 

root/.ssh/

my file 'authorized_keys' from previous server and it is successfully saved after each reboot.

That is because special action is taken for that case.   I think that the /boot location is linked to the /root one as part of the Unraid boot process so they are effectively the same.

 

You should store your own files on the flash drive under the /boot location.  Exactly where under there is up to you.

Link to comment
Just now, itimpi said:

That is because special action is taken for that case.   I think that the /boot location is linked to the /root one so they are effectively the same.

I did not find answer, probably is only my issue and nobody cares about this logic.

Is it possible to somehow reach devs or create a ticket for such useful and easy feature, maybe create a plugin to store your folders between reboots?

Link to comment
#!/bin/bash

source_dir="/boot/config/my_custom_scripts/"

yes | cp -rf "$source_dir"telegramCodeHTML.sh "/usr/local/bin/" &
yes | cp -rf "$source_dir"ncdu "/usr/local/bin/" &
yes | cp -rf "$source_dir"btop "/usr/local/bin/" &
yes | cp -rf "$source_dir"HDSentinel "/usr/local/bin/" &
yes | cp -rf "$source_dir"mc/* "/root/.config/mc/" &
yes | cp -rf "$source_dir"htop/* "/root/.config/htop/" &
yes | cp -rf "$source_dir"btop_settings/* "/root/.config/btop/" &
wait

echo "🎉 scripts are copied"
chmod +x /usr/local/bin/telegramCodeHTML.sh
chmod +x /usr/local/bin/ncdu
chmod +x /usr/local/bin/btop
chmod +x /usr/local/bin/HDSentinel

telegramCodeHTML.sh " Scripts"

Wrote such script and scheduled "At Startup of Array". Checked - works.

 

image.png.e9dddbec05c31cc3f24d0a234c918606.png

Hope /boot/config/my_custom_scripts/ is ok place.

 

Will add one more and schedule "At Stopping Array"

Link to comment

And unfortunately all these lines dont update settings, first need to execute each tool and then copy config.

yes | cp -rf "$source_dir"mc/* "/root/.config/mc/" &
yes | cp -rf "$source_dir"htop/* "/root/.config/htop/" &
yes | cp -rf "$source_dir"btop_settings/* "/root/.config/btop/" &

So, updated to:

#!/bin/bash

source_dir="/boot/config/my_custom_scripts/"

yes | cp -rf "$source_dir"telegramCodeHTML.sh "/usr/local/bin/" &
yes | cp -rf "$source_dir"ncdu "/usr/local/bin/" &
yes | cp -rf "$source_dir"btop "/usr/local/bin/" &
yes | cp -rf "$source_dir"HDSentinel "/usr/local/bin/" &
wait

chmod +x /usr/local/bin/btop

# execute
mc &
btop &
htop &
# just in case
sleep 5
# close 
pkill mc
pkill btop
pkill htop

yes | cp -rf "$source_dir"mc/* "/root/.config/mc/" &
yes | cp -rf "$source_dir"htop/* "/root/.config/htop/" &
yes | cp -rf "$source_dir"btop_settings/* "/root/.config/btop/" &
wait

echo "🎉 scripts are copied"
chmod +x /usr/local/bin/telegramCodeHTML.sh
chmod +x /usr/local/bin/ncdu
chmod +x /usr/local/bin/HDSentinel

telegramCodeHTML.sh " my_configs➡️ system "

 

Edited by d3m3zs
Link to comment

Unraid runs from RAM the files in /root won't be saved. Instead of copying them back and forth i'd just softlink to them, e.g. put;

 

ln -s /boot/custom/.config /root/.config

 

In your /boot/config/go file.

 

This behavior is by design, to minimize reading/writing to the boot flash drive.

Link to comment
3 minutes ago, L0k1 said:

Unraid runs from RAM the files in /root won't be saved. Instead of copying them back and forth i'd just softlink to them, e.g. put;

 

ln -s /boot/custom/.config /root/.config

 

In your /boot/config/go file.

 

This behavior is by design, to minimize reading/writing to the boot flash drive.

I am not sure how ln -s will be working in my case? It will be working only with 
 

telegramCodeHTML.sh
ncdu
HDSentinel

But settings for mc, btop, htop anyway should be copied. Or I am wrong?

Link to comment

"ln -s /boot/custom/.config /root/.config" was just an example, you'd have to create the /boot/custom/.config directory and put your files there.

 

You can also do something like;

 

ln -s /boot/config/my_custom_scripts/telegramCodeHTML.sh /usr/local/bin/

 

Edited by L0k1
Link to comment
21 minutes ago, L0k1 said:

"ln -s /boot/custom/.config /root/.config" was just an example, you'd have to create the /boot/custom/.config directory and put your files there.

 

You can also do something like;

 

ln -s /boot/config/my_custom_scripts/telegramCodeHTML.sh /usr/local/bin/

 

but with such softlink I will be exactly reading from boot area each time and you just mentioned that I have to minimize reading/writing to the boot flash drive.  So, that looks like no difference if I just copy FROM boot to another folder or your option with creating softlink, I just read once per session and your approach - read many times.

Link to comment

Some read/writes are going to happen (lots of writing is the thing you really want to avoid to prolong the life of the USB). I wouldn't worry about a few small config files.

 

You can do it either way but copying everything back and forth everytime you make a change is too much of a PITA if you ask me.

Link to comment
1 minute ago, L0k1 said:

Some read/writes are going to happen (lots of writing is the thing you really want to avoid to prolong the life of the USB). I wouldn't worry about a few small config files.

 

You can do it either way but copying everything back and forth everytime you make a change is too much of a PITA if you ask me.

Got it, thanks, no I prepared all configs and will be only copy from boot each reboot and nothing write back.

Link to comment
  • 5 months later...

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.