Description of problem: Since moving from Fedora 10 to Fedora 11, I can no longer spin down my external USB drive with sg_start --stop. This means I can't disconnect the drive without it making a painful squeaking sound, which I'm sure isn't good for it. Version-Release number of selected component (if applicable): sg3_utils-1.26-4.fc11.i586 How reproducible: Every time Steps to Reproduce: 1. Plug in external USB drive 2. Type sg_start --stop /dev/sdb1 3. Actual results: Drive momentarily spins down and then immediately spins up again Expected results: Drive spins down and doesn't spin up again Additional info: Model of USB drive is Freecom Mobile Drive 120 GB (Samsung HM120JC)
There is no change in sg_start between Fedora 10 and 11. As you write the drive is spined down and then spins up again, I would expect sg_start works, but something else is causing the spin up (kernel?). Are all partitions from the drive unmounted before running sg_start? Are you running it from a graphical desktop environment or console?
(In reply to comment #1) > There is no change in sg_start between Fedora 10 and 11. As you write the drive > is spined down and then spins up again, I would expect sg_start works, but > something else is causing the spin up (kernel?). Yes, I think you are right. > Are all partitions from the > drive unmounted before running sg_start? Yes > Are you running it from a graphical > desktop environment or console? I get the same problem in both the graphical environment and from the console.
So now we should try to find the right component for this bug report. Next step could be to boot the system in single user mode - either boot with 1 or S appended on the "kernel" line in grub or run "telinit 1" from console, and try again. It's also possible to stop almost all running daemons (with "service foo stop" or by killing them). When nothing will run (besides udevd) and the device will be powering up then it should be kernel's fault. Otherwise it will be some of the stopped user space components.
(In reply to comment #3) > So now we should try to find the right component for this bug report. Next step > could be to boot the system in single user mode - either boot with 1 or S > appended on the "kernel" line in grub or run "telinit 1" from console, and try > again. Thanks for that suggestion. I booted into single user mode, repeated the sg_start instruction as before and the drive behaves in the same way ie spins down and immediately up again. So if I understand comment#3 correctly, we can file this as a kernel bug. kernel version is kernel-PAE-2.6.30.10-105.fc11.i686, although I've seen the same behaviour with kernel-PAE-2.6.29.4-167.fc11.i686
I think bug #561876 tries to solve same issue with different utility.
Thanks for pointing that out. Using that information I've created a patch for sg_start.
Created attachment 389195 [details] Patch to sg_start to open the device readonly for --stop Limited testing: sg_start --stop now spins the drive down and it doesn't spin up again. sg_start --start spins the drive up again.
sg_start in sg3_utils 1.29 (available in rawhide) adds a new option --readonly to workaround the difference between ATA and SCSI devices. See bug #561876 for more details.