Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Problem expanding capacity

Featured Replies

Happened in 4.2.1 as well but I was hoping the newest version may have fixed the issues I am seeing.

 

I had an array (MD 1500) with 8 500GB drives that I was trying to expand.  I removed the parity drive and replaced it with a 750GB Samsung drive and re-built the parity.  That went smoothly and I could continue to write to the drives until it came time where I needed to expand by adding the old 500GB parity drive as an expansion drive.  The system sees it fine but seems to have a problem when it goes in to clear.  The web UI locks up shortly into the clear process but looking at the syslog it looks like the clear completes but it then fails to mount and the startup fails (and after a reboot it is back at needing to clear the drive).  Here is what the syslog ends with:

 

Apr 25 08:17:29 Tower emhttp: ... clearing 94% complete

Apr 25 08:19:24 Tower emhttp: ... clearing 95% complete

Apr 25 08:21:19 Tower emhttp: ... clearing 96% complete

Apr 25 08:23:13 Tower emhttp: ... clearing 97% complete

Apr 25 08:25:11 Tower emhttp: ... clearing 98% complete

Apr 25 08:27:18 Tower emhttp: ... clearing 99% complete

Apr 25 08:29:26 Tower emhttp: ... clearing 100% complete

Apr 25 08:29:26 Tower emhttp: ... syncing

Apr 25 08:29:29 Tower emhttp: mounted: fopen: Invalid argument

Apr 25 08:29:29 Tower last message repeated 8 times

Apr 25 08:29:29 Tower emhttp: shcmd (33): killall -HUP smbd

 

Any suggestions on what may be going wrong or what I can do to get it working?

  • Author

I went back to a stock go script and it seems to be behaving better.  I had 2 scripts in there from here to use larger block sizes and to spin up the drives when my media center is powered on and I guess one of them wasn't interacting well.  Really not that concerned but if something could be done to solve the problem with directory listings being slow and having to spin up the drives it would eliminate my need for the scripts (until then I may just resort to keeping the drives spun up the whole time).

I went back to a stock go script and it seems to be behaving better.  I had 2 scripts in there from here to use larger block sizes and to spin up the drives when my media center is powered on and I guess one of them wasn't interacting well.  Really not that concerned but if something could be done to solve the problem with directory listings being slow and having to spin up the drives it would eliminate my need for the scripts (until then I may just resort to keeping the drives spun up the whole time).

Just disable the scripts while doing an expansion.  Then re-enable them.  You should be fine.

 

I have the same issue with a need to spin up my drives when my media player is detected online.  I've gone through several itterations

This one is named spin_drives.sh and is on my flash drive.

 

My current spin_drives.sh script is here:

[pre]

#!/bin/bash

######################################################################

#

# Spin up the unRaid disks when a media player is detected on line.

# (it is on line if it responds to a "ping" command over the network)

#

# Joe L.

# January 5, 2008

######################################################################

 

# List the media player IP addresses here.

# separate the IP addresses by spaces if there are more then one

mp_ip="192.168.2.21 192.168.2.251"

last_look_online="no"

 

get_parity_drive_device() {

    dev_name="no_parity_drive"

 

    dev_path=`grep "parity=" /boot/config/disk.cfg| cut -d"=" -f2|

                sed "s/\\r//"`

    if [ "$dev_path" != "" ]

    then

        dev_name=`ls -l /dev/disk/by-path |

                grep "${dev_path} -" | cut -d "/" -f3`

    fi

    echo $dev_name

}

 

# Determine if the unRaid array is on-line or not.  If not currently

# started, we do not want to be spinning up any drives.

get_status() {

    ps -ef | grep smbd >/dev/null 2>/dev/null

    if [ $? != 0 ]

    then

            STATUS="stopped"

    else

            cmd status | strings >/tmp/$$spin_up_status

            STATUS=`grep mdState /tmp/$$spin_up_status | cut -d "=" -f2`

            PHYSICAL_DISKS=`grep "^rdevName.*=" /tmp/$$spin_up_status |

                cut -d "=" -f2`

            parity_drive=`get_parity_drive_device`

            if [ "$parity_drive" != "" ]

            then

                PHYSICAL_DISKS=`echo "$PHYSICAL_DISKS" | grep -v $parity_drive`

            fi

    fi

}

 

# function to issue commands to the unRaid "md" device.

# specifically, we will use it to get the status of the array

cmd() {

    echo $* >/proc/mdcmd

    cat /proc/mdcmd

}

 

