[mythtv-users] db restore

Daryl McDonald darylangela at gmail.com
Sun Aug 12 11:56:33 UTC 2018


On Sat, Aug 11, 2018 at 10:29 PM, Stephen Worthington <
stephen_agent at jsw.gen.nz> wrote:

> On Sat, 11 Aug 2018 21:40:26 -0400, you wrote:
>
> >On Thu, Aug 9, 2018 at 2:27 PM, Daryl McDonald <darylangela at gmail.com>
> >wrote:
> >
> >>
> >>
> >> On Thu, Aug 9, 2018 at 11:11 AM, Stephen Worthington <
> >> stephen_agent at jsw.gen.nz> wrote:
> >>
> >>> On Thu, 9 Aug 2018 14:50:54 +0100, you wrote:
> >>>
> >>> >On 09/08/18 14:23, Daryl McDonald wrote:
> >>> >>
> >>> >>
> >>> >> On Wed, Aug 8, 2018 at 11:30 PM, Stephen Worthington
> >>> >> <stephen_agent at jsw.gen.nz <mailto:stephen_agent at jsw.gen.nz>> wrote:
> >>> >>
> >>> >
> >>> >>
> >>> >>     The way I run my fstab is to use gparted to add labels to the
> >>> >>     recording partitions (rec1, rec2, ...), and then use fstab
> entries
> >>> >>     like this:
> >>> >>
> >>> >>     LABEL=rec5 /mnt/rec5 jfs relatime,errors=remount-ro,nofail 0  2
> >>> >>
> >>> >>
> >>> >> So I wouldn't need UUID any more, I already created labels in
> gparted?
> >>> >> this is my fstab:
> >>> >>   # / was on /dev/sda1 during installation
> >>> >> UUID=06336f2d-051d-4900-bb9f-ccb6f81d5bd5 /               ext4
> >>> >> errors=remount-ro 0       1
> >>> >> # swap was on /dev/sda5 during installation
> >>> >> UUID=47904312-a99f-46dd-ae81-5f0fff64df5e none            swap
> sw
> >>>
> >>> >>            0       0
> >>> >> UUID=3769e2e8-adde-456c-86e4-0402be737ef6 /media/daryl    ext4
> >>> >> defaults    0       1
> >>> >> UUID=ec787761-11d5-4127-b198-e159bfcd2a6a /media/daryl    ext4
> >>> >> defaults    0       1
> >>> >> UUID=3d591aa5-fb48-4fd1-8989-e01d66926876 /media/daryl    ext4
> >>> >> defaults    0       1
> >>> >>   my labels are storage1, 2, &3 but only storage 1 mounts
> >>> >
> >>> >Isn't that because they all ahve the same mountpoint?
> >>>
> >>> Yes, they all need separate mount points - only one drive can mount on
> >>> the /media/daryl mount point.  The normal place to put fixed mount
> >>> points in Ubuntu is in /mnt.  The /media directory is used for
> >>> automounts.  If you plug in a USB disk or flash drive, or put a CD or
> >>> DVD in an optical drive, in Ubuntu it will normally automount itself
> >>> in a new directory made from the drive label under /media/daryl, and
> >>> also automatically appear in the disk software such as Nautilus as a
> >>> disk icon.  So doing fixed mount points on /media/daryl will stop that
> >>> automounting from working.  I would recommend doing this:
> >>>
> >>> sudo mkdir /mnt/storage1
> >>> sudo mkdir /mnt/storage2
> >>> sudo mkdir /mnt/storage3
> >>> chmod a=rwx /mnt/storage1
> >>> chmod a=rwx /mnt/storage2
> >>> chmod a=rwx /mnt/storage3
> >>>
> >>> and then changing those three lines in /etc/fstab to:
> >>>
> >>> LABEL=storage1 /mnt/storage1    ext4 defaults    0       2
> >>> LABEL=storage2 /mnt/storage2    ext4 defaults    0       2
> >>> LABEL=storage3 /mnt/storage3    ext4 defaults    0       2
> >>>
> >>> Note that I have also changed the 1 at the end of those lines to 2.
> >>> Only the disk mounted on / should have pass 1 setting in fstab.  All
> >>> other disks should be pass 2 (or 0 for special mount points like
> >>> /proc).  The pass number tells the boot process that all drives with
> >>> pass 1 are to be checked and made available in the early boot process.
> >>> But only the / drive needs to be made available that early - the other
> >>> drives should be left for the normal mounting process later.
> >>>
> >>
> >> Much obliged Stephen, all changes worked well.
> >>
> >
> >I replied too soon, I can't access previous recordings and new ones don'
> >play properly. fstab looks like this:
> ># <file system> <mount point>   <type>  <options>       <dump>  <pass>
> ># / was on /dev/sda1 during installation
> >UUID=06336f2d-051d-4900-bb9f-ccb6f81d5bd5 /               ext4
> >errors=remount-ro 0       1
> ># swap was on /dev/sda5 during installation
> >UUID=47904312-a99f-46dd-ae81-5f0fff64df5e none            swap    sw
> >      0       0
> >LABEL=storage1 /mnt/storage1    ext4        defaults    0       2
> >LABEL=storage2 /mnt/storage2    ext4        defaults    0       2
> >LABEL=storage3 /mnt/storage3    ext4        defaults    0       2
> >
> >the default storage directories in myth BE setup are /mnt/storage1,
> >/mnt/storage2, /mnt/satorage3/
> >recordings were green when I was using /media/daryl, red since. Any
> >suggestons?
>
> On looking back through this thread, I noticed I had left the sudo off
> the chmod commands, so they probably did not work.  To fix that, do
> this:
>
> sudo umount /mnt/storage1
> sudo chmod a=rwx /mnt/storage1
> sudo mount /mnt/storage1
> sudo umount /mnt/storage2
> sudo chmod a=rwx /mnt/storage2
> sudo mount /mnt/storage2
> sudo umount /mnt/storage3
> sudo chmod a=rwx /mnt/storage3
> sudo mount /mnt/storage3
>
> Then make sure that you can properly access the mounted drives from
> the daryl account.  So, without using sudo, do these commands:
>
> cd /mnt/storage1
> echo "test string" >testfile
> ls -al testfile
> cat testfile
> rm testfile
> ls -al testfile
>
> The results should look something like this:
>
> stephen at mypvr:~$ cd /mnt/rec1
> stephen at mypvr:/mnt/rec1$ echo "test string" >testfile
> stephen at mypvr:/mnt/rec1$ ls -al testfile
> -rw-rw-r-- 1 stephen stephen 12 Aug 12 14:09 testfile
> stephen at mypvr:/mnt/rec1$ cat testfile
> test string
> stephen at mypvr:/mnt/rec1$ rm testfile
> stephen at mypvr:/mnt/rec1$ ls -al testfile
> ls: cannot access 'testfile': No such file or directory
> stephen at mypvr:/mnt/rec1$
>

 daryl at trieli:~$ cd /mnt/storage1
