Koozali.org: home of the SME Server

usb drive idle

Offline kruhm

  • *
  • 680
  • +0/-0
usb drive idle
« on: July 22, 2014, 12:40:04 AM »
Hi,

I have a usb drive docking station that I want to use for backup (st0005u). It seems to be going idle and the backup doesn't work.

To wake the drive, I have to access the mount with a simple:
Code: [Select]
$ls -la /media/BackupDrive1
But by accessing the mount, the backup won't start.
Code: [Select]
$/sbin/e-smith/do_backupwk
$Seems backup directory is already mounted. It should not happen and maybe there is a zombie process you must kill, or another backup in progress.
$Backup terminated: backup failed - status: 7424

I can unmount the drive and start the backup manually:
Code: [Select]
$umount /media/BackupDrive1/
$/sbin/e-smith/do_backupwk

How do I keep the drive from falling idle?

Thanks,

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: usb drive idle
« Reply #1 on: July 22, 2014, 05:30:07 PM »
I think you will find an answer if you Google for 'hdparm idle'.

Offline kruhm

  • *
  • 680
  • +0/-0
Re: usb drive idle
« Reply #2 on: July 22, 2014, 05:31:22 PM »
Great. Thank you much. I'll let you know what I find.

Offline kruhm

  • *
  • 680
  • +0/-0
Re: usb drive idle
« Reply #3 on: July 27, 2014, 11:46:59 AM »
While hdparm -C worked:
Code: [Select]
$ hdparm -C /dev/sdc

/dev/sdc:
 drive state is:  standby

I couldn't get any of the other options to work:
Code: [Select]
$ hdparm -B255 /dev/sdc

/dev/sdc:
 setting Advanced Power Management level to disabled
 HDIO_DRIVE_CMD failed: Invalid argument

Code: [Select]
$ hdparm -S0 /dev/sdc

/dev/sdc:
 setting standby to 0 (off)
 HDIO_DRIVE_CMD(setidle1) failed: Invalid argument

I decided to keep the drive alive via cron.
Code: [Select]
$ mkdir -p /etc/e-smith/templates-custom/etc/crontab/
$ vi 26usb-drive
# Keep the USB drive from going into standby.
50 21 * * * root mount /dev/sdc1 /media/BackupDrive1/
55 21 * * * root umount /media/BackupDrive1/

That seems to have worked. Although, I really prefer the nas/cifs solution.