Koozali.org: home of the SME Server

second hard disk busy

erland

second hard disk busy
« on: January 10, 2005, 09:40:41 AM »
Hi !

I have a problem. The setup : AMD athlon 1700 on sis730 with 512Mb RAM and two WD1200SB hard disks.
sme6.01.01 installed on first disk and has two ibays.
The second disk (wd2)is added and used for backup : every night a script mounts the disk(wd2) and copies the contents of the ibays to it(wd2)and umounts the disk(wd2). On occation the disk locks up and cannot umount ( drive is busy ). To unlock the drive I have to restart the server.
The only way I can reach the drive is with smartctl ( it reports no errors and a temp of 36C ).
I find this whole situation less than perfect and would like some help on the subject.

Regards Erland

stefan

second hard disk busy
« Reply #1 on: January 10, 2005, 11:52:07 AM »
Hello Erland

I do it exactly the same way. See my script below. Maybe that you are in the directory on the mounted 2nd disk (ie. cd /mnt/2nd_disk). If you try to unmount now you will get a "busy"-state. Do before unmount a "cd /".

Regards from Switzerland.
Stefan


My script:

/bin/echo "Starting Daily Backup to Disc..." > /tmp/daily_auf_disk.log
/bin/date >> /tmp/daily_auf_disk.log
/bin/date
/bin/echo "Starting Daily Backup to Disc..."
/sbin/service sybase stop >> /tmp/daily_auf_disk.log
echo "Copy CHGB2000 DataBases...."  >> /tmp/daily_auf_disk.log
echo "Copy CHGB2000 DataBases...."
cp -f /opt/sybase/chgb2000* /opt/sybase/backup
/bin/date >> /tmp/daily_auf_disk.log
/bin/date
echo "CHGB2000 DataBases copied...."  >> /tmp/daily_auf_disk.log
echo "CHGB2000 DataBases copied...."
/sbin/service sybase start >> /tmp/daily_auf_disk.log
mount -t ext3 /dev/sda1 /mnt/backup -o rw
/bin/date >> /tmp/daily_auf_disk.log
/bin/date
/bin/rm -f -r /mnt/backup/daten-7
mkdir /mnt/backup/daten-7
/bin/mv -f  /mnt/backup/daten-6/*  /mnt/backup/daten-7
/bin/rm -f -r /mnt/backup/daten-6
mkdir /mnt/backup/daten-6
/bin/mv -f  /mnt/backup/daten-5/*  /mnt/backup/daten-6
/bin/rm -f -r /mnt/backup/daten-5
mkdir /mnt/backup/daten-5
/bin/mv -f  /mnt/backup/daten-4/*  /mnt/backup/daten-5
/bin/rm -f -r /mnt/backup/daten-4
mkdir /mnt/backup/daten-4
/bin/mv -f  /mnt/backup/daten-3/*  /mnt/backup/daten-4
/bin/rm -f -r /mnt/backup/daten-3
mkdir /mnt/backup/daten-3
/bin/mv -f  /mnt/backup/daten-2/*  /mnt/backup/daten-3
/bin/rm -f -r /mnt/backup/daten-2
mkdir /mnt/backup/daten-2
/bin/mv -f  /mnt/backup/daten-1/*  /mnt/backup/daten-2
/bin/rm -f -r /mnt/backup/daten-1
tar -czf /mnt/backup/chgb2000.tar.gz /opt/sybase/backup  >> /tmp/daily_auf_disk.log
mkdir  /mnt/backup/daten-1
/bin/mv -f  /mnt/backup/chgb2000.tar.gz  /mnt/backup/daten-1
/bin/echo "Daily Backup to Disc done..." >> /tmp/daily_auf_disk.log
/bin/echo "Daily Backup to Disc done..."
/bin/date >> /tmp/daily_auf_disk.log
/bin/date
cp -f /tmp/daily_auf_disk.log  /mnt/backup/daten-1/files
cd /
umount /mnt/backup

erland

second hard disk busy
« Reply #2 on: January 10, 2005, 12:38:23 PM »
Hi Stefan

Thanks for the reply.

I haven't got access to the server at the moment, but i'm certain that i'm not in the directory.

I will post more info tonight


Regards Erland

stefan

second hard disk busy
« Reply #3 on: January 10, 2005, 01:37:30 PM »
Hello Erland

If you have access to your server this evening, could you send me please your script and I will analyse and test this on my "Test-Server 6.01-1". When it is running with no problems then we know that we should focus to hw.
Just another question: Do you run the script as a cron-job and if so, is it on root-level?

Thanks Stefan

stefan.menge@mengeonline.ch

guest22

second hard disk busy
« Reply #4 on: January 10, 2005, 01:51:13 PM »
[off topic]

Funny to see the different time-zone's being busy on contribs.org ;-)

[/off topic]

erland

second hard disk busy
« Reply #5 on: January 10, 2005, 09:52:54 PM »
Hi Stefan

The script is in /etc/cron.daily - I assume it runs as root.
This is the script :

#!/bin/sh
if [ -e /home/e-smith/files/ibays/winfinans/files/backup.txt ]; then
alias cp='cp -f'
mount /dev/hdc1 /mnt/wd2
cp -a /home/e-smith/files/ibays/ikke-off./files/* /mnt/wd2/ikke-off.
cp -a /home/e-smith/files/ibays/winfinans/files/* /mnt/wd2/winfinans
umount /mnt/wd2
rm /home/e-smith/files/ibays/winfinans/files/backup.txt
fi

Regards Erland

stefan

second hard disk busy
« Reply #6 on: January 11, 2005, 09:23:29 PM »
Hello Erland

Thanks for the script. I think that I have seen something related to your problem. If I let run the script in original form, sometimes the disc seemed to be mounted ok (no strange logs), but in reality the disc was NOT mounted normally, but without to generate an error-message! And this gives trouble...!
I guess you use ext3 as fs. So I have taken the mount and unmount command like I use in my script (see below)in which the parameters of fs-type '-t ext3' and access-type '-o rw' are exactly given.  
And... aloha ...the disc could be mounted and unmounted flawless!
I think that the system doesn't know exactly which fs-type to take.

Try it once with the patched script below:

#!/bin/sh
if [ -e /home/e-smith/files/ibays/winfinans/files/backup.txt ]; then
alias cp='cp -f'
mount -t ext3 /dev/hdc1 /mnt/wd2 -o rw
cp -a /home/e-smith/files/ibays/ikke-off./files/* /mnt/wd2/ikke-off.
cp -a /home/e-smith/files/ibays/winfinans/files/* /mnt/wd2/winfinans
umount /mnt/wd2
rm /home/e-smith/files/ibays/winfinans/files/backup.txt
fi



Best wishes from Switzerland
Stefan

erland

second hard disk busy
« Reply #7 on: January 12, 2005, 09:25:26 PM »
Hi Stefan

Thank you for helping out. I will try your way of mounting the disk.
It did puzzle me that I didn't get any error-messages, so I thought that part was all-right.

Regards Erland