Shell for dummies: running testing & burn-in script

Status
Not open for further replies.

AgedReason

Explorer
Joined
Nov 26, 2015
Messages
70
Well, I managed to get myself built. All the smoke stayed where it belonged. FreeNAS is installed and running. I managed to get the SAS2308 firmware updated to version 20. So far, so good. Working with a clean slate.
(Confidence growing.)
- Alright, I think it’s time to do some hardware testing. jgreco has a nice post stickied all about that. Wow! There’s even a script! Let’s get that going.
- Okay, how do I do that? Run the script from shell.
- How do I get it there? Transfer it from USB.
- Okay, how? You still gotta mount it first.
- Right. I’ll just look for some info about that. Plenty of suggestions from various places. The only thing they all have in common is a warning that you can muck your ish up really good if you do it wrong. The commands, however, all seem different depending on who’s saying it.

- Oh, boy. Not feeling much like guessing wrong and crashing good.
- Now what?
(Confidence dropping.)

Me searching the forums and the FreeNAS manual.
GtL7kL69TmbDbVgihk9ZURURA0xiqLJC60Ex3wMkquO5O34KPhqG-5FnXF3xMgydKv7h46UznbWQhbJ0SmQoqVHuLRoxx1SfFBd8TLOACgFjSiNL3eZyWZfTvX2rsew5hoy83m_7ipOR8AodVdER1-SHVb4uNBiY4jUPfSqn6KkoSYOtVzO4lSCdKegl4UXNDnGbvVtskGJgNRaLfpZ_l6yzuGm04QqBNpw_FKHvZqyMghLDny5ONS-IDo6pqBkyAPtp97PZNLpCcXm5zaQAeOBCbw2n2l9rgoRb7w3E8P3mHgjTR5fTb1qNKa-dePhlJq5bf-1wYQgkBshSg3jZfuDaUn7WlnBfegERCF8hZ-JDNKCLHhWg2KNqRRuaZUI9vYtGUaQRxIrd8s9_nRbHNWd6_Mg7THB6dOcBCIO7ry3_su78R1RrzabyO5R1Ola7w294UyG_R6G_v6NZ3dqfLikjw_sjx6T1EqXaJDhcgIphGs_j6QRrVqwOnk3uUji2MVvsrTIdgRcx8yUjcGWi057UCsxERixKI0q3rEeBBlUYITfza9Ho6uLQxaX7lWXTuYj70g=w365-h273-no

Also me searching the FreeBSD manual.

Just due to the sheer volume of information, I could really use some focus. Where should I direct my attention to find the information I need to competently wrangle shell commands, specifically in the context of accomplishing useful FreeNAS tasks (like running the burn-in script - as an example). I'm sure I'll get it eventually, but I'd sure appreciate any head start someone would be willing to share with me.

Thanks

I've read:
https://forums.freenas.org/index.php?threads/building-burn-in-and-testing-your-freenas-system.17750/
https://forums.freenas.org/index.php?threads/how-to-install-scripts.13758/
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
Re: The script - the easiest way is to have a shared dataset for this kind of thing. Just copy-paste the script to that share, navigate to it in the CLI and run it.

Or copy-paste the script's source code into an editor and save it.

Either one is more intuitive than mounting a USB device.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
...but of course, for that to work, you have to have a pool, and a share set up on the pool, which doesn't work so well if you haven't tested your hardware yet. But yes, that's the easiest way to get a script onto the server, since you can do your editing in your native environment, whatever that happens to be.

A slightly less-easy way (but one that doesn't require a pool and share to be set up beforehand) would be this:
  • Turn on SSH on the server, check the boxes for enable root login and enable password login
  • Connect to the server using an appropriate SSH client (for Windows, Putty or Bitvise; for Mac or Linux, ssh from the terminal)
  • run 'nano -w myscript.sh', replacing 'myscript' with whatever you want to call the script
  • Copy and paste the script contents from wherever you find them into the ssh session
  • Ctrl-X to exit nano, Y to save
  • run 'chmod +x myscript.sh' to make it executable
Do not attempt to replace the first two steps with just using the Shell button in the web GUI--although it's better than nothing, it isn't that good, and it likes to eat control characters.
 

AgedReason

Explorer
Joined
Nov 26, 2015
Messages
70
Thanks for all the tips.
So, I gave the SSH client a shot. Not sure what happened. On the plus side, it was nothing catastrophic. On the neg, it was nothing.
Here's what I did and then what it did.

login as: root
root@192.168.1.2's password:
FreeBSD 9.3-RELEASE-p28 (FREENAS.amd64) #0 r288272+f229c79: Sat Dec 12 11:58:01 PST 2015

FreeNAS (c) 2009-2015, The FreeNAS Development Team
All rights reserved.
FreeNAS is released under the modified BSD license.

For more information, documentation, help or support, go here:
http://freenas.org
Welcome to FreeNAS
[root@freenas] ~# ls
./ .cshrc .shrc save_sshkeys*
../ .k5login .ssh/ update*
.bash_history .login change_password* updatep1*
.bashrc .profile save_cfg* updatep2*
[root@freenas] ~# nano -w solnet-array-test-v2.sh
GNU nano 2.2.6 File: solnet-array-test-v2.sh

[ Wrote 274 lines ]

[root@freenas] ~# chmod +x solnet-array-test-v2.sh
[root@freenas] ~# solnet-array-test-v2.sh
solnet-array-test-v2.sh: Command not found.
[root@freenas] ~# ls
./ .login save_sshkeys*
../ .profile solnet-array-test-v2.sh*
.bash_history .shrc update*
.bashrc .ssh/ updatep1*
.cshrc change_password* updatep2*
.k5login save_cfg*
[root@freenas] ~# solnet-array-test-v2.sh
solnet-array-test-v2.sh: Command not found.
[root@freenas] ~#
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Yes, as @solarisguy says, try ./solnet-array-test-v2.sh. The reason this is necessary is because /root/ isn't part of the default path, so it isn't searched by default when you enter an executable name. The ./ tells explicitly to use the current directory.
 

AgedReason

Explorer
Joined
Nov 26, 2015
Messages
70
DERP.

Thanks.
 

AgedReason

Explorer
Joined
Nov 26, 2015
Messages
70
Woo hoo! Looks like it's doin it's thing. or at least started to.
Thanks everyone. Loving the SSH!
 

l@e

Contributor
Joined
Nov 4, 2013
Messages
143
can someone put the file for download somewhere please
i tried copying it from ssh but apparently some characters added (prob space or eol) and could not make it work.
looked via notepad++ also but can not find what im missing.
thanks
 
Status
Not open for further replies.
Top