Koozali.org: home of the SME Server

Restoring from USB Disk

Offline bclayton

  • ****
  • 139
  • +0/-0
Restoring from USB Disk
« on: September 03, 2012, 01:44:24 AM »
I have installed SME 8 and need to restore from the backup I made using the sever-manager panel to a USB drive.  I have tried to follow the instructions in the USBDisk post using hal, but I am not sure I am doing it correctly.  Are there other instructions.  I have searched Google and don't find much.  Thanks!  I need quick help.

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: Restoring from USB Disk
« Reply #1 on: September 03, 2012, 04:35:37 AM »
bclayton

You need to tell us more information and be much more specific.

If you used the standard (default) sme server manager Backup or Restore panel, then you had two choices.
Backup to desktop
Backup to workstation or connected USB drive.

Which did you use ?

In either case Restore can be made from the server manager panel.
If you did a backup to desktop (which creates a smeserver.tgz file) you can also restore at FIRST boot after a fresh install of the OS, when prompted. If you have already booted, then there is a workaround to reset that switch in the Howto referred to below.

Quote
the instructions in the USBDisk post using hal

Exactly which instructions are they, please provide a link.


If you used a backup contrib to do the backup eg DAR2, then you need to reinstall that contrib & configure the job database settings in order to do the restore.

You need to tell us more details so we can better advise you.

There are many more tips about backup and restore here:
http://wiki.contribs.org/Backup_server_config
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline bclayton

  • ****
  • 139
  • +0/-0
Re: Restoring from USB Disk
« Reply #2 on: September 03, 2012, 04:50:29 AM »
Thanks, Mary.

Here is what I was following:
USB on SME 8
Things change on SME 8

It's difficult to work out what your device name is ie /dev/sda1
The mount point isn't automatically added in /etc/fstab
We use hal for the first and manually create and mount for the second

To find the device name, label, filesystem and the uid

#! /bin/bash
hal-find-by-property --key volume.fsusage --string filesystem |
while read udi ; do
   # ignore optical discs
   if test  "$(hal-get-property --udi $udi --key volume.is_disc)" == "false" ; then
       dev=$(hal-get-property --udi $udi --key block.device)
       fs=$(hal-get-property --udi $udi --key volume.fstype)
       lb=$(hal-get-property --udi $udi --key volume.label)
       echo $dev": label "$lb",file system: "$fs ",uid: "$udi
   fi
done
To check a mount point exists and mount

ll /media
mount /dev/sda1 /media/120Gbfat32  (ie. mount /media/120Gbfat32 no longer works)
ls -lh /media/120Gbfat32/
umount /dev/sda1 (when finished)

--------------------------------------------------------------------------------
The USB disk was backed up from the Backup panel in server-manager, which I assume uses DAR.  I did not install any additional backup apps.  I am not very proficient in Linux, it always just works, so any help appreciated.  Thanks.

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: Restoring from USB Disk
« Reply #3 on: September 03, 2012, 05:04:24 AM »
bclayton

Quote
I did not install any additional backup apps.

OK then.

Quote
The USB disk was backed up from the Backup panel in server-manager, which I assume uses DAR.

You did not answer which backup method you used.
To repeat the question:
If you used the standard (default) sme server manager Backup or Restore panel, then you had two choices.
Backup to desktop
Backup to workstation or connected USB drive.

Which did you use ?
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline bclayton

  • ****
  • 139
  • +0/-0
Re: Restoring from USB Disk
« Reply #4 on: September 03, 2012, 05:07:09 AM »
Sorry.  I used Backup to Workstation and then chose USB disk.  Thanks.

Offline bclayton

  • ****
  • 139
  • +0/-0
Re: Restoring from USB Disk
« Reply #5 on: September 03, 2012, 05:12:25 AM »
Hi Mary,

Here is the most recent backup report.  Perhaps it will help.  Thanks again.

