Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

A fresh install of Debian 6.0.6 for a system has 13 SATA drives attached. 12 refurbished WD-10EARS drives are yet unpartitioned. 1 WD1500BLFS drive is configured for OS and swap. Swap partition is configured on /dev/sda5 according /etc/fstab

root@debian:~# cat /etc/fstab | grep swap
# swap was on /dev/sda5 during installation
UUID=641cc8ad-838d-4e92-8c2c-0b73359a5aa3 none            swap    sw              0       0

Because the 12 drives have no disk activity, the drive state goes from "active/idle" to "standby" after a while.

root@debian:~# hdparm -C /dev/sdm

 drive state is:  active/idle

root@debian:~# hdparm -C /dev/sdm

 drive state is:  standby

When issueing a reboot command the console shows "Deactivating swap..." and then staggered all 12 drives start to spinup as verified by sound and power consumption. Having a drive state change from standby to active can take up to 30 seconds. In other words a reboot now takes between 3 and 7 minutes. How long would a reboot take when 70 drives are attached!

Update #1 The issue is related to "sd" (storage device) that wishes to "Synchronizing SCSI cache" on each drive.

How to stop changing all drives its state from "standby" to "active" on reboot (most likely caused by the "deactivating swap" process)?

# uname -mrsn
Linux debian 2.6.32-5-amd64 x86_64
share|improve this question
30 seconds for a drive to spin up? I knew the consumer-grade "green" drives were bad, but I guess I had no idea. –  jordanm Nov 9 '12 at 14:53
I don't believe that the deactivation of swap causes this. You can test that by issuing swapoff <partition> while the system is running. –  Bonsi Scott Nov 9 '12 at 15:53
After deactivating swap with swapoff -a -v (swapoff /dev/sda5 fails with "swapoff failed: Invalid argument") there is still a message "Deactivating swap..." on reboot and all drives still spinup. –  Pro Backup Nov 9 '12 at 18:33
After a second reboot, the "Deactivating swap... Done" message is instantaneous. Also sleeping drives using hdparm is immediate instead of having a multi second delay. –  Pro Backup Nov 9 '12 at 18:43
The third reboot gives a "hanging" Deactivating swap... message. Later on followed by many errors like "end_request I/O error, dev sdb, sector {0, 8, 16, 128, 4096}". And also for sd{c,d,e,f,g,h,i,...} –  Pro Backup Nov 9 '12 at 18:46
show 5 more comments

1 Answer

up vote 1 down vote accepted

After changing to backports kernel 3.2.0-0.bpo.3-amd64 there is no longer a wake of all drives between issuing reboot and message Will now restart. appears, with or without swap being enabled.

Note that the console "end_request I/O error, dev sdb, sector {0, 8, 16, 128, 4096}" error messages are still there when the drives are in standby state.

Update #1

The "Synchronizing SCSI cache before rebooting" issue re-appears in 3.2.0-0.bpo.4-amd64. Although both seem to share the same version of the mpt2sas module:

# modinfo /lib/modules/3.2.0-0.bpo.{3,4}-amd64/kernel/drivers/scsi/mpt2sas/mpt2sas.ko | grep ^version

Update #2

The issue doesn't seem to be kernel and storage module related. After changing back to kernel 2.6.32-5-amd64, setting all drives to standby, and commanding a reboot, there were no "Synchronizing SCSI cache", no drive spin ups, and therefore no delays.

Update #3

When turning off write cache hdparm -W0 /dev/sd? and flushing the write cache with sync && sdparm --command=sync /dev/sd? && sleep 1 and finally setting the drive to standby using hdparm -y /dev/sd? then there is no "Synchronizing SCSI cache" for every drive after running reboot and seeing output "Mounting root filesystem read-only...done." and "Will now restart." when using:

  1. Linux debian 2.6.32-5-amd64 #1 SMP Sun Sep 23 10:07:46 UTC 2012 x86_64
  2. Linux debian 3.2.0-0.bpo.3-amd64 #1 SMP Thu Aug 23 07:41:30 UTC 2012 x86_64

Kernel 3.2.0-0.bpo.4-amd64 is faulty and does "Synchronizing SCSI cache" for every drive on every reboot.

share|improve this answer
Due to drive renumbering (/dev/sda became /dev/sdi) I needed to use swapoff -v -a for a consistent halt where drives will not be taken out of their standby state. –  Pro Backup Nov 11 '12 at 12:42
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.