daryl at trieli:/mnt/storage1$ echo "test string" >testfile
daryl at trieli:/mnt/storage1$ ls -al testfile
-rw-rw-r-- 1 daryl daryl 12 Aug 12 07:46 testfile
daryl at trieli:/mnt/storage1$ cat testfile
test string
daryl at trieli:/mnt/storage1$ rm testfile
daryl at trieli:/mnt/storage1$ ls -al testfile
ls: cannot access 'testfile': No such file or directory
daryl at trieli:/mnt/storage1$

>
> If all that works, then your permissions should be correct.
>
> Next, where on your storage partitions are your recording files
> stored?  Best practice is to have them in a subdirectory.  I use
> "recordings" for that.  So the storage directories that I put into
> mythtv-setup are like this:
>
> /mnt/rec1/recordings
>

I'm using /mnt/storage*/mythtv/recordings

>
> The reason for doing that is to do with how a mount point works.  If
> there is nothing mounted on a mount point, it will still point to a
> directory, but likely on the root drive.  That directory can be used
> for recording to, but will be in the wrong place, and will likely
> cause the / partition to fill up rapidly.  If the storage group points
> to a subdirectory under the mount point, then MythTV will be looking
> for /mnt/storage1/recordings.  So when it looks for that directory on
> a mount point which is not actually mounted at the time, it will not
> see it and will not record to it.
>
> The next problem to look for is different ownership.  When you create
> a new Linux system, the numbers assigned to owner and group names all
> change (except for root).  So if your recording files were created
> using owner daryl and group mythtv on an old system, they will almost
> certainly be using different numbers for those two names on your new
> system.  So you may need to do a chown command on all the recording
> files to fix that.  To see if that is the case, please post the
> results of changing to one of the directories where you have your
> recording files and doing this command:
>
> ls -al | head -n 10

 daryl at trieli:~$ ls -al | head -n 10
total 275424
drwxr-xr-x 20 daryl daryl     69632 Aug 12 07:37 .
drwxr-xr-x  4 root  root       4096 Aug  8 13:39 ..
-rw-------  1 daryl daryl     56378 Aug 11 18:08 .bash_history
-rw-r--r--  1 daryl daryl       220 Aug  8 12:06 .bash_logout
-rw-r--r--  1 daryl daryl      3771 Aug  8 12:06 .bashrc
drwx------ 19 daryl daryl      4096 Aug 11 15:07 .cache
-rw-rw-r--  1 daryl daryl      1684 Aug  9 09:10 ca.ipvanish.com.crt
drwx------  3 daryl daryl      4096 Aug  8 16:16 .compiz
drwx------ 19 daryl daryl      4096 Aug 11 17:58 .config
daryl at trieli:~$


> _______________________________________________
> mythtv-users mailing list
> mythtv-users at mythtv.org
> http://lists.mythtv.org/mailman/listinfo/mythtv-users
> http://wiki.mythtv.org/Mailing_List_etiquette
> MythTV Forums: https://forum.mythtv.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-users/attachments/20180812/b609ca1c/attachment.html>


More information about the mythtv-users mailing list