Jump to content

preclear.sh needs update due to movement of mdcmd


Alex R. Berg

Recommended Posts

unRaid 6.1 moved /root/mdcmd to /usr/local/sbin/mdcmd.

 

The preclear script still uses /root/mdcmd. I think this might mean that preclear will not detect whether user is trying to wipe a disk already in the array.

 

The old preclear thread seems to be closed: http://lime-technology.com/forum/index.php?topic=2817.0, I cannot reply on that thread, and the download link is still there, so that could be a problem people accidentally downloading that link.

 

A change like seems to work:

# unRaid 6.0.1 -> 6.1.2 moved mdcmd from /root/mdcmd to /usr/local/sbin/mdcmd
mdcmd_cmd=/usr/local/sbin/mdcmd
[[ ! -n $(type -P "$mdcmd_cmd") ]] && mdcmd_cmd=/root/mdcmd
devices=`$mdcmd_cmd status | strings | grep rdevName | sed 's/\([^=]*\)=\([^=]\)/\/dev\/\2/'` 

 

instead of this

 

devices=`/root/mdcmd status | strings | grep rdevName | sed 's/\([^=]*\)=\([^=]\)/\/dev\/\2/'` 

 

Best Alex

Link to comment

Yeah, I've added that to my config/go-file as I expect there might be other scripts with similar problems. I have also searched my flash drive for 'mdcmd' and fixed all the /root/mdcmd references I found, but still some might be hidden inside archived files I expect.

 

Personally I've just fixed my copy of the preclear script, but that won't help others, hence this thread.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...