bbobbo
2007-05-18, 09:25 AM CDT
i have a a 500gb seagate freeagent desktop usb drive which i connected to my fc4 x86_64 server. i used fdisk to delete the ntfs partition and created a single linux partition and formatted it for ext3. the drive is temporarily serving as a /home partition for the server; / and /root are installed on a different system drive.
i started getting i/o problems and saw that the drive got remounted read-only. after googling for solutions, i discovered that the problem was that the drive automatically spins down after 15 minutes. when you try to access the drive after it has spun down, you get i/o errors and then the partition gets remounted read-only:
http://www.nslu2-linux.org/wiki/FAQ/DealWithAutoSpinDownOnSeagateFreeAgent
i tried to implement the solution mentioned, which is:
echo 1 >/sys/class/scsi_disk/0:0:0:0/allow_restart
in my case, the drive is 2:0:0:0. however, when i try to issue the command (yes, i'm logged in as root), i get permission denied:
# echo 1 > /sys/class/scsi_disk/2\:0\:0\:0/allow_restart
-bash: /sys/class/scsi_disk/2:0:0:0/allow_restart: Permission denied
so i have two questions:
1) why am i getting a "permission denied"?
2) while i'm waiting for a solution for 1), i thought i would be clever and create a cron job that would constantly access the drive to keep it from sleeping. first i tried:
*/12 * * * * ls /home > /dev/null 2>&1
that didn't work (drive eventually went into i/o errors). i thought maybe the result was cached so the drive didn't actually have to spin up. so then i tried:
*/12 * * * * date > /home/date.txt 2>&1
that didn't work either. maybe the time-out isn't 15 minutes?
*/1 * * * * date > /home/date.txt 2>&1
still no luck. maybe a larger file needs to be written?
*/1 * * * * dd if=/dev/urandom of=/home/random.txt bs=1K count=1024 > /dev/null 2>&1
nope. maybe the filename needs to be random?
*/1 * * * * dd if=/dev/urandom of=/home/random/random.$RANDOM bs=1K count=1024 > /dev/null 2>&1
0 * * * * rm -f /home/random/* > /dev/null 2>&1
still no luck!?! what's going on? why is the drive still sleeping? why wouldn't my cron jobs reset the spin-down timer?
i know if i do some other kind of file operation that takes a long time (say do a large copy operation either from another drive on the server or over the network, or run some other script that is constantly generating a large number of files), the drive doesn't spin down. i don't know why my cron jobs won't keep the drive awake. any ideas?
i started getting i/o problems and saw that the drive got remounted read-only. after googling for solutions, i discovered that the problem was that the drive automatically spins down after 15 minutes. when you try to access the drive after it has spun down, you get i/o errors and then the partition gets remounted read-only:
http://www.nslu2-linux.org/wiki/FAQ/DealWithAutoSpinDownOnSeagateFreeAgent
i tried to implement the solution mentioned, which is:
echo 1 >/sys/class/scsi_disk/0:0:0:0/allow_restart
in my case, the drive is 2:0:0:0. however, when i try to issue the command (yes, i'm logged in as root), i get permission denied:
# echo 1 > /sys/class/scsi_disk/2\:0\:0\:0/allow_restart
-bash: /sys/class/scsi_disk/2:0:0:0/allow_restart: Permission denied
so i have two questions:
1) why am i getting a "permission denied"?
2) while i'm waiting for a solution for 1), i thought i would be clever and create a cron job that would constantly access the drive to keep it from sleeping. first i tried:
*/12 * * * * ls /home > /dev/null 2>&1
that didn't work (drive eventually went into i/o errors). i thought maybe the result was cached so the drive didn't actually have to spin up. so then i tried:
*/12 * * * * date > /home/date.txt 2>&1
that didn't work either. maybe the time-out isn't 15 minutes?
*/1 * * * * date > /home/date.txt 2>&1
still no luck. maybe a larger file needs to be written?
*/1 * * * * dd if=/dev/urandom of=/home/random.txt bs=1K count=1024 > /dev/null 2>&1
nope. maybe the filename needs to be random?
*/1 * * * * dd if=/dev/urandom of=/home/random/random.$RANDOM bs=1K count=1024 > /dev/null 2>&1
0 * * * * rm -f /home/random/* > /dev/null 2>&1
still no luck!?! what's going on? why is the drive still sleeping? why wouldn't my cron jobs reset the spin-down timer?
i know if i do some other kind of file operation that takes a long time (say do a large copy operation either from another drive on the server or over the network, or run some other script that is constantly generating a large number of files), the drive doesn't spin down. i don't know why my cron jobs won't keep the drive awake. any ideas?