Unraid Commands for all


Recommended Posts

I thought I'd start a thread so users can telnet into their servers and run commands.  Please add commands that you think might also be helpful.

 

First to log in you need to open a telnet window and once at the login screen type in root

 

tail -f /var/log/syslog   -allows you to view the syslog and monitor what your server is doing

 

ifconfig eth0 -View the network settings on the first Ethernet adapter installed in the computer.

 

ifconfig eth0 mtu 9014 -Turns on Jumbo Framse (note all your hardware needs to support jumboframes )

 

cd /boot

cat file_name.cfg  -Allows you to see what paramaters are set in your config files

 

dd if=/dev/sda of=/mnt/disk1/unraid.image -This will make an image of your flash card onto disk 1  (See J.L. Post for full details http://www.avsforum.com/avs-vb/showthread.php?p=7214997&highlight=command#post7214997)

 

cp -r /mnt/disk#/'file or directory' /mnt/disk#   -Use to copy from one disk to another right on the server

 

mv /mnt/disk#/'file or directory' /mnt/disk#    -Use to move from one disk to another right on the server

 

also

 

midminght-commander is in unraid now so type mc to start it and all disks are mounted under /mnt

 

 

 

 

 

 

 

 

 

 

 

Link to comment
  • 2 weeks later...

I have yet to try but I think the following command work and the functions of each are obvious:

 

Stop

Start

Reboot

 

I would also add that if your looking to copy or move entire folders from one drive to another and the folder names have spaces in them you need to use "quotes" around the folder name like this example:

 

mv /mnt/disk2/"The Empire Strikes Back" /mnt/disk3

 

In the above example the entire folder called The Empire Strikes Back would be moved from disk#2 to disk#3 with the exact same sub-folder structure.

 

Wildcards are available to you as well...! For example lets say you want to copy all the files from disk#2 over to disk#3 use the mv command like this:

 

mv /mnt/disk2/* /mnt/disk3

 

In this example all files and folders on disk2 would be relocated over to disk3 in the exact same folder structure as it was on disk2. I have not had great success in disk upgrades so I do this when ever I want to pull out a smaller disk and upgrade to a larger one.

 

Hope this helps....!

 

 

Link to comment
  • 1 month later...

Is there a command to shutdown the array? For those times when the web page isn't responsive...

 

I also have that problem occasionally. I took rharvey's advice: logged on as root (no password required), then typed "stop", after which I get this response:

cmdOper=stop

cmdResult=OK

 

I assume this means it worked?

Link to comment

Is there a linux command that can be issued from a telnet session which will gracefully shutdown and poweroff the the server?  I can't seem to hit on the right command.  Reason is that I have 4 Windows 2x serverswithout keyboards and monitors  that I administer using remote desktop and would like to administer the unRaid the same way.

Thanks

Dennis

Link to comment
  • 3 weeks later...

Thanks for the reply.  Great to see you back!!  I know you were very responsive to my email questions when I was first getting my box setup.  Going through a few of the threads... you're a bigger man than I, a few of those threads would have kept me away if I were you.  Again, great to hear from you!!!

 

I've been using 'shutdown -h now' from the telnet session and just watching the light on the usb flash.  When it goes out, I shut off the power.  I switch over to the 'poweroff' command.

 

Also, if you need someone with active directory and a number of Windows 2003 servers to beta test anything, or AMD cpu/mb combinations, I'm available.

 

Thanks

Dennis

Link to comment

Here is a script to let you know about the various IDE disks on your server. To determine the specific filesystem on a partition

type blkid /dev/hd?? where ?? are the drive letter and the partition number

Example blkid /dev/hdb1 would tell me about the first partition on /dev/hdb

 

[pre]

#!/bin/bash

echo "=========================================================="

uname -srmvn

echo "IDE Disk status as of `date`"

echo "=========================================================="

n=0

for ide in /proc/ide/ide*

do

        ide_name=`basename $ide`

        echo "----------- $ide_name ------------"

        cat $ide/config| head -1

        echo "-----------------------------"

        for i in /proc/ide/$ide_name/hd*

        do

                let n=n+1

                model=`cat $i/model`

                dev_name=/dev/`basename $i`

                partitions=`fdisk -l $dev_name|sed "s/^/        /"`

                printf "%2s %8s %-30s\n" $n /dev/`basename $i` "$model"

                echo "$partitions"

                echo

        done

done

[/pre]

 

To save you from typing it in, and any typos, I've attached a copy to this post.

 

rename it without the ".txt" suffix needed to attach it to the forum (it only allowed certain file types), then type:

chmod +x list_ide

 

and finally, invoke it by typing:

 

list_ide

 

Have fun...

 

Joe L.

Link to comment
  • 6 months later...

From telnet session, type:

 

poweroff

 

This will gracefully shut everything down, even spin down the hard drives, but will not actually turn off the power supplies.

 

Does this command spin down the hard disks and then shut down in version 3.0 Beta 4? I used it the last time I shutdown the unRaid server, and tonight when I switched it on, it started a parity check. The only reason I can think of is that the disks did not spin down before the last shutdown, which IIRC, was suspiciously quick.

Link to comment

You should avoid using the 'poweroff' command - there is a race condition in the code which could cause the system to power off before the Flash is updated indicating 'clean shutdown'.  This can't cause data loss, but will cause parity-check to automatically start upon next reboot.  Better to use the SMU to Stop the array and then click 'Power down'.

Link to comment
  • 1 month later...

I'm still using 3.0 Beta 4 and am a bit stuck: I want to shut down the array gracefully, but the SMU (web interface) has gone AWOL. (Typing in "tower" - I haven't changed the default name - or the IP address produces no response.) It's not the first time it's happened, but in the past I used the poweroff command. However, after my previous experience posted above and Tom's response, I'd prefer not to use it again.

 

So the question is how do I shut down the array "properly" if I can't access the SMU? Are there some other telnet commands I should use? Or is there a way of restarting (only) the SMU?

Link to comment

Hi

 

You may find some relevant information in this post.

 

http://lime-technology.com/forum/index.php?topic=493.0

 

You can use Girder on your media PC or client to automatically shutdown unRaid (Properly) using Any Motherboard. Girder allows you to program a macro command to open the unRaid webpage and apply sequenced left clicks to "Stop" and "Poweroff" web buttons, as if you were personally performing the operation. Girder macros can be initiated though hand remotes, change of state of any program on the client ( Closing of MS Media Center), manual switches, relays, and even batch files. It really seems the imagination is the limit with Girder.

 

I use ASUS P5LD2-VM R2.0, which has a great WOL to automatically start unRaid through a batch file initiated by my client PC's startup.

 

However if you had a MB without proper WOL capacity, then you could hack unRaids power switch by installing a momentary12v micro relay in parallel with switch. Then  run a two conductor wire, next to the cat5 cable, to the client PC and utilize any 12v PS wires which is powered on client startup.

 

Just some thoughts.

 

At the end of a movie or at bedtime, I like to push one button on my remote to shut down everything.

Link to comment

Info, thanks - I had been following your thread with interest, but my problem is that I have the server already running and am now trying to shut it down but the web server is not running. Therefore the iexplorer batch commands (which I tried) do not work in my current situation. Of course, I could try the "poweroff" command, but this might mean I have to sit through a parity check on rebooting. Not ideal when your kid wants to watch something.

Link to comment

Hi Sonofdbn.

 

Actually, I don't run the webserver either. What Girder will do, triggered the various ways, is sequence shutdown by opening the web server and applying appropriate left clicks. Then if your so inclined you could have Girder close the Web server. I  believe this can be done behind a front end window.

 

Did you indicate that you could batch file the Poweroff through Tower Root? If so why can't a script Stop and then Poweroff.

 

I could not figure a way to get DOS command (in Batch) to communicate with Tower Root? I could only get the Dos Command ( in Batch) to Login successfully.

Link to comment

Info, thanks - I had been following your thread with interest, but my problem is that I have the server already running and am now trying to shut it down but the web server is not running. Therefore the iexplorer batch commands (which I tried) do not work in my current situation. Of course, I could try the "poweroff" command, but this might mean I have to sit through a parity check on rebooting. Not ideal when your kid wants to watch something.

Try this...

 

To stop the array from the telnet login...

/root/samba stop

umount -v /dev/md1

umount -v /dev/md2

umount -v /dev/md3

umount -v /dev/md4

umount -v /dev/md5

umount -v /dev/md6

umount -v /dev/md7

umount -v /dev/md8

umount -v /dev/md9

umount -v /dev/md10

umount -v /dev/md11

echo stop >/proc/mdcmd

cat /proc/mdcmd

To check status

echo status >/proc/mdcmd

cat /proc/mdcmd

 

To start a background parity check

echo check >/proc/mdcmd

cat /proc/mdcmd

 

To stop a background parity check

echo nocheck >/proc/mdcmd

cat /proc/mdcmd

 

Unfortunately, starting the array is not as easy. (I could never figure out how, as the web-interface would get real confused)  In fact, if you stop the array from the command line, the web-interface always got very confused, and then listed all the disks as unformatted (if you pressed the refresh button)  It actually presented the option to re-format them. 

 

Don't use the web-interface after stopping from the command line. (and do not reformat all your disks either) Instead, power down by typing

poweroff

 

or you can reboot the array, and get it restarted  by typing

reboot

 

I built a lot of these commands into a shell script I posted here a while ago.  I named it unmenu

You can find it here: http://lime-technology.com/forum/index.php?topic=153.0

 

I just tried this with the current version 3.1beta of unraid.  I stopped my array and rebooted.

Here is my array as shown by my unmenu script run from the telnet prompt...  Up about 11 minutes and not re-checking parity.

30tm9e0.jpg

 

Joe L.

Link to comment

Thanks Joe L.

 

What I would like to do is utilize your script from a Dos Batch.

 

Lets say I shut down Media Center Front end on a clientpc, at that time I would like a Batch file to initialize,  logon to Tower and then utilize your script, without manually keying anything. I have written a batch file which will log on to Tower, but I cant figure out how to send any other commands via Dos/Batch to tower. If I manually input commands at Tower root it works fine, but that seems out of place in a home theater environment.

 

Any suggestions on bridging the XP/dos - tower root gap?

 

Thanks

Link to comment
  • 3 months later...

 

cp -r /mnt/disk#/'file or directory' /mnt/disk#  -Use to copy from one disk to another right on the server

 

mv /mnt/disk#/'file or directory' /mnt/disk#    -Use to move from one disk to another right on the server

 

Is there a way to add a time and/or byte counter to mv or cp transfer in progress? I vaguely remember something like this done on Solaris, but it may have been some sort of add-on shell command, not found in GNU.

Link to comment
  • 1 year later...

You can detach from a console session with the following...(originally posted by Joe L in the preclear post)

 

Both these packages are needed.  Use "installpkg package_name.tgz" to install each in turn.

 

http://slackware.cs.utah.edu/pub/slackware/slackware-current/slackware/ap/screen-4.0.3-i486-1.tgz

and

http://slackware.cs.utah.edu/pub/slackware/slackware-current/slackware/a/utempter-1.1.4-i486-1.tgz

 

Then type

screen

 

Then start up the preclear_disk.sh process.

 

To detach, leaving it running, type

Control-A d

 

Then, 10 hours later you can re-attach to the running process by logging in and typing

screen -r

 

A good article on "screen" can be found here:

http://www.linuxjournal.com/article/6340

 

It can do a lot more. You can "name" the screen sessions, list the sessions

Control-A "

(Control-A followed by a "quote")

Link to comment

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.