Data lost: Restoring from snapshots?

opensourceFTW

Explorer
Joined
May 27, 2022
Messages
86
I used to have 6TB of free space on my scale install. Now I have 8.9TB of free space. When I browse my music folder, it is just about empty. Where did my music go?

I have snapshots enabled. I looked on the docs to restore from a snapshot but I feel lost.

I WILL be building a second scale NAS. This has been on my mind for months.

ETA: It looks like my music is gone forever. I saw that snapshots are only a KB file.
ETA2: Maybe not.
 
Last edited:

Arwen

MVP
Joined
May 17, 2014
Messages
3,611
I generally use the Unix SHELL command line to display ZFS status. In this case;
zfs list -t all

If the files are still in your snapshots, then you can either restore the files from snapshots or roll back to a specific snapshot. Sorry I can't be more specific, as what I would do is too complicated to describe. But, with the information I requested above, I may be able to help you further.


Now as to why your music folder seems about empty. That may be an application moving / removing the files. So, do you have a media player App on this server?

Or the missing files could be due to user error, (sorry... if that is the case). ZFS Snapshots while great and give the impression of backups, they are not actual backups. This is because TrueNAS SCALE usually implements rolling snapshots, such that the oldest is removed to make way for a newer one. All dependent on your snapshot schedule and retention period.
 

opensourceFTW

Explorer
Joined
May 27, 2022
Messages
86
I cannot use the shell, its disabled. Root account has is password disabled, for security. My account is a built in admin account but still, I cannot use the shell.
 
Joined
Oct 22, 2019
Messages
3,641
You can still use SSH from Windows, Linux, or Mac.

(I don't think the Shell was disable in SCALE, regardless. But SSH is preferable, either way.)
 

chuck32

Guru
Joined
Jan 14, 2023
Messages
623
I case that's another source of confusion, when asked for the password when using the admin account for the ssh session, the password you are asked for is the one of the admin account.

Shell should be accessible none the less, but I agree, use a SSH session. Setup ssh keys if you don't want to enable password authentication.
 

Arwen

MVP
Joined
May 17, 2014
Messages
3,611
This is one of the issues, (some might say problem), of TrueNAS. If or when something goes wrong, it may be necessary to login via SSH or the GUI SHELL if it exists, to perform data gathering. Or detailed trouble shooting.

Simply saying you can't login is a non-starter for TrueNAS, SCALE or Core. For those that don't ever want to login via SSH or GUI SHELL, they should select another NAS without that requirement. That sounds harsh, and I don't mean to be rude. It is simply a fact that TrueNAS for non-Enterprise customers can require SSH or GUI SHELL logins at times. (Enterprise customers may have some staff that don't know Unix, but do know the TrueNAS GUI...)

On the other hand, the command I listed can be run as a normal user. No "root" permissions are needed.

Plus, here in the forums, we are generally supportive of new Unix users that don't know any Unix Shell commands. We usually start with data gathering, like I did, which is 100% harmless and can not hurt any data. We in the forums are usually quite careful about any ZFS or Unix command that could impact data. And warn the user appropriately.
 

opensourceFTW

Explorer
Joined
May 27, 2022
Messages
86
NM I was able to access the shell. What option do I choose? Open TrueNAS CLI shell or Linux Shell?
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Linux shell and then enter the command @Arwen wrote: zfs list -t all. And then please post the output here inside CODE tags.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
I do not understand - you can copy & paste just fine into an SSH window ...

User SSH to log in, use neither the UI shell nor the system console.
 

chuck32

Guru
Joined
Jan 14, 2023
Messages
623
Shift + insert to paste.


Better yet, use ssh and a terminal of your choice, in my terminal it's right click to insert.

Edit: @Patrick M. Hausen he's probably using the shell in the GUI and wondering that Ctrl c and v are not working. Although truenas will display a message explaining then.
 

opensourceFTW

Explorer
Joined
May 27, 2022
Messages
86
I use terminal to SSH into my RPis but I have never SSH into TrueNAS. SSH is enabled though. Every time I try to SSH into TrueNAS, I get :
"ssh: connect to host 192.168.1.187 port 22: Connection refused."

In shell, I use shirt+insert to paste. I cannot see if anything was pasted. I hit enter and I am told authentication failure. Very annoying. Why cant we just paste into the shell?
 

chuck32

Guru
Joined
Jan 14, 2023
Messages
623
Did you enable the SSH under services?

1000042096.png



Edit: you would also not see anything if you typed in your password. Copy some text and insert outside the Password prompt to see if it works. Are you copying trailing spaces?
You can paste into the shell.
 
Joined
Oct 22, 2019
Messages
3,641
I use super complex passwords.
Not to derail, but this has apparently added an extra layer of nuisance without any practical benefit.

You password (for simply logging into a local user or local network SSH session) is so random and complex that it requires you to copy and paste it?
  1. You're copying a password to your clipboard, which defeats the point of its complexity
  2. You're making it needlessly inconvenient to quickly login as your user/admin for a local machine

I can understand adopting this method for remote and cloud services, such as Amazon, Gmail, bank account, etc, but for a local user account?

You've made logging into an SSH session (which is a useful tool) into this burden upon yourself.

If you really want to keep this overly complex password, then at least configure a private-key authentication, so that you can jump right into an SSH session without the need to enter a password.
 

opensourceFTW

Explorer
Joined
May 27, 2022
Messages
86
Now I did. I was able to SSH into TrueNAS. I am stuck at the same screen. I will select 7 then paste in my password but the SSH session just goes back to the 1-9 selection listing.

While trying to post this earlier I ran into a 502 gateway error, LOL.
 

opensourceFTW

Explorer
Joined
May 27, 2022
Messages
86
I do not understand. I CAN login into SSH but after selecting 7 and entering the same password, I get an authentication error.
 

chuck32

Guru
Joined
Jan 14, 2023
Messages
623
I do not understand. I CAN login into SSH but after selecting 7 and entering the same password, I get an authentication error.
I'm kinda lost here, this sounds like the console you'd see via IPMI / a connected monitor.

Neither when selecting shell from the GUI nor when I login via SSH I'm greeted with that menu, I'm taken directly to the shell.
 

opensourceFTW

Explorer
Joined
May 27, 2022
Messages
86
I changed my account password to 1234. I am able to SSH into TrueNAS but again, after I select 7 and input the same password, I get an authentication failure.

When looking at snapshots, what does it mean when it reference 2.59TB? That is around the same amount of music that I lost.
 
Last edited:
Top