Being a newbie to TrueNAS and not so familiar with Linux-based commands, I tried to run a skript to burn-in my new HDs prior to first use.
I took the command from another topic:
I managed to get access as admin user using SSH protocol.
I got the prompt “$”
At the prompt, I typed in the command given above.
This results in the following error message “zsh: no such file or directory: ./disk-burning.sh”
You’re always smarter afterwards
As “disk-burning.sh” is not a Linux command, the OS didn’t understand what I want. That’s logical so far, I could have thought of that beforehand.
But before I start searching all over the place and wasting time unnecessarily, perhaps someone here can help me with a link to a tutorial for such basic activities.
Surely directories have to be set up and programs installed so that the operating system understands what I want to do.
./ in Linux (and other Unix-y operating systems) is a reference to the current directory. In order to run that command, you’d first need to change into the directory (using the cd command) where that script is located.
Got it, Dan.
But first of all, I have to make the directory. As the extension “.sh” means the bash-shell-script file, what name do I chose for the directory where this scripts - or other scripts as well - will be in?
Secondly, I have to copy the script into the new directory.
By the way: I just found my book “Linux - Basic course”. This allows me to familiarize myself with Linux again after years of abstinence.
While in your home directory $ cd
make a directory called bin $ mkdir -p bin
move that script in there $ mv ./disk-burn.sh ./bin/
make that script executable $ chmod u+x ./bin/disk-burn.sh
I assume the default shell is bash. Can you confirm that or type: $ ls .bashrc and tell me if you get a “no such file” prompt back.
I am logged it as admin without a home directory.
*Addendum: That’s not correct, as proven by pwd command. * But being in the /home/admin directory and typing cd /bin, the answer to the pwd command then is /bin.
There exists a bin directory already (pre-installed I suppose)
But in order to move the script in the bin directory, the script disk-burn.sh must have been copied to the system already. I first have to find out how to do that before doing the next steps.
When typing ls .bashrc, I get the message: “cannot access ‘bashrc’: no such file or directory”
Okay, if you already see a bin directory. STOP. You may not be in the right location (a preinstalled bin directory in an admin’s home directory isn’t normally set); it’s traditional but not standard to have one there already.
move that script in there $ mv ./disk-burn.sh ./bin/
make that script executable $ chmod u+x ./bin/disk-burn.sh
Having done that, I typed the original command (from Dan): ./disk-burnin.sh -tm 'ada0 da0 ada1 da0' getting the following messages:
admin@Monet-Two[~/bin]$ chmod u+x ./bin/disk-burn.sh
chmod: cannot access './bin/disk-burn.sh': No such file or directory
admin@NAS-NAME[~/bin]$ chmod u+x ./disk-burn.sh
admin@NAS-NAME[~/bin]$ disk-burn.sh
zsh: command not found: disk-burn.sh
admin@NAS-NAME[~/bin]$ ./disk-burn.sh -tm 'ada0 da0 ada1 da0'
./disk-burn.sh: line 143: smartctl: command not found
./disk-burn.sh: line 144: smartctl: command not found
smartctl version 7 or greater is required
./disk-burn.sh: line 151: smartctl: command not found
admin@NAS-NAME[~/bin]$
Seems that the script got started but some commands in there (line 143 and so on) couldn’t be executed as version 7 of smartctl is not installed!?
What does “disk-burn” supposed to do? Ultimately you’re missing some more set up instructions and or dependencies (you need that tool that’s causing the error). I’ll spend some time looking at the other thread but…
On another note. You’re using the ZSH shell. So you will want to get familiar with the .zshrc file …eventually.
You could. But if you get the script by way of git clone (which I’d expect you would), that would create the directory for you. Or you could put it in your user’s home directory, though I wouldn’t really recommend that.
Really, anything you like.
Again, if you do git clone to download the script, it will put it in a subdirectory of wherever you are when you run that command.
It isn’t; it’s zsh. And I wouldn’t put these things in ~/bin/, though I guess you could.
You need to be running this script as the root user. So either become root with sudo -i and then run it, or run the script itself with root permissions by sudo ./disk-burn.sh.
Thanks so far, John. Don’t waste time looking at the other thread. I got an “entrance” now by understanding how to get a script to the system.
It’s not my style to just type in any commands but I need more background.
I will read carefully the other thread again as well as the corresponding readme-files.
Anyway, I thought, the pre-installed TrueNAS would come with the relevant command set. That was a obviously a misunderstanding of mine.
It does. The problem is that smartctl isn’t in admin’s path. But since it requires root permissions to run anyway, this isn’t really a problem–run the script as root.
That brings more light into the darkness - that’s simply spoken the difference between experienced Linux/Unix users like you and Newbies like me.
Anyway, I’m going to take the challenge!
Prerequisite for the use of git clone is an existing repository, am I right?
How can I identify whether the prerequisites are fulfilled?
Following John’s thread, I have downloaded the script to my home directory.
Just clicked the link to Dan’s repo. @Aemetz you have seen this note correct?
This script runs the badblocks program in destructive mode, which erases any data on the disk. Therefore, please be careful! Do not run this script on disks containing data you value!
It could be whatever you like but it should be located on your pool (once setup) as a permanent home.
git has another advantage: it will set the execute permissions for you. As for the location, if you are doing this to test your disks prior to configuring your first pool then the home directory is fine, but your pool will make for a better perminent home once available.
Point of fact: dan is not the author (though they still are a quite knowledgeable member of the forum) of the script I am.
Yes, please read the entire readme file before using this script and if there is anthing you are not sure about please ask.