Project

General

Profile

Using Odroid HC2 for TVH - should I be worried about using SD card for OS?

Added by A L almost 6 years ago

I am currently running TVH on a big x86 server with lots of small hard drives.

The server runs Openmediavault as the Operating System, which runs off an SSD.

I wanted to scale things down and have decided to order myself an Odroid HC2, with a view to whacking in a single large HDD, to essentially replace my current server.

I have also ordered a 32GB A1 Sandisk SD card, to install Openmediavault on.

On the face of it, things should work perfectly - OMV, once up and running, makes very little use of the SD card.

However, TVH is where it gets tricky.

I have TVH update all channel in the EPG everyday, which amounts to a considerable amount of information, plus there is a constant updating of scheduling too.

Is this activity going to wear out the SD card prematurely?

Do other users of ARM boards notice this as an issue?


Replies (11)

RE: Using Odroid HC2 for TVH - should I be worried about using SD card for OS? - Added by saen acro almost 6 years ago

Use cheaper USB Drive mount it as user partition and install on it TVH.

RE: Using Odroid HC2 for TVH - should I be worried about using SD card for OS? - Added by A L almost 6 years ago

Interesting - clever idea.

I was doing a bit more research - am I correct in thinking that TVHeadend runs completely in RAM? I sought of got the impression that TVHeadend saves nothing to disk (other than recordings them selves), unless you turn the device off.

RE: Using Odroid HC2 for TVH - should I be worried about using SD card for OS? - Added by Em Smith almost 6 years ago

I wouldn't worry too much. In the past I've run Ubuntu on a cheap usb key and they normally last a year or two with heavy usage before you suddenly get major problems. So with tvh, I'd expect it to last longer since it writes less frequently.

Nowadays I'd probably just buy a cheap ssd and a very cheap usb->ssd enclosure since overall a 120GB ssd on a popular auction site only costs twice as much as a 32gb sd card. That way you can also store live stream on it (for rewinding).

If you had tvh installed on the big disk then the disk would occasionally spin-up such as when updating schedules or epg or expiring programmes.

If you want to save a couple more watts, in theory you could save recordings to the ssd and then rename them on to the big disk after a couple of days. That way the big disk only spins up occasionally for a few minutes and while doing playback of older shows.

RE: Using Odroid HC2 for TVH - should I be worried about using SD card for OS? - Added by saen acro almost 6 years ago

Em Smith wrote:

I wouldn't worry too much. In the past I've run Ubuntu on a cheap usb key and they normally last a year or two with heavy usage before you suddenly get major problems. So with tvh, I'd expect it to last longer since it writes less frequently.

Nowadays I'd probably just buy a cheap ssd and a very cheap usb->ssd enclosure since overall a 120GB ssd on a popular auction site only costs twice as much as a 32gb sd card. That way you can also store live stream on it (for rewinding).

If you had tvh installed on the big disk then the disk would occasionally spin-up such as when updating schedules or epg or expiring programmes.

If you want to save a couple more watts, in theory you could save recordings to the ssd and then rename them on to the big disk after a couple of days. That way the big disk only spins up occasionally for a few minutes and while doing playback of older shows.

More ram less hdd, but its valid for pc's.
jaguar one +

RE: Using Odroid HC2 for TVH - should I be worried about using SD card for OS? - Added by Brent Bolin almost 6 years ago

I moved from MythTV on x86 running for about 14 years to Tvheadend on Odroid HC2 about 9 months ago. Have never looked back. Basically silent. WD 4TB drive and HDHomeRun network tuners(6) US Mpeg2

NFS shares for Kodi movies. Minidlnad for movies to any device and Shinobi for CCTV cameras. Not using Shinobi at the moment but works fine

Suppose it's OK if you like using lots of power and heating the room. Decided it wasn't for me

RE: Using Odroid HC2 for TVH - should I be worried about using SD card for OS? - Added by A L almost 6 years ago

Thanks for all that.

Brent Bolin - you have a very similar setup to what I will be using. May I ask - are you using the Harddrive purely for storage (i.e. are you running all systems directly from the SD card)?

RE: Using Odroid HC2 for TVH - should I be worried about using SD card for OS? - Added by Em Smith almost 6 years ago

I'd also add that if you use a usb (non-ssd) drive for your main system drive then in my experience they also tend to break after a couple of years. Perhaps OMV is a bit better, but with a normal OS you get constant writes every few minutes to the disk from logging, smartctl, time sync drift, etc.

Since usb disks tend to have a fast spin-down, it meant the drive would spin-down and then spin-up after a few minutes, causing wear and tear. Alternatively, and possibly equally bad, the disk doesn't spin down (or you alter settings to try to stop it spinning down), but then they seem to also fail since they seem as if they aren't meant to be on 24x7 and seem to fail far faster than internal drives. Perhaps coincidence, or "vibration" or worse air flow, I don't know.

So the other problem you'll eventually hit is that usb drives tend to have a large "retry on fail" interval. So, when the disk fails it will keep trying and trying to read the same bit of data from the disk; whereas internal drives return fail quite quickly, and (proper) NAS drives fail reads almost instantly (since the read can be satisfied from another drive on the RAID/zpool).

What this means is that when you try to copy data off the disk, it will keep retrying, the disk then overheats and causes more failures...

This is based on the numerous disks I've had fail over the years. But perhaps new ones are better. I often read that usb disks are the same as the internal ones, but I don't know if the manufacturers internally rate disks (in the same way Intel rates chips) so the ones that come out good become NAS, the worse ones become internal, and the poorer ones usb.

If you just use usb to do recordings, you tend not to have as many problems since the disk will spin for an hour-or-two at a time and only for a few hours a day.

