Crash / Burn / Recover - Can I?

Forum for questions and support relating to the 1.30.x releases only.
Locked
AnotherBrian
Posts: 112
Joined: Tue Jul 27, 2010 6:36 am

Crash / Burn / Recover - Can I?

Post by AnotherBrian »

I want to generate a video from zoneminder archive data on a trashed ubuntu 17.04 / zoneminder 1.30 system.
I can't boot up the drive and stupid me didn't use a logical drive system - everything is in a boot partition.

17.04 is no longer supported by ubuntu and there is a warning around that warns against using 17.10.
Okee Doke - one step back and now I got 16.04 / 1.30 running on a new drive.
Is there any way to get to the old archived data and generate a video? I would think mounting the old mysql/apache/zoneminder directories over the new system directories would be dangerous
User avatar
iconnor
Posts: 2880
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Crash / Burn / Recover - Can I?

Post by iconnor »

That should work fine actually.
bbunge
Posts: 2930
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Crash / Burn / Recover - Can I?

Post by bbunge »

I feel the tricky part would be the zm database. I've used backup copies (dump) of the database to reinstall Zoneminder on a fresh system. I suppose it is possible to copy the MySQL zm files (located in /var/lib/mysql) to another drive. Not sure what you would have to do to get the database to work. Keep copies! Copy the /var/cache/zoneminder/*.* as well. Keep copies!! Remember if something goes wrong with the database the events records and/or images will be deleted. Keep Copies!!!

Ubuntu 17.04 should be still out there if you need to create a recovery disk. You may want to try to recover the existing drive. Make a copy if it can be read. Clonezilla may be able to transfer everything to another drive and if Clonezilla can read the old drive it can be used to make an image you can restore if your copies get messed up.

Did I say to make copies????
Best of luck... Of course you know Google is your friend...
AnotherBrian
Posts: 112
Joined: Tue Jul 27, 2010 6:36 am

Re: Crash / Burn / Recover - Can I?

Post by AnotherBrian »

Ok - this worked. User ids and Group Ids on the defective drive won't match the conventions on the new drive. mount --bind comes to mind but this won't work with ext4 system. Hence bindfs is the tool to use. Recall we have a new live drive with a new working zoneminder and we have an old drive with the data. We want the new zoneminder to use the old data.

First mount the drive. I used the gui from disks which mounted the old drive into /media/<myuserID>/<diskUUID>

Become root

Code: Select all

sudo su
Install bindfs

Code: Select all

apt install bindfs
Stop services

Code: Select all

service zoneminder stop
service mysql stop
service apache2 stop 
Set current directory to make life easy

Code: Select all

cd  /media/<myuserID>/<diskUUID>
Mount the file systems using the appropriate user and group ids.

Code: Select all

bindfs -o nonempty -u www-data -g www-data ./var/cache/zoneminder /var/cache/zoneminder
bindfs -o nonempty -u mysql -g mysql ./var/lib/mysql  /var/lib/mysql
Now start the services

Code: Select all

service start mysql
service start apache2 
service start zoneminder
If you reboot the system you will be back fully on the new zoneminder and all that old data will be unmounted.
Locked