spin_up_drives() {

    # loop through the drives spinning them up

    # by reading a single "random" block from each disk

    # in turn.  We use "dd" commands in the background so

    # all the disks will be spun up in parallel,

    # This should be enough to ensure at least one of the

    # blocks was not in the disk cache memory.

    for i in $PHYSICAL_DISKS null

    do

        # determine the number of blocks on the drive

        blocks=`df -k /dev/$i | grep -v Filesystem|

        sed "s/\([^ ]*\) *\([^ ]*\) .*/\2/"`

 

        # calculate a (random) block number to be read somewhere

        # between block 1 and the max blocks on the drive

        skip_b=$(( 1+(`dd if=/dev/urandom count=1 2>/dev/null |

        cksum | cut -f1 -d" "`)%($blocks) ))

 

        # read the random block from the disk.  We use a random

        # block to try to ensure it is not in the cache memory

        # if the block was in the cache memory, the disk would

        # not spin up.

        dd if=/dev/$i of=/dev/null \

        count=1 bs=1k skip=$skip_b >/dev/null 2>&1 &

        echo "`date` ** reading block $skip_b from $i " >>/var/log/spin_up.log

    done

    wait

}

 

check_mp_status() {

        mp_online="no"  # initialize to "no" until we learn otherwise

        # ping each of the media servers to determine if online

        for i in $mp_ip

        do

            # ping the media server, if it answers, it is online

            # echo "$out" | grep "received," 1>/dev/null 2>&1

            out=`ping -q -c 1 $i 2>/dev/null`

            rec_count=`echo "$out" | grep "received" | cut -d " " -f4`

            if [ "$rec_count" = "1" ]

            then

                mp_online="yes"

                echo "`date` **** $i is online" >>/var/log/spin_up.log

                # if one is online, we do not need to ping

                # any others, break out of the "for" loop.

                break;

            fi

        done

        echo $mp_online

}

 

# Sleep x number of seconds.  While sleeping, every 30 seconds, do an "ls -R"

# to keep the directory listing in cache memory.

sleep_dir_cache() {

    seconds_to_sleep=$1

    time_now=`date '+%s'`

    end_time=$(( $time_now + $seconds_to_sleep ))

    loop_interval=30

    max_loops=100

    while  true

    do

      # every 30 seconds, do an ls -R to keep the directory listing in cache memory

      ls -R /mnt/user >/dev/null 2>/dev/null

      sleep $loop_interval

      max_loops=$(( $max_loops - 1 ))

      if [ $max_loops -le 0 ]

      then

          break;

      fi

      now=`date '+%s'`

      if [ $now -gt $end_time ]

      then

        break;

      fi

    done

}

 

 

# create a lockfile so we do not start two of these spin_up processes

lockfile="/var/lock/spin_up_drives"

 

if ( set -o noclobber; echo "$$" > "$lockfile") 2> /dev/null;

then

  trap 'rm -f "$lockfile"; exit $?' INT TERM EXIT

 

  echo "`date` ****** spin_drives.sh started" >/var/log/spin_up.log

 

  # loop forever

  while true

  do

    get_status

    if [ "$STATUS" != "STARTED" ]

    then

        # if the array is not started, sleep a few seconds and loop to

        # check status once more

        sleep 20

    else

        # The array is started, see if any of the media players are

        # on-line. If they are, spin up the drives if we need to.

 

        online="no"  # initialize to "no" until we learn otherwise

        online=`check_mp_status`

 

        # if any media players are online, spin up the drives

        # and then sleep checking for status changes and we'll

        # see if they are still online next time through the loop.

 

        if [ $last_look_online = "no" ]

        then

            if [ $online = "yes" ]

            then

              last_look_online="yes"

              echo "`date` media player is online..." >>/var/log/spin_up.log

            fi

      else # last_look_online = yes

            if [ $online = "no" ]

            then

              last_look_online="no"

              echo "`date` media player offline..." >>/var/log/spin_up.log

            fi

      fi

      if [ $online = "yes" ]

      then

          spin_up_drives

          # we just spun up the drives, we don't need to do much

          # for the next 2400 seconds

          sleep_dir_cache 2400

      else

          sleep 5

      fi

 

    fi

  done

 

    rm -f "$lockfile"

    trap - INT TERM EXIT

else

    echo "Failed to acquire lockfile: $lockfile."

    echo "Held by $(cat $lockfile)"

fi

[/pre]

 

Archived

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.