Koozali.org: home of the SME Server

Obsolete Releases => SME 7.x Contribs => Topic started by: curdegn on October 12, 2008, 05:41:38 PM

Title: Affa: backup to USB HD
Post by: curdegn on October 12, 2008, 05:41:38 PM
Hi,

Using Affa to backup to an external USB drive (that is always plugged in) I have the following "interesting" observation:
a) Starting the backup job with "affa --run jobname" works always fine,
b) But the time based automatic way always fails as follows:
Code: [Select]
Sat Oct 11 22:30:02[14516]: Affa 1.0.0-3: Starting job jobname scheduled (localhost)
Sat Oct 11 22:30:02[14516]: Description: beispielbackup
Sat Oct 11 22:30:02[14516]: Mounting /dev/sdc1 to /mnt/affadevice
Sat Oct 11 22:30:02[14516]: Exec Cmd: /bin/mount  /dev/sdc1 /mnt/affadevice
Sat Oct 11 22:30:02[14516]: Exec Out: /dev/sdc1: Input/output error
Sat Oct 11 22:30:02[14516]: Exec Out: mount: /dev/sdc1: can't read superblock
Sat Oct 11 22:30:02[14516]: Exec Out: exitstatus=32
Sat Oct 11 22:30:02[14516]: Error 1549: Couldn't mount /dev/sdc1 /mnt/affadevice

Has anyone an idea where to start searching for the problem?

Following my affa configuration:
Code: [Select]
jobname=job
    AutoUnmount=yes
    AutomountDevice=/dev/sdc1
    AutomountOptions=
    AutomountPoint=/mnt/affadevice
    ConnectionCheckTimeout=240
    Debug=yes
    Description=beispielbackup
    DiskSpaceWarn=strict
    EmailAddresses=me@email.com
    Exclude[0]=
    Include[0]=
    RPMCheck=no
    RootDir=/mnt/affadevice
    SMEServer=yes
    TimeSchedule=1200,1600,2230
    Watchdog=yes
    chattyOnSuccess=99
    dailyKeep=7
    doneDaily=2008286
    doneMonthly=200810
    doneWeekly=200840
    doneYearly=2008
    localNice=0
    monthlyKeep=12
    postJobCommand=
    preJobCommand=
    remoteHostName=localhost
    remoteNice=0
    rsync--inplace=yes
    rsync--modify-window=0
    rsyncCompress=yes
    rsyncTimeout=900
    scheduledKeep=3
    sshPort=22
    status=enabled
    weeklyKeep=4
    yearlyKeep=1


Title: Re: Affa: backup to USB HD
Post by: hfdill on October 13, 2008, 09:55:50 AM
Check /etc/fstab if the drive is mounted as dev/sdc1. chances are that it is mounted as dev/sdb1 or dev/sda1. backup may also fail if you try to mount the device when it is mounted already.
Title: Re: Affa: backup to USB HD
Post by: curdegn on October 24, 2008, 09:25:12 AM
Many thanks for the response.

A check with fdisk shows that the USB-HD is /dev/sdc1. Also it is not mounted when affa tries to mount it.
But looking to /etc/fstab I found an interesting line in there:
Code: [Select]
/dev/sdc1               /media/backupHD22       ext3    pamconsole,exec,noauto,managed 0 0
Think this may be from previously checked backup systems. Could this line in fstab cause the error? How to remove it? If I delete it it will appear soon later again.

Many thanks
Title: Re: Affa: backup to USB HD
Post by: elmarconi on October 24, 2008, 10:29:50 PM
Also it is not mounted when affa tries to mount it.

Are you sure?  Check output of "df" or cat /etc/mtab

But looking to /etc/fstab I found an interesting line in there:
Code: [Select]
/dev/sdc1               /media/backupHD22       ext3    pamconsole,exec,noauto,managed 0 0
Think this may be from previously checked backup systems. Could this line in fstab cause the error? How to remove it? If I delete it it will appear soon later again.

If its mounted on /media/backupHD22 you could symlink /mnt/affadevice to that?
Title: Re: Affa: backup to USB HD
Post by: curdegn on October 27, 2008, 01:34:01 PM
Thanks for help,

Quote
Also it is not mounted when affa tries to mount it.
Are you sure?  Check output of "df" or cat /etc/mtab
Yes, unfortunately very sure... was my first thinking too....

May the USB-harddisk itself be the problem? It is a 2.5" USB-disk of WD, bus powered only. I remember before setting the SME-Server to the production environment I tested with a 3.5" USB-Disk with AC power and all works fine. I don't know, can such things matter?
Title: Re: Affa: backup to USB HD
Post by: elmarconi on October 27, 2008, 01:55:47 PM
Thanks for help,
Yes, unfortunately very sure... was my first thinking too....

May the USB-harddisk itself be the problem? It is a 2.5" USB-disk of WD, bus powered only. I remember before setting the SME-Server to the production environment I tested with a 3.5" USB-Disk with AC power and all works fine. I don't know, can such things matter?

Yes, I 've got them too!
Code: [Select]
[root@smeserver ~]# lsusb | grep Western
Bus 001 Device 006: ID 1058:0702 Western Digital Technologies, Inc. Passport External HDD

Can't imagine that the WD is the cause.

From man mount:
(iii) Normally, only the superuser can mount file systems.  However, when fstab contains the user option  on  a line, then anybody can mount the corresponding system.

Is this affa job running as superuser/root? One could try to add AutomountOptions=-l as per man mount:
Code: [Select]
-l: Add  the  ext2,  ext3  and  XFS  labels in the mount output. Mount must have permission to read the disk  device (e.g. be suid root) for this to work.

Title: Re: Affa: backup to USB HD
Post by: curdegn on October 27, 2008, 04:25:44 PM
Think taking a closer look to the previledges is a good idea:
If I run the backup job manually I do this as root and all works fine. As what user does affa start the scheduled jobs? As mentioned before, those do not work.

Quote
AutomountOptions=-l
Is now set

Concerning "suid root" for /dev/sdc1, is it correct as follows:
Quote
brwSrw----  1 root disk 8, 33 Oct 27 16:00 /dev/sdc1

Let's see tonight if it works... (edit)unfortunately did not.....(/edit)

Many thanks
Curdegn
Title: Re: Affa: backup to USB HD
Post by: curdegn on November 02, 2008, 12:06:07 AM
As reported before the problem is not jet solved.

May be it is because I am not able to set "suid root". Somehow, after some time it disapears again. Don't know what process is setting the device back to its default. So the question is: How do I set the "suid root" for /dev/sdc1 on a SME server 7.3.
Many thanks for help.