Hard drive standy keeps plex from playing media

Server Version#: 1.13.5.5291
Player Version#: 3.57.1
Plex cannot wake up the hard drives inside my computer, I have the computer (Ubuntu 18.04) set to never sleep, and the hard drives are supposedly set to never sleep too. They do anyway, and I have no way to do anything about it unless I get on the computer and manually open something off the hard drive. I do I not want to keep the hard drives on 24/7 because I don’t need the hassle of replacing hard drives but if I have to I will. I just want to access my files while I’m out and about, that’s the whole point of this software.
Just a little frustrated since this happens all the time.

I am pretty sure that Linux offers a utility that will keep your drives awake but if it does not the simple thing to do would be a script or some other utility that accesses the drive on an interval.

A few year back I had a similar problem with an old Windows computer and I found a little utility that every 20 minutes would write a file to the disk and then delete it. That utility worked very well to keep drives active.

If it existed for Windows several years ago I would be VERY surprised if something like it did not exist for Linux.

I was hoping it wouldn’t come to that but if I have to I will, I’ll give it a shot. Kind of frustrating plex doesn’t have that option. Thanks for the help

I “think” that the problem is so rare that Plex figures it would be counter productive to try to build a workaround for computer/drive combos that do not respect no sleep settings.

Of course a reliable WOL feature is a different thing. I do not allow anything in my server setup to sleep but there are those that believe “sleep” preforms a needed function.

May I be of help here ?

As Elijah stated, WOL has existed for a long time.

If PMS cannot wake up the HD’s inside the computer, something isn’t configured right at the OS level.

This isn’t a PMS issue, it’s a Ubuntu problem. Particularly Power Management setting.

So windows or maybe a different linux wouldn’t have this problem? Reformatting the hard drives would be a pain but if I don’t have to run all the hard drives all the time I won’t. A lot of extra heat and power usage for just idling.

May I ask you to explain what’s actually happening?

if HD’s have spun down (S3 state) but are otherwise properly mounted in the kernel,
when the kernel sees an I/O request to that physical device, if S3, it suspends the I/O and spins the drive back up. When spun up, it returns to the S4 (active) state and the Read/Write request is resumed. The calling process is completely unaware the device was ever asleep (heads unloaded).

What are you actually seeing?

I have 3 hard drives, 1 with the system on it, and 2 for the media. Now after a given amount of time, say an hour, if you go onto plex onto any other device, and try to watch say a music video, it will say the drive is unavailable and the drive needs to be remounted. So to fix this, I have to go onto the computer and actually open a folder on the drive locally to get the drive to spin up, I can hear the drive and then I am able to watch my content. It happens for all users and all media types. I’m not sure how to monitor anything more technical honestly

Let me restate please into something I can directly test?

  1. Drive is mounted normally
  2. Power management is enabled and set to auto spin down after X minutes
  3. Some time after drive has spun down,
  4. PMS makes a read request of that media
  5. The file / library section is marked non-available because the media has not yet spun up.
  6. Manually stimulating the asleep-disk (directory) to waken it before attempting to play results in normal playback

This about it?

About right, although about a week ago I disabled the spin down in the disks program thinking that would solve it but they still spin-down somehow

You thought you disabled it. :slight_smile: something didn’t happen as you expected.

While I test this,

Please look for file /etc/apm/event.d/20hdparm

In there you should find the spin down time. Set the time value = zero 0 and reboot.

The other source is in /etc/hdparm.conf

You should also be able to completely disable APM there for HD’s if not already tried.

I apologize if it takes me a while to work on that, those files are read only for me so I’m having to go around that through ubuntu’s painful permissions

ubuntu’s permission deal is easy to manage when you know linux :smiley:

  1. sudo sh and get a root shell
  2. supply your username’s password.
  3. you’re now at a command prompt as root
  4. Adjust for maximum smoke

I edited the APMD spindown to 0 using the termianl text editor. I’m hoping that’s the right one

copy paste the file text here. I’ll verify

APMD_SPINDOWN=0

HDPARM=/sbin/hdparm
[ -x “${HDPARM}” ] || exit 0

[ -n “${APMD_DRIVES}” ] || exit 0

for DRIVE in $APMD_DRIVES; do
[ -b “${DRIVE}” ] || exit 0
done

[ “${APMD_SPINDOWN}” -gt 0 ] || exit 0

power_conserve ()
{
# Set IDE hard disk spindown time to a short time.
for DRIVE in $APMD_DRIVES; do
“${HDPARM}” -q -S “${APMD_SPINDOWN}” “${DRIVE}” || true
done
}

power_performance ()
{
# Disable IDE hard disk spindown.
for DRIVE in $APMD_DRIVES; do
“${HDPARM}” -q -S 0 “${DRIVE}” || true
done
}

choose_power ()
{
if on_ac_power > /dev/null
then
power_performance
else
power_conserve
fi
}

if [ “${1}” = “start” ]; then
choose_power
elif [ “${1}” = “resume” ] && [ “${2}” != “standby” ]; then
choose_power
elif [ “${1},${2}” = “change,power” ]; then
choose_power
elif [ “${1}” = “stop” ]; then
power_performance
fi

exit 0

Good to go :+1:

Reboot time

It says your a team member, while we’re here can you confirm or deny that intel quick sync is required for hard ware acceleration regardless of your gpu?

I can confirm Intel QSV is the currently support Hardware Acceleration in PMS.
Different GPU generations (-3xxx, -4xxx, -5xxx, etc) have different capabilities

To be specific how it works,

If the CPU has an iGPU, it is then a candidate for having QSV. The QSV ASIC and the GPU share the command ring buffer but you can’t have the ASIC without the iGPU

We query the hardware and ask for its feature flags. That’s how we know whether or not we can hardware transcode a particular video on that hardware.

Make sense?

Yeah I follow.
Anyway, tried it out and I had the same problem, still says unavailable till I open a folder from the drive locally.