--- /dev/null
+commit 6d396db9931e940fbc3435266ace23327b978575
+Author: hschang <chang@dev3>
+Date: Thu Aug 10 15:22:42 2017 +0900
+
+ USB Harddisk test
+
+diff --git a/RecordTimer.py b/RecordTimer.py
+index 32fb923..5a13d7f 100755
+--- a/RecordTimer.py
++++ b/RecordTimer.py
+@@ -410,6 +410,15 @@ class RecordTimerEntry(timer.TimerEntry, object):
+
+ record_service = property(lambda self: self.__record_service, setRecordService)
+
++ def checkRecordingPath(self):
++ old_Filename = self.Filename
++ self.calculateFilename()
++ filename = self.Filename
++ self.Filename = old_Filename
++
++ from Components import Harddisk
++ return not Harddisk.isUsbStorage(filename)
++
+ def createTimer(xml):
+ begin = int(xml.get("begin"))
+ end = int(xml.get("end"))
+@@ -466,6 +475,16 @@ class RecordTimer(timer.Timer):
+ print "unable to load timers from file!"
+
+ def doActivate(self, w):
++ if w.state == RecordTimerEntry.StateWaiting and w.checkRecordingPath() is False:
++ service_name = w.service_ref.getServiceName()
++ self.timer_list.remove(w)
++ if w.dontSave is False:
++ w.resetState()
++ w.disable()
++ self.addTimerEntry(w)
++ Notifications.AddNotification(MessageBox, _("Can not recording on a USB storage.\nService name : %s"% service_name), MessageBox.TYPE_ERROR)
++ return
++
+ # when activating a timer which has already passed,
+ # simply abort the timer. don't run trough all the stages.
+ if w.shouldSkip():
+diff --git a/lib/python/Components/Harddisk.py b/lib/python/Components/Harddisk.py
+index 1221f8f..c455e5f 100755
+--- a/lib/python/Components/Harddisk.py
++++ b/lib/python/Components/Harddisk.py
+@@ -6,6 +6,8 @@ from Tools.CList import CList
+ from SystemInfo import SystemInfo
+ import time
+ from Components.Console import Console
++import os
++import glob
+
+ def MajorMinor(path):
+ rdev = stat(path).st_rdev
+@@ -56,6 +58,30 @@ def enableUdevEvent(enable = True):
+ print "CMD : ", cmd
+ system(cmd)
+
++def getDeviceFile(dev_path):
++ for parts in getProcMounts():
++ if os.path.realpath(parts[1]).startswith(dev_path):
++ return parts[0]
++
++def isUsbStorage(filename):
++ _dirname = os.path.dirname(filename)
++ _dirname = os.path.realpath(_dirname)
++ while not os.path.ismount(_dirname):
++ _dirname = os.path.dirname(_dirname)
++
++ if _dirname == '/':
++ return False
++
++ dev = getDeviceFile(_dirname)
++ if dev:
++ dev = os.path.basename(dev)
++ phyPath = os.path.realpath('/sys/block/' + dev[:3])
++ for x in glob.glob("/sys/bus/usb/devices/usb*"):
++ if phyPath.find(os.path.realpath(x)) != -1:
++ return True
++
++ return False
++
+ DEVTYPE_UDEV = 0
+ DEVTYPE_DEVFS = 1
+
+diff --git a/lib/python/Screens/InfoBarGenerics.py b/lib/python/Screens/InfoBarGenerics.py
+index ea75301..9b04238 100755
+--- a/lib/python/Screens/InfoBarGenerics.py
++++ b/lib/python/Screens/InfoBarGenerics.py
+@@ -1223,6 +1223,11 @@ class InfoBarTimeshift:
+ if self.timeshift_enabled:
+ print "hu, timeshift already enabled?"
+ else:
++ from Components import Harddisk
++ if Harddisk.isUsbStorage(config.usage.timeshift_path.value):
++ self.session.open(MessageBox, _("Timeshift not possible on a USB storage."), MessageBox.TYPE_ERROR)
++ return 0
++
+ if not ts.startTimeshift():
+ self.timeshift_enabled = 1
+
+diff --git a/timer.py b/timer.py
+old mode 100644
+new mode 100755
+index aaae0b2..d58a83e
+--- a/timer.py
++++ b/timer.py
+@@ -232,6 +232,10 @@ class Timer:
+ self.setNextActivation(min)
+
+ def timeChanged(self, timer):
++ if timer not in (self.processed_timers + self.timer_list):
++ print "timer not found"
++ return
++
+ print "time changed"
+ timer.timeChanged()
+ if timer.state == TimerEntry.StateEnded: