Difference between revisions of "Storagegroup table"

From MythTV Official Wiki
Jump to: navigation, search
(Correction to sql)
(Add some SQL for reinstating the table to default.)
Line 77: Line 77:
 
See also [[Storage_Groups]] for how these entries are used.
 
See also [[Storage_Groups]] for how these entries are used.
  
{{stub}}
+
== Default ==
[[Category:DB Table]]
+
 
 +
If you screw up your storagegroup table, or just want to reset it to default
 +
 
 +
Clear out the mess first
 +
<pre>
 +
delete from storagegroup;
 +
</pre>
 +
 
 +
Then put back a clean set.  You may want to first find & replace localhost with your correct hostname.
 +
Listed with complete inserts on each line so you can quickly amend it to suit your needs.
 +
<pre>
 +
INSERT INTO `storagegroup` (`id`, `groupname`, `hostname`, `dirname`) VALUES(1,  'Default',    'localhost', '/var/lib/mythtv/recordings/' );
 +
INSERT INTO `storagegroup` (`id`, `groupname`, `hostname`, `dirname`) VALUES(2,  'Videos',      'localhost', '/var/lib/mythtv/videos/'    );
 +
INSERT INTO `storagegroup` (`id`, `groupname`, `hostname`, `dirname`) VALUES(3,  'Fanart',      'localhost', '/var/lib/mythtv/fanart/'    );
 +
INSERT INTO `storagegroup` (`id`, `groupname`, `hostname`, `dirname`) VALUES(4,  'Trailers',    'localhost', '/var/lib/mythtv/trailers/'  );
 +
INSERT INTO `storagegroup` (`id`, `groupname`, `hostname`, `dirname`) VALUES(5,  'Coverart',    'localhost', '/var/lib/mythtv/coverart/'  );
 +
INSERT INTO `storagegroup` (`id`, `groupname`, `hostname`, `dirname`) VALUES(7,  'Screenshots', 'localhost', '/var/lib/mythtv/screenshots/');
 +
INSERT INTO `storagegroup` (`id`, `groupname`, `hostname`, `dirname`) VALUES(8,  'Banners',    'localhost', '/var/lib/mythtv/banners/'    );
 +
INSERT INTO `storagegroup` (`id`, `groupname`, `hostname`, `dirname`) VALUES(9,  'DB Backups',  'localhost', '/var/lib/mythtv/db_backups/' );
 +
INSERT INTO `storagegroup` (`id`, `groupname`, `hostname`, `dirname`) VALUES(10, 'LiveTV',      'localhost', '/var/lib/mythtv/livetv/'    );
 +
INSERT INTO `storagegroup` (`id`, `groupname`, `hostname`, `dirname`) VALUES(11, 'Streaming',  'localhost', '/var/lib/mythtv/streaming/'  );
 +
</pre>

Revision as of 10:39, 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 default base dirname is /var/lib/mythtv/ so the matching dirname are

/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/

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.

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

delete from storagegroup;

Then put back a clean set. You may want to first find & replace localhost with your correct hostname. Listed with complete inserts on each line so you can quickly amend it to suit your needs.

INSERT INTO `storagegroup` (`id`, `groupname`, `hostname`, `dirname`) VALUES(1,  'Default',     'localhost', '/var/lib/mythtv/recordings/' );
INSERT INTO `storagegroup` (`id`, `groupname`, `hostname`, `dirname`) VALUES(2,  'Videos',      'localhost', '/var/lib/mythtv/videos/'     );
INSERT INTO `storagegroup` (`id`, `groupname`, `hostname`, `dirname`) VALUES(3,  'Fanart',      'localhost', '/var/lib/mythtv/fanart/'     );
INSERT INTO `storagegroup` (`id`, `groupname`, `hostname`, `dirname`) VALUES(4,  'Trailers',    'localhost', '/var/lib/mythtv/trailers/'   );
INSERT INTO `storagegroup` (`id`, `groupname`, `hostname`, `dirname`) VALUES(5,  'Coverart',    'localhost', '/var/lib/mythtv/coverart/'   );
INSERT INTO `storagegroup` (`id`, `groupname`, `hostname`, `dirname`) VALUES(7,  'Screenshots', 'localhost', '/var/lib/mythtv/screenshots/');
INSERT INTO `storagegroup` (`id`, `groupname`, `hostname`, `dirname`) VALUES(8,  'Banners',     'localhost', '/var/lib/mythtv/banners/'    );
INSERT INTO `storagegroup` (`id`, `groupname`, `hostname`, `dirname`) VALUES(9,  'DB Backups',  'localhost', '/var/lib/mythtv/db_backups/' );
INSERT INTO `storagegroup` (`id`, `groupname`, `hostname`, `dirname`) VALUES(10, 'LiveTV',      'localhost', '/var/lib/mythtv/livetv/'     );
INSERT INTO `storagegroup` (`id`, `groupname`, `hostname`, `dirname`) VALUES(11, 'Streaming',   'localhost', '/var/lib/mythtv/streaming/'  );