Waking Up USB External Hard Drive for file archiving


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Waking Up USB External Hard Drive for file archiving
# 1  
Old 12-15-2014
Waking Up USB External Hard Drive for file archiving

Hello Experts,

I hope I'm writing to the correct category for my question.

I have a very basic shell script for doing file archiving to the external usb hard drive (WD studio edition II 2TB formatted as FAT32 for compatibility). The shell script only needs to run once per day. It basically downloads some data from a server and converts it to a different format files then makes separate folders for every day on the external disk then copies the converted files to those folders. The problem is drive goes to sleep when idle and I cannot wake it up with normal commands such as "ls" or "cd /media/DISK" or "mkdir -p /media/DISK/somefolder" etc. mkdir command gives input/output error.

If I run "fdisk -l" command as root then the drive starts to spin and I can run the script successfully. But this is not ideal since I would like to put this script to a cronjob and let it run once per day.

Do you have any advice for waking up the disk before running the script?

Best regards

Edit: OS: Centos 5.8 64 bit
# 2  
Old 12-15-2014
What's wrong with using fdisk -l to start the disk spinning? Should it be permissions, any command to make the kernel interact with the disk will need them.
# 3  
Old 12-15-2014
So there is no way to wake the disk without root permission?
It seems I have to put the fdisk command into my script then find a way to run it as root without asking root password...which I don't know how.
# 4  
Old 12-15-2014
Either create a sudoers entry for your cron user, or run a root's cron job a minute before your other job.
This User Gave Thanks to RudiC For This Post:
# 5  
Old 12-15-2014
It wont ask root its passwd if the cronjob is root's... it should be in root's crontab...
This User Gave Thanks to vbe For This Post:
# 6  
Old 12-16-2014
Yes using root's crontab sounds good. I'll try that thank you

---------- Post updated 16-12-14 at 10:27 ---------- Previous update was 15-12-14 at 14:36 ----------

I have tried the root's crontab and it executed the command successfully; however, external disk is not waking up. Then I ran fdisk -l manually, that also didn't worked. So do you have any method that will wake up the disk everytime?
# 7  
Old 12-16-2014
OS: Centos 6.6 64bit

You could try command cd-info to wake up the drive. It is provided by libcdio-0.81-3.1.el6
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

External hard drive

I have connected an external hard drive. I can't find it. Both ls /media, fdisk -l and ls /dev show nothing. TIA (3 Replies)
Discussion started by: Meow613
3 Replies

2. Red Hat

Usb external drive

Hi Guys I am using RHEL5 O/S. We have mounted the usb external hard drive to the server as root. I want the user oracle to be able to write into this external hard drive. How do i do that ? Please Help!!! (1 Reply)
Discussion started by: Phuti
1 Replies

3. Hardware

Flapping (reconnecting) external USB drive

Hi gurus, during playing movie via VLC or SMPlayer I get several time the error that file cannot be read. File was stored on external USB disk. During this error I get another dialogue message that says the new removable disk was connected..., just as if power goes off and on again or if I power on... (1 Reply)
Discussion started by: wakatana
1 Replies

4. UNIX for Advanced & Expert Users

script to automatically mount external usb hard disk

hi all, I have a debian lenny 5.0 server without GNOME installed. the server is at a customer's premise. I want to backup data from the server to the external usb hard disk. the backup will start at e.g 01:00 everyday. the user will plug the drive before going home. also the user will... (1 Reply)
Discussion started by: coolatt
1 Replies

5. Solaris

USB External Hard Drive for Solaris 10 Sparc

Hi- I would like to know if anyone has used any USB External Hard Drive, about 500/750GB or 1TB, with any of the Solaris 10 "SPARC" systems. Not on intel nor amd platform. I'm looking for the compatible drive and found a few listed on Sun solaris ready page, but I'd like to have inputs from... (3 Replies)
Discussion started by: agfa_109
3 Replies

6. Filesystems, Disks and Memory

external USb hard disk reading problem

Hello, I am facing a hard disk drive reading problem since last one month and not able to resolve it. The thing is I purchased external USB hard disk (seagate 40 gb) 2 years back.And uptil now its working perfectly fine. But suddenly one day I am not able to read my data. The problem goes like... (1 Reply)
Discussion started by: albertspade
1 Replies

7. UNIX for Dummies Questions & Answers

External SCSI hard drive

Someone gave me a small external SCSI hard drive for my SunOS 5.8 test system. How do I make Unix see the hard drive? (2 Replies)
Discussion started by: FredSmith
2 Replies

8. Solaris

FAT32 usb external hard drive - how to mount??

Hello ! What is the comand to mount and usb hard disk ? I have Solaris 10 installed! 10nx! (1 Reply)
Discussion started by: daniel.balasa
1 Replies

9. UNIX for Dummies Questions & Answers

mount external usb drive on Redhat 9

I am using Redhat 9 Linux, and am trying to get my external usb drive mounted (fat32). If I look at the KDE Control panel, it lists a usb 2.0 storage device under "USB Devices" (also in /proc/bus/usb), and under "SCSI" as scsi1. I looked at /proc/scsi/usb-storage-0, and it lists it there also. What... (6 Replies)
Discussion started by: jeremiebarber
6 Replies

10. Filesystems, Disks and Memory

External Lacie USB hard disks

I'm trying to mount a USB Lacie external hardrive in my Linux system but am having trouble doing so, I'm also having trouble mounting my USB ZIP 250 drive. It is totally me being stupid, but I'm new to unix and am having a few teathing problems. the command I'm using is the following mount... (4 Replies)
Discussion started by: electrode101
4 Replies
Login or Register to Ask a Question