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
10 More Discussions You Might Find Interesting
1. Filesystems, Disks and Memory
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
2. UNIX for Dummies Questions & Answers
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
3. Solaris
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
4. UNIX for Dummies Questions & Answers
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
5. Filesystems, Disks and Memory
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
6. Solaris
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
7. UNIX for Advanced & Expert Users
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
8. Hardware
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
9. Red Hat
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
10. UNIX for Advanced & Expert Users
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
CFDISK(8) GNU fdisk Manual CFDISK(8)
NAME
GNU fdisk, lfdisk, gfdisk - manipulate partition tables on a hard drive
SYNOPSIS
fdisk [options] [device]
DESCRIPTION
fdisk is a disk partition manipulation program, which allows you to create, destroy, resize, move and copy partitions on a hard drive using
a menu-driven interface. It is useful for organising the disk space on a new drive, reorganising an old drive, creating space for new oper-
ating systems, and copying data to new hard disks. For a list of the supported partition types, see the --list-partition-types option
below.
It comes in two variants, gfdisk and lfdisk. Lfdisk aims to resemble Linux fdisk 2.12, while gfdisk supports more advanced disk operations,
like resizing the filesystem, moving and copying partitions. When starting fdisk, the default is to run gfdisk.
OPTIONS
-h, --help
displays a help message.
-v, --version
displays the program's version.
-L, --linux-fdisk
turns on Linux fdisk compatibility mode. This is the same as running lfdisk.
-G, --gnu-fdisk
turns off Linux fdisk compatibility mode.
-i, --interactive
where necessary, prompts for user intervention.
-p, --script
never prompts for user intervention.
-l, --list
lists the partition table on the specified device and exits. If there is no device specified, lists the partition tables on all
detected devices.
-r, --raw-list
displays a hex dump of the partition table of the disk, similar to the way Linux fdisk displays the raw data in the partition table.
-u, --sector-units
use sectors, instead of cylinders for a default unit.
-s, --size=DEVICE
prints the size of the partition on DEVICE is printed on the standard output.
-t, --list-partition-types
displays a list of supported partition types and features.
The following options are available only to lfdisk.
-b, --sector-size=SIZE
Specify the sector size of the disk. Valid values are 512, 1024 and 2048. Should be used only on older kernels, which don't guess
the correct sector size.
-C, --cylinders=CYLINDERS
Specify the number of cylinders of the disk. Currently does nothing, it is left for Linux fdisk compatibility.
-H, --heads=HEADS
Specify the number of heads of the disk. Reasonable values are 255 or 16.
-S, --sectors=SECTORS
Specify the number of sectors per track. A reasonable value is 63.
BUGS
Before editing a BSD disklabel, the partition with the disklabel should already exist on the disk and be detected by the OS. If you have
created a BSD-type partition, you need to write the changes to the disk. If fdisk fails to notify the OS about the changes in partition ta-
ble, you need to restart your computer. As fdisk tries to guess the device holding the BSD disklabel, it might fail to edit it at all, even
if the OS has detected it. In this case you are adviced to simply open the device with fdisk directly. It is possible that it doesn't work
on some operating systems.
Getting the size of a partition with -s might fail, if fdisk fails to guess the disk device, for the same reasons as with the previous bug.
SEE ALSO
mkfs(8), cfdisk(8), parted(8) The fdisk program is fully documented in the info(1) format GNU fdisk User Manual manual.
fdisk 18 August, 2006 CFDISK(8)