blkdevMonitor - can't get it to run

Discussion about hard drive spin down (standby) feature of NAS.
Post Reply
kscircular
Starting out
Posts: 36
Joined: Sun Oct 07, 2012 3:11 am

blkdevMonitor - can't get it to run

Post by kscircular »

So, I am trying to confirm the HDD spindowns on my TS-453Pro. I followed this link:

http://wiki.qnap.com/wiki/Find_out_whic ... m_spindown

I follow the directions and when I go to run the program I get this message:


[~] # /root/blkdevMonitor.sh
-sh: /root/blkdevMonitor.sh: /bin/sh^M: bad interpreter: No such file or directory

I had to download the text of the script and paste it into Notepad. I saved it as an ANSI file. Then I moved it to Public, copied it to Root and did a chmod 766 on it as the instructions indicated. Could it be the I am saving it as an ANSI file?

I tried downloaded directly from qnaps FTP site, but it specifies the "csread" user and I don't know what the password is for it.
TS-453 Pro, 16GB
User avatar
pwilson
Guru
Posts: 22533
Joined: Fri Mar 06, 2009 11:20 am
Location: Victoria, BC, Canada (UTC-08:00)

Re: blkdevMonitor - can't get it to run

Post by pwilson »

kscircular wrote:So, I am trying to confirm the HDD spindowns on my TS-453Pro. I followed this link:

http://wiki.qnap.com/wiki/Find_out_whic ... m_spindown

I follow the directions and when I go to run the program I get this message:


[~] # /root/blkdevMonitor.sh
-sh: /root/blkdevMonitor.sh: /bin/sh^M: bad interpreter: No such file or directory

I had to download the text of the script and paste it into Notepad. I saved it as an ANSI file. Then I moved it to Public, copied it to Root and did a chmod 766 on it as the instructions indicated. Could it be the I am saving it as an ANSI file?

I tried downloaded directly from qnaps FTP site, but it specifies the "csread" user and I don't know what the password is for it.
That errant <CR> (CTRL-M) character in your script suggests you created yours with a DOS/Windows text editor, despite the fact that you are attempting to place it on a Linux system. :roll:

Access your NAS via SSH, login as "admin" and run:

Code: Select all

cd /share/Public
rm -f /share/Public/blkdevMonitor.sh
wget ftp://csdread:csdread@ftp.qnap.com/NAS/spindown/blkdevMonitor.sh
chmod +x blkdevMonitor.sh
/share/Public/blkdevMonitor.sh
#done 


Patrick M. Wilson
Victoria, BC Canada
QNAP TS-470 Pro w/ 4 * Western Digital WD30EFRX WD Reds (RAID5) - - Single 8.1TB Storage Pool FW: QTS 4.2.0 Build 20151023 - Kali Linux v1.06 (64bit)
Forums: View My Profile - Search My Posts - View My Photo - View My Location - Top Community Posters
QNAP: Turbo NAS User Manual - QNAP Wiki - QNAP Tutorials - QNAP FAQs

Please review: When you're asking a question, please include the following.
kscircular
Starting out
Posts: 36
Joined: Sun Oct 07, 2012 3:11 am

Re: blkdevMonitor - can't get it to run

Post by kscircular »

You're a wizard Patrick! That worked perfectly. I totally missed the embedded control character.
Thank you!
TS-453 Pro, 16GB
User avatar
pwilson
Guru
Posts: 22533
Joined: Fri Mar 06, 2009 11:20 am
Location: Victoria, BC, Canada (UTC-08:00)

Re: blkdevMonitor - can't get it to run

Post by pwilson »

kscircular wrote:You're a wizard Patrick! That worked perfectly. I totally missed the embedded control character.
Thank you!


If you want to be able to edit Linux scripts in your NAS shares from WinDoZe, simply install a decent text editor on your Windows box, that can handle Linux <LF> line terminated files. I recommend Notepad++ for Windows users.

(It's an excellent editor, and it will allow you to edit both DOS/Windows <CR><LF> terminated files, and Linux/UNIX/OS X <LF> terminated files).
Last edited by pwilson on Mon Dec 22, 2014 6:36 am, edited 3 times in total.

Patrick M. Wilson
Victoria, BC Canada
QNAP TS-470 Pro w/ 4 * Western Digital WD30EFRX WD Reds (RAID5) - - Single 8.1TB Storage Pool FW: QTS 4.2.0 Build 20151023 - Kali Linux v1.06 (64bit)
Forums: View My Profile - Search My Posts - View My Photo - View My Location - Top Community Posters
QNAP: Turbo NAS User Manual - QNAP Wiki - QNAP Tutorials - QNAP FAQs

Please review: When you're asking a question, please include the following.
kscircular
Starting out
Posts: 36
Joined: Sun Oct 07, 2012 3:11 am

Re: blkdevMonitor - can't get it to run

Post by kscircular »

Good idea. I use that at work and it is a good editor. I'll install it on my home box too since I'll probably be delving into more Linux stuff.
Thanks Patrick
TS-453 Pro, 16GB
User avatar
pwilson
Guru
Posts: 22533
Joined: Fri Mar 06, 2009 11:20 am
Location: Victoria, BC, Canada (UTC-08:00)

Re: blkdevMonitor - can't get it to run

Post by pwilson »

kscircular wrote:Good idea. I use that at work and it is a good editor. I'll install it on my home box too since I'll probably be delving into more Linux stuff.
Thanks Patrick
I've been playing with Linux for 24 years. I still learn something new every day.

Patrick M. Wilson
Victoria, BC Canada
QNAP TS-470 Pro w/ 4 * Western Digital WD30EFRX WD Reds (RAID5) - - Single 8.1TB Storage Pool FW: QTS 4.2.0 Build 20151023 - Kali Linux v1.06 (64bit)
Forums: View My Profile - Search My Posts - View My Photo - View My Location - Top Community Posters
QNAP: Turbo NAS User Manual - QNAP Wiki - QNAP Tutorials - QNAP FAQs

Please review: When you're asking a question, please include the following.
Post Reply

Return to “HDD Spin Down (HDD Standby)”