Mounting external ZFS volume

If you need to perform a data recovery from an external ZFS [zfs] volume you may find those hinds helpful:

  1. Attach encrypted partition where ZFS pool resides with:
    geli attach /dev/your_device_partition
  2. Import ZFS pool at given mountpoint (/mnt/zfs):
    zpool import -af -R /mnt/zfs
  3. Modify mount point location for a given dataset that may have mountpoint set to none what marks it as no mount (note this mountpoint will append to parent mount point location):
    zfs set mountpoint=ROOT zroot/ROOT/default
  4. Mount and mount all pool datasets:
    zfs mount -a
    zfs umount -a
  5. Mount/umount given dataset:
    zfs mount zroot/ROOT/default
  6. You can verify if your ZFS pool is active with:
    zpool status
  7. You can see what ZFS datasets are available with mount points with:
    zfs list

[zfs] https://www.freebsd.org/doc/handbook/zfs.html

Joomla portal access recovery

In case you need to reset admin password for a Joomla install, you can do this by simply updating database record.

$ mysql5 -h <database_hostname> -u <database_username> -p <database_name>
Enter password: <database_password>
mysql> show tables;
(...)
mysql> UPDATE <database_prefix>_users SET password='d2064d358136996bd22421584a7cb33e:trd7TvKHx6dMeoMmBVxYmg0vuXEA4199' WHERE username='admin';

This will use mysql5 commadline client to connect to a given database. You will see if tables are in place. Then you will update password hash of user admin to secret which equals:

d2064d358136996bd22421584a7cb33e:trd7TvKHx6dMeoMmBVxYmg0vuXEA4199

You can also use any other database client of your choice, DBeaver is also nice utility with graphical user interface.

You can obtain necessary database access information from configuration.php file accessed by ssh/ftp on a web server.

public $dbtype = 'mysqli';
public $host = '<database_hostname>';
public $user = '<database_username>';
public $password = '<database_password>';
public $db = '<database_name>';
public $dbprefix = '<database_prefix>';

If you want to dump/backup a database into local file, use mysqldump5:

mysqldump5 -h <database_hostname> -u <database_username> -p <database_name> > dumpfile.sql

If you want to restore a database from a local file, use mysql5:

mysql5 -h <database_hostname> -u <database_username> -p <database_name> < dumpfile.sql