Difference between revisions of "Storagegroup table"

From MythTV Official Wiki
Jump to: navigation, search
(Default: The "default" is empty. There are no hard-coded paths in the storagegroup table. There are hard-coded paths in the source, but those point to your user directory, not '/var/lib/'.)
(Example Entries)
Line 43: Line 43:
 
</pre>
 
</pre>
  
On a new install, the default base dirname is /var/lib/mythtv/ so the matching dirname are
+
On a new install, the table is empty.
<pre>
+
/var/lib/mythtv/recordings/
+
/var/lib/mythtv/videos/
+
/var/lib/mythtv/fanart/
+
/var/lib/mythtv/trailers/
+
/var/lib/mythtv/coverart/
+
/var/lib/mythtv/screenshots/
+
/var/lib/mythtv/banners/
+
/var/lib/mythtv/db_backups/
+
/var/lib/mythtv/livetv/
+
/var/lib/mythtv/streaming/
+
</pre>
+
  
 
== SQL ==
 
== SQL ==

Revision as of 16:01, 3 September 2013

Important.png Note: The correct title of this article is storagegroup table. It appears incorrectly here due to technical restrictions.

The storagegroup table contains the Storage Groups that are configured in mythtv-setup.

Table Description

Field name Type Null Key Default Extras
id int(11) PRI NULL auto_increment
groupname varchar(32) MUL NULL
hostname varchar(64) MUL NULL
dirname varchar(255) NULL

Fields

  • id is a unique identifier for entries in this table.
  • groupname is the name of the Storage Group.
  • dirname is the directory of the Storage Group.

Example Entries

       id: 1
groupname: Default
 hostname: localhost.localdomain
  dirname: /video/recordings/ 

Commonly used groupname field values

Default
Videos
Fanart
Trailers
Coverart
Screenshots
Banners
DB Backups
LiveTV
Streaming

On a new install, the table is empty.

SQL

If you want to add another block of entries, because say you have another volume with storage, use this sql. The id column is left out because it auto-increments during the insert. phpmyadmin is an easy to use tool for applying sql.

Check your sql has the intended result first

    select groupname,hostname,concat('/srv/',substring(dirname,10)) as newdirname from storagegroup;

Then apply the block copy

 insert into storagegroup (groupname,hostname,dirname)
    select groupname,hostname,concat('/srv/',substring(dirname,10)) as newdirname from storagegroup;

10 rows inserted.

If you need to amend your hostname, or insert a storagegroup block from another backend

 update storagegroup set hostname='localhost';

See also Storage_Groups for how these entries are used.

Default

If you screw up your storagegroup table, or just want to reset it to default

Clear out the mess first

truncate table storagegroup;