RE: Using Odroid HC2 for TVH - should I be worried about using SD card for OS? - Added by A L almost 6 years ago

Thanks, Em - luckily, OMV has a specific add-on for installing it on USB sticks and SD Cards. It apparently turns off all the constant writes and allows them to be used for ages.

However, I am now worried that TVHeadend is going to do a similar thing, constantly writing to the SD Card that OMV is installed upon.

Do you happen to know how often, exactly, would write to the SD Card?

It is not absolutely clear, but I was under the impression that TVHeadend runs completely in RAM and only writes to disk when closing down. If this were the case, things like schedule and EPG updates would not make much of a difference, as I run my server for months and months without resetting it.

If that is not the case, I need to decide whether I should just leave TVHeadend on the SD Card and accept that it will fail at some point or whether (as you have suggested) you could install TVH directly onto the disk.

RE: Using Odroid HC2 for TVH - should I be worried about using SD card for OS? - Added by Brent Bolin almost 6 years ago

A L wrote:

Thanks for all that.

Brent Bolin - you have a very similar setup to what I will be using. May I ask - are you using the Harddrive purely for storage (i.e. are you running all systems directly from the SD card)?

The HD is pretty much all for storage. Mpeg2 for OTA recordings and Mpeg4 for ripped movies( about 600 )

Ubuntu Xenial by default doesn't use swap. Shinobi when used has it's home directory( /home/shinobi) mounted to the HD and so does Mysql ( /var/lib/mysql )

Very little is written to the SD card other then /var/log . I'm sure I could turn off Tvheadend logging and sysloging but haven't found the need too

Very happy with the setup. During prime time recording 7PM - 10PM iotop reports the disk writing 10M/s without issue

I've tried to break it by recording many muxes channels (~20) and it just keeps running

Believe EPG runs from RAM. Previously used Schedules Direct but have recently moved to zap2xml so I use lots of EPG data saving to disk (SD card) every 4 hours. Note: all tvh configuration data is on SD card

Guess we'll have to wait and see how the SD card holds up haven't had any problems. I think writing to SD card for OTA recordings would be pushing it. Also defeats the purpose of the built-in sata edge connector

RE: Using Odroid HC2 for TVH - should I be worried about using SD card for OS? - Added by Em Smith almost 6 years ago

I've not looked exactly what OMV does, but years ago (when non-rotational media first became available) there were a number of settings for netbooks (with non-rotational media) to limit writes by increasing dirty write timeouts, decreasing "swapiness", and a few other configs, so perhaps this is what OMV has. But you still face writes it's just that they are more consolidated. So, by default you used to have writes every 30 seconds (unless you had a lot of data), and the increase was to 120 seconds. But that meant that you could lose a few minutes of data on failure since it's in core instead of flushed to disk. So then people did things like downgrade from ext4 to ext2 to avoid disk journaling, which then means you're back in the 90s style full disk check.

On my machine, I have a raid (actually a zfs pool so it has crc for fixing problems) for root between an ssd and a normal disk. The normal disk never spins down since I get occasional writes from cron, ntp drift, etc.

TVHeadend mostly runs in RAM but would write to the disk from time-to-time such as if you have an EPG update that matches an autorec then it would create a new file on disk.

You can test it out yourself by doing something like:

touch /tmp/mytimestamp
sleep 3600
find .hts -newer /tmp/mytimestamp -ls

So you create a timestamp file, sleep an hour and then find files in the .hts directory that are newer than your timestamp file (assuming you were in the tvheadend directory, wherever that is on your system).

You "sleep 86400" if you want to sleep for a day and then find all files modified.

My preference (depending on cash) would be buy a cheap ssd and put it in a usb enclosure. The reason is that you can then save live tv for rewind on that disk. It would also be silent and use virtually no watts.

Second preference would be to leave it on SD and just do a backup occasionally on to your usb disk. It just depends how much modifications you do. Perhaps you intend to do nothing outside tvh, in which case it is ok, but if you end up twiddling with different system settings then it makes it difficult to backup.

Third preference would be buy a second SD card + card reader and mirror RAID across the two so that when one fails, you can still read off the other. I don't think you can use zfs with only 2GB RAM and I've had numerous issues with btrfs causing me hours of grief that I couldn't recommend it, so basic md/RAID would be the best you could do.

Fourth preference would be install on the usb disk. The only reason this is my least favourite is because I think the disk would spin-up and down, causing failure, or just generally wear out.

Oh, or 2.5th preference, buy a WD RE4/RED (NAS drive) and use that inside an a usb enclosure since I'd be fairly confident that disk could survive 24x7 usage even inside a usb enclosure rather than inside a PC. But that would be the most costly, but they have a much higher MTBF (though Google concluded a few years ago that the MTBF of disks is nonsense) and also have a far higher "non-recoverable read errors" number (used to be 1*10^16 vs 1*10^14).

RE: Using Odroid HC2 for TVH - should I be worried about using SD card for OS? - Added by Em Smith almost 6 years ago

Also you can search to find all (local/non-mounted) files that are modified by running as root the following:

touch /tmp/mytimestamp
(wait a while)
find / -xdev -newer /tmp/mytimestamp -ls

That would give you an indication of whether OMV is writing to the root partition itself outside of tvheadend. (I assume you only have one major partition, otherwise replace "/" with all the major partitions such as "find / /var /usr …").

For example on my box within a couple of seconds I had a number of system database files updated; a minute later and they're updated again. Nothing major, just the steady drip-drip-drip which tends to eventually wear out SD if running 24x7. You might have to wait a few minutes to see anything, especially if you don't have many services running, or you might need to run "sync" before the find to force the disk flush.

    (1-11/11)