==================================
DAILY BACKUP TO WORKSTATION REPORT
==================================
Backup started at Sat Sep  1 01:00:04 2012
Backup of mysql databases has been done
Mounting backup shared directory localhost/media/USBdisk1
Backup temp directory /media/USBdisk1/tmp_dir/provue-server.midsouthcolor.com is mounted and is writable
Using set number 1 of 5
Attempt full backup
Backup base file name is full-201209010100
Making backup in temp directory
Using a backup session timeout of : 28770 seconds


 --------------------------------------------
 78400 inode(s) saved
 with 0 hard link(s) recorded
 0 inode(s) changed at the moment of the backup
 0 inode(s) not saved (no inode/file change)
 0 inode(s) failed to save (filesystem error)
 255 inode(s) ignored (excluded by filters)
 0 inode(s) recorded as deleted from reference backup
 --------------------------------------------
 Total number of inode considered: 78655
 --------------------------------------------
Rotating backups in a new set /media/USBdisk1/provue-server.midsouthcolor.com/set1.
Moving backup files to target directory /media/USBdisk1/provue-server.midsouthcolor.com/set1
Updating backup configuration data
Backup successfully terminated at : Sat Sep  1 01:13:33 2012

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: Restoring from USB Disk
« Reply #6 on: September 03, 2012, 05:23:46 AM »
bclayton

Quote
I used Backup to Workstation and then chose USB disk.

OK we are getting somewhere now.
So you have a fresh install of sme8.0 without any data and users & so on, and you want to restore from the USB backup, is that correct ?
Note you should ONLY restore to a clean install of the sme operating system, without data & users configured etc, except for any basic configuration needed to get the server talking to your network.

It seems the mount point on your previous (sme7) server was  /media/USBdisk1

You do the restore using the same Backup or Restore panel in server manager, and select the appropriate option to restore from a backup made to workstation/USB disk.
You need to check that your USB disk is properly detected and mounted by sme8.

So if you connect the USB backup drive to sme8.0 and run these commands, what output do you see ? You can copy and paste all the following at the sme server root prompt if you are connected using Putty from a workstation, otherwise CAREFULLY type it in at the console command prompt.

hal-find-by-property --key volume.fsusage --string filesystem |
while read udi ; do
   # ignore optical discs
   if test  "$(hal-get-property --udi $udi --key volume.is_disc)" == "false" ; then
       dev=$(hal-get-property --udi $udi --key block.device)
       fs=$(hal-get-property --udi $udi --key volume.fstype)
       lb=$(hal-get-property --udi $udi --key volume.label)
       echo $dev": label "$lb",file system: "$fs ",uid: "$udi
   fi
done


Edit: PS I get something like this, but it will vary depending on what type of drives are in your system.

/dev/sda1: label USBBackup1,file system: ext3 ,uid: /org/freedesktop/Hal/devices/volume_uuid_677d030a_ec82_47b9_9710_f07495d2d8f6
« Last Edit: September 03, 2012, 05:25:36 AM by mary »
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline bclayton

  • ****
  • 139
  • +0/-0
Re: Restoring from USB Disk
« Reply #7 on: September 03, 2012, 05:35:03 AM »
Yes, it is a clean install.

When I run the code you sent, there is no response.  I did make sure I had the latest updates installed.  Thanks.

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: Restoring from USB Disk
« Reply #8 on: September 03, 2012, 05:49:04 AM »
bclayton

Quote
When I run the code you sent, there is no response.

Is your USB drive connected when you run the code ?

Please show us the code you used, line by line.
You can see what you actually typed by pushing the up cursor arrow on the keyboard, to review each line you entered.
We want to see what you typed, NOT what is written in the wiki !

Check very carefully that what you typed exactly matches what is in the wiki, line by line, it works for me OK.

Also with the USB disk connected, run this command and show us the output.

fdisk -l
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline bclayton

  • ****
  • 139
  • +0/-0
Re: Restoring from USB Disk
« Reply #9 on: September 03, 2012, 06:04:39 AM »
Mary,

The USB drive is connected. It is a 1 TB drive.  Here is the output of both commands:

