Koozali.org: home of the SME Server

Obsolete Releases => SME Server 9.x => Topic started by: DanB35 on November 03, 2015, 05:08:07 PM

Title: Console backup - what are requirements for removable device?
Post by: DanB35 on November 03, 2015, 05:08:07 PM
I'm trying to get the console "Perform backup to removable media" working, in preparation for migrating my server to a virtual environment.  I have a 3TB USB hard drive connected to my server, freshly partitioned and formatted in ext4, on /dev/sdc1.  This partition isn't mounted.  When I select option 8 from the console menu, the next screen asks if I wish to perform a backup.  I select Yes, and the next screen says "Insert removable media, then hit the enter key."  Since the drive is already connected, I hit the enter key.  After a brief pause (about 5 seconds), the next screen says, "No removable and/or writable media or device found."  I can retry as many times as I like without success.  There's nothing at all in /var/log/messages about the attempt or the failure.

On reviewing http://wiki.contribs.org/USBDisks, I ran egrep "(kernel|fstab|scsi).*(usb|USB)" /var/log/messages, and contrary to what that page suggests, there was no fstab-sync line in the output.  The disk was recognized, but no mountpoint was created, and the disk wasn't mounted.

On my server, /media was empty.  I created a directory called usbdisk, and was then able to mount the USB drive (mount /dev/sdc1 /media/usbdisk), write and read files, etc.  I then unmounted the disk.  When I then tried the console backup, it ran (or at least started running--looks like it will have a while to go).

Edit: I just confirmed that, on a fresh installation of SME 9.0 with all updates installed, /media is empty.  Not sure if this is how it should be or not.
Title: Re: Console backup - what are requirements for removable device?
Post by: Stefano on November 03, 2015, 06:18:03 PM
I beg your pardon but: did you try to connect your usb disk only when requested?

if so, did it work?

thank you
Title: Re: Console backup - what are requirements for removable device?
Post by: DanB35 on November 03, 2015, 06:57:18 PM
So you mean, wait until the screen says "Insert removable media", then plug it in, then hit enter?  No, I didn't try that.  Once it finishes the task it's currently running (there's no apparent way to neatly cancel the process), I will.

Do you know that the process depends on the drive not being connected until that point, or are you guessing?  It's fine either way, I'm just curious which is the case.

Edit: The manual (http://wiki.contribs.org/SME_Server:Documentation:Administration_Manual:Chapter6#Option_8:_Perform_backup_to_USB_device) simply says, "Attach a USB Device and follow the prompts."  There's no indication that the exact timing of attaching the USB device is critical.
Title: Re: Console backup - what are requirements for removable device?
Post by: Stefano on November 03, 2015, 08:05:12 PM
I'm just guessing, but here:
http://wiki.contribs.org/SME_Server:Documentation:FAQ:Section01#Backups_.26_Restores (http://wiki.contribs.org/SME_Server:Documentation:FAQ:Section01#Backups_.26_Restores)

I read:
Quote
... you should see the new restore via USB backup option.
-NOW plug in the usb drive (Do not plug in the usb drive until you reach this point).
-pick YES or RESTORE (or whatever is presented to you)

I guess this is how it's supposed to work, so we need some amending in our documentation..
DanB35, would you mind to dig into? TIA


NOTE: I know we are talking about Backup and not Restore, but I (repeat) guess that the two things work in the same way regarding mounting external usb disks
Title: Re: Console backup - what are requirements for removable device?
Post by: DanB35 on November 03, 2015, 08:45:59 PM
The strange thing is, the only thing I changed between the attempts that didn't run and the one that did is that I created /media/usbdisk.  There wasn't any attempt where I waited for the "insert media" screen before connecting the drive, but on the most recent attempt (after that directory had been created, the drive had been mounted there, "touch sample" completed successfully, and drive unmounted), it worked (more accurately, it's working--67% complete).

This would make sense to me if the backup process mounted the disk at /media/usbdisk, but it didn't--it's mounted at /mnt/bootstrap-console-backup instead.  So I'm kind of confused (not that that's anything new).

I don't at all mind updating the wiki, once I know what needs to go there.  There are some other things I'd add as well, if I can confirm that they're the case:
Title: Re: Console backup - what are requirements for removable device?
Post by: DanB35 on November 03, 2015, 10:15:33 PM
Well, the backup completed without apparent errors.  I deleted it, deleted /media/usbdisk, unplugged the USB drive, and then plugged it in again.  I next went through the console menu to run the backup--option 8 ("perform backup to removable media"), Yes, Enter--and it's running.  Interestingly, if I find and kill the tar process, it finishes up right away--and the console reports that the backup completed successfully.

My problem here is that, as best as I can tell, I did exactly the same thing I did at the beginning, several times--but now it worked.  Makes it hard to track down where the disconnect is.