Storagegroup table

From MythTV Official Wiki
Jump to: navigation, search

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


  • 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

DB Backups

On a new install, the table is empty.


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.


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

Clear out the mess first

TRUNCATE TABLE storagegroup;