hal-find-by-property --key volume.fsusage --string filesystem | while read udi ; do    if test  "$(hal-get-property --udi $udi --key volume.is_disc)" == "false" ; then        dev=$(hal-get-property --udi $udi --key block.device);        fs=$(hal-get-property --udi $udi --key volume.fstype);        lb=$(hal-get-property --udi $udi --key volume.label);        echo $dev": label "$lb",file system: "$fs ",uid: "$udi;    fi; done



Output from fdisk -l :

fdisk -l

Disk /dev/sda: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   fd  Linux raid autodetect
/dev/sda2              14       30401   244091610   fd  Linux raid autodetect

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1          13      104391   fd  Linux raid autodetect
/dev/sdb2              14      121601   976655610   fd  Linux raid autodetect

Disk /dev/md2: 249.9 GB, 249949716480 bytes
2 heads, 4 sectors/track, 61022880 cylinders
Units = cylinders of 8 * 512 = 4096 bytes

Disk /dev/md2 doesn't contain a valid partition table

Disk /dev/md1: 106 MB, 106823680 bytes
2 heads, 4 sectors/track, 26080 cylinders
Units = cylinders of 8 * 512 = 4096 bytes

    Device Boot      Start         End      Blocks   Id  System

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: Restoring from USB Disk
« Reply #10 on: September 03, 2012, 06:16:54 AM »
bclayton

Quote
The USB drive is connected.....hal-find-by-property .....

That command appears correct and when copied and pasted works on my system, so that's being entered OK.


Quote
Output from fdisk -l :

OK looks like your 2 RAID1 drives are sda & sdb, but I see no sign of sdc, which is where I'd expect the USB drive to appear.

What make and model USB drive is it ? You need to troubleshoot why that does not appear in fdisk -l

Can you try connecting it to another sme8 test server ? Is it readable ? Has it failed ???

I have to go out now for an appointment so someone else please take over.
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline bclayton

  • ****
  • 139
  • +0/-0
Re: Restoring from USB Disk
« Reply #11 on: September 03, 2012, 06:22:40 AM »
The drive is an I-Omega but not sure about the model.  It is in a remote location and can check tomorrow.  Is it now showing as /dev/sdb?

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: Restoring from USB Disk
« Reply #12 on: September 03, 2012, 06:30:42 AM »
bclayton

Quote
Is it now showing as /dev/sdb?

Ooh sorry, I overlooked the sizes.
Do you have a 2 drive RAID1 array ?
If so then one of your disks has failed and the USB drive has been put into the array automatically.
If that is the case your USB backup has been wiped !

Alternatively you installed the sme OS with the USB drive connected, then it was added to the array, with the same outcome as above.

Do you have another backup ?

Please check the drive contents of sdb to be sure
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline bclayton

  • ****
  • 139
  • +0/-0
Re: Restoring from USB Disk
« Reply #13 on: September 03, 2012, 06:49:26 AM »
Thanks so much Mary.  I will check tomorrow to be sure.

I do only have one hard drive in the machine and I don't think the USB drive was plugged in when I did the install.  I do have another drive that was mirrored in the 7.6 system but I uplugged it before installing version 8.  I did try to boot from it and got strange characters on the screen and it did not boot.  Would it possible still have data and just not boot?  Again, thanks.

Brooks

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: Restoring from USB Disk
« Reply #14 on: September 03, 2012, 06:56:59 AM »
bclayton

Quote
I don't think the USB drive was plugged in when I did the install.

Well fdisk does say that the USB (sdb) is part of the RAID array, and that's why the backup/restore cannot access it, as it is busy being a member of RAID1 array.

/dev/sdb1   *           1          13      104391   fd  Linux raid autodetect
/dev/sdb2              14      121601   976655610   fd  Linux raid autodetect

What does this show:
cat /proc/mdstat

Quote
I do have another drive that was mirrored in the 7.6 system but I uplugged it before installing version 8.  I did try to boot from it and got strange characters on the screen and it did not boot.  Would it possible still have data and just not boot?

Yes data may be retrievable, hold on to that, but that's another issue to sort that out.
Is the sme7 server still operating ? If so just do another backup.

I have to go !
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.