WD external drives need to be spun down, "sdparm --command=stop" doesn't work any more

Bug #117713 reported by Clément Léger
160
This bug affects 24 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Expired
Low
Unassigned
Nominated for Dapper by JDawg108
Nominated for Hardy by JDawg108
Nominated for Intrepid by JDawg108
Nominated for Jaunty by JDawg108
Nominated for Karmic by JDawg108
Nominated for Lucid by JDawg108

Bug Description

Try to dismount a USB external Western digital passport harddrive , it will be ok but the cylinders will be still rotating , then if you unplug your hardrrive it'll do a strange noise like a violent hard drive parking. ( in Microsoft windows the eject the device safely option stop the heads ) at the moment the only solution to stop properly the hard drive is tu use sdparm , here is the script :

#!/bin/sh
WD=/dev/sdb1
sudo umount $WD
if [ $? -eq 0 ]
then
 echo Stopping heads
        #Stop properly the heads and cylinders
 sdparm --command=stop $WD
else
 echo Unmount Failed !
fi

Revision history for this message
Dave Rosky (d-rosky) wrote :

I have noticed this problem too (OS=Mint Cassandra (feisty)). I have ALSO noticed the following, which is more troubling:

When I first bought the Passport (160GB model), I tried copying some large AVI files to it, If the drive is unmounted, unplugged, and then re-plugged and mounted, the AVI files are sometimes either not there, or are corrupt. If, however, the drive is unmounted and then re-mounted BEFORE unplugging, then the files appear fine, it's as if the re-mount was required to sync the drive. This occurs regardless of whether the partition on the Passport is VFAT or EXT3. The same problem occurs with deleting the large AVI's -- If the drive is unmounted and unplugged, re-plugged and re-mounted, most often the file re-appears, however, if the drive is re-mounted BEFORE unplugging and then unmounted again, all is OK.

I tried manually syncing the drive before umounting, but this doesn't solve the problem. The only workaround so far for me has been to unmount-remount-unmount the drive before unplugging.

It appears that somehow this drive is not syncing properly when unmounted.

I haven't noticed this on other removable drives so far,

Revision history for this message
Clément Léger (clem-vangelis) wrote :

i actually didn't notice this problem and i always unmount my hardrive using this script: ( of course change /dev/sdb1 by your harddrive )

#!/bin/sh
pumount /dev/sdb1
#wait for mtab to be updated
sleep 3
#we search an occurency of our harddrive in mtab
UMOUNT=`grep '/dev/sdb1' /etc/mtab | wc -c`
if [ $UMOUNT -eq 0 ]
then
   #we sync the harddrive
   sdparm --command=sync /dev/sdb1
   #we can spindown the hardrive
   sdparm --command=stop /dev/sdb1
   zenity --info --title="Info" --text="You can unplug your Hardrive !"
else
   zenity --error --title="Info" --text="It seems your harddrive isn't unmounted , unmount it then try again"
fi

you can modify it by adding this at the start :
#unmount
pumount /dev/sdb1
#mount
pmount /dev/sdb1
#unmount
pumount /dev/sdb1

 it use pmount , sdparm and zenity ( sudo aptitude install pmount zenity sdparm ) then simply make it executable and launch it

Revision history for this message
Dave Rosky (d-rosky) wrote :

Apparently, either using your method (syncing and stopping the drive), or doing what I did (unmounting-remounting-unmounting) causes the drive to be properly sync'd, whereas just unmounting or syncing and unmounting does not.

In any case, there seems to be a bug in the driver where this particular drive is not handled correctly when unmounting. Maybe there are buffers internal to the drive that aren't flushed until the drive is either stopped or re-accessed. Perhaps the umount command should stop all external drives after unmounting them.

Revision history for this message
Clément Léger (clem-vangelis) wrote :

that's really strange 'cause i have exactly the same hardrive ( western digital passport II 160G ) and i don't have this kind of problem, i copied a lot of avis on it and no one of them has disapearred after unmounting it . anyway in a "normal" shutdown for this disk it have to park head and stop cylinders and actually this is not the case , i think this issue could be dangerous for the harddrive itself , i hope devs will have a look at this bug.

Revision history for this message
Dave Rosky (d-rosky) wrote :

Sorry, I think I didn't explain my thought clearly. I think the only time there is missing data is if the drive is unmounted and unplugged without either doing the head parking OR doing the unmount-remount-unmount. It appears that *either* of these works. What doesn't seem to work is just unmounting and unplugging, at least for me.

I'm wondering if this is the right place for this bug. It seems like this bug is not assigned to anybody, nor has any developer responded to it. My son uses a different Linux distro (Arch) and he has verified the problem there as well, so it appears to be an upstream problem, possibly in the kernel or the mount/unmount utilities.

Revision history for this message
Clément Léger (clem-vangelis) wrote :

yes i think it's not only an ubuntu problem, maybe we have to report it on another bugtracker ? ( umount ? linux-kernel ? )

Revision history for this message
Dave Rosky (d-rosky) wrote :

Yes, I would suspect it is either a kernel issue or in the mount/umount tools.

In the mean time, since I believe your spin-down method works as well as unmount-mount-unmount and also leaves the drive spun down, I have modified your script a bit to automatically determine from /etc/mtab which physical device has been assigned to the drive. This is because I sometimes have other things like card readers plugged in and cannot be sure that the passport will always be at the same /dev/sdxxx location every time. This modified script requires, however, that the mount point always be the same, and since "/media/disk" is the default, I chose "/media/wdp". You can set this in the settings for the drive by right-clicking on the drive icon.

------------------------------

#!/bin/sh
#
# Script to unmount western digital passport drive safely regardless
# of which physical device it has been assigned to. Drive mount
# point must be /media/wdp, which can be specified in the settings for
# the drive.
#
# Original by Clem-Vangelis, modified by D. Rosky, 2007/6/14
#

# See if drive is mounted

CCOUNT=$(grep '/media/wdp' /etc/mtab | wc -c)
if [ $CCOUNT -eq 0 ]
then
 zenity --error --title="Info" --text="No mountpoint /dev/wdb, drive not mounted?"
 exit
fi

#Get the physical device from mtab
DRIVELINE=$(grep '\/media\/wdp' /etc/mtab)
LENG=$(expr match "$DRIVELINE" '[A-Za-z0-9\/]*')
DRIVE_DEVICE=$(expr substr "$DRIVELINE" 1 $LENG)

#Try Unmounting the drive

pumount /media/wdp
sleep 3
CCOUNT=$(grep '/media/wdp' /etc/mtab | wc -c)
if [ $CCOUNT -ne 0 ]
then
 zenity --error --title="Info" --text="Could not unmount /media/wdp, drive may be in use."
 exit
fi

#sync and stop the drive

sdparm --command=sync $DRIVE_DEVICE
sleep 1
sdparm --command=stop $DRIVE_DEVICE
zenity --info --title="Info" --text="Drive can be safely unplugged"

Revision history for this message
bhowse (bhowse) wrote :

I have both the Western Digital Passport 160GB and 120GB external USB harddrives and my problem is slightly different. When I unmount (eject) either drive from the Ubuntu Desktop with right click, the drive appears to unmount (eject) but gives an error message box that says Cannot Eject Volume and the drive immediately remounts and opens up a new window with contents of drive displayed. This cycle repeats ever time I try to unmount (eject) the drive (opening more windows for the drive on each try). This problem does not exist on Fedora Core 5,6 or 7 using these drives - they unmount properly on Fedora using graphical icon and bash shell. If I switch to root using su in the bash shell then umount /media/WD Passport on Ubuntu it seems to work ok and the icon goes away but the same can not be done from the graphical desktop.

My drives make a high pitched whine or chirp from high frequency to low over about a one second period when physically unplugging drives under both Fedora and Ubuntu, so I think that is normal. I've never heard the clunking head docking sound described earlier. I have not lost any data and often transfer large 2GByte AVI files to an from the drives. I have Ubuntu 7 recenty downloaded since 7 was released.

I am a new user to Ubuntu and don't know how to submit bugs. I can provide more diagnostics or testing to who ever this information is useful for to fix the problem. I basically have the bash shell method working but wonder why the graphical unmount (eject) is flawed in Ubuntu. Is there user editable shell code behind the right click graphical icon method to add the correct shell commands?

Revision history for this message
bhowse (bhowse) wrote :

Ok, I am definitely losing data when using the simple bash commands su umount /media/WD from the shell. I'll try experimenting with the scripts above and see if I can rectify this lost data situation on Ubuntu with the Western Digital Passport External Hard Drives. By default, installing Ubuntu did not have sdparm installed but I found it online and installed it. From what I've read, I also have to add users to the plugdev group to use the pumount command. If anyone knows how to repair the right click graphical icon eject feature for Ubuntu's Graphical Display Manager (GDM) that information would be appreciated.

Thanks.

Revision history for this message
Clément Léger (clem-vangelis) wrote :

Bug is still present under Hardy alpha 5
could be fine if someone could fix it, seems to be hazardous for hardware...

Revision history for this message
morgengenuss (morgengenuss) wrote :

i am on ubuntu 7.10 and have a wd passport 120gb (so still the first generation of wdp) as well and noticed this annoying bug quite a while ago; still i wasn't aware of this bugreport. i would very much appreciate a fix or even a patch for this bug - the workaround-scripts are quite a nuisance. (especially when you think of newbies that use their wd-passport to exchange data from time to time with friends that are on linux too; so they would have to take the script with them wherever they go)
so here's my workaround (just a quite ugly shell-script that uses scsi-spindown which can be found in the package scsitools):

(drawback to this script: the drive has to be mounted for the script to work, otherwise it will not be found via mount; so in case you just plug it in but never mount it this script will not spin down your hdd;)

--------------------------------------------------------

#!/bin/bash
echo " * Looking where WD Passport is hangin' out tonight"
LOCATION=$(mount | grep "WD Passport")

# check whether you actually found WD Passport
if [ ${#LOCATION} != "0" ]
then echo " * Found it at" ${LOCATION:0:9}""
else
 echo "Was unable to find WD Passport - something strange happened. Please consult your Microsoft attendant."
 exit
fi

# in case the user does abort instead of granting superuser rights at least display an error message
echo " * Requesting superuser-rights for the spindown"
if sudo umount ${LOCATION:0:9}
then echo " * Spinning down" ${LOCATION:0:9}
 scsi-spin -d ${LOCATION:0:9}
 echo "WD Passport (aka "${LOCATION:0:9}")is now safe to remove."
else
 echo "An unknown error occured. Please consult your Microsoft attendant."
 exit
fi

Revision history for this message
morgengenuss (morgengenuss) wrote :

ok, actually i found a more elegant way of dealing with this issue (which might be great especially for newbies). first create a udev-rule to have your wd-passport node is created at the same spot (in my case it's /dev/wdpassport) every time you plug it in and also so that a script is executed which puts a tray-icon in place with which you can spin-down your wdpassport.

here's my udev rule (simply replace ATTRS{model} with whatever fits your wdpassport)

/etc/udev/rules.d/95-wdpassport.rules
----------------------------------------------------
KERNEL=="sd?1",SUBSYSTEMS=="scsi", ATTRS{model}=="1200BEVExternal ",SYMLINK+="wdpassport", RUN+="/usr/local/bin/wdp"

and here's the script

/usr/local/bin/wdp
----------------------------------------------------
#!/bin/bash
# Put a notification-icon into the system tray
if DISPLAY=:0. sudo -H -u insert_your_username_here! zenity --notification --window-icon=/usr/share/pixmaps/wdumount.png --text="WD Passport is currently plugged in." ; then
echo "the icon should be in place now"
else echo "zenity error..." ;
fi

# If you click the icon you're presented the choice of safely removing WD Passport
if DISPLAY=:0. sudo -H -u insert_your_username_here! zenity --question --text "Do you really want to remove WD Passport (/dev/wdpassport)?" ; then
 echo "icon clicked"
  LOCATION=$(mount | grep "WD Passport")
  if [ ${#LOCATION} != "0" ] ; then
   pumount /dev/wdpassport 2> ~/wdp.log
  fi
  if scsi-spin -d /dev/wdpassport 2>> ~/wdp.log ; then
   DISPLAY=:0. sudo -H -u insert_your_username_here! zenity --info --text="Success!\n\nWD Passport can be safely removed now."
     exit;
  else
  ERRORS=$(cat ~/wdp.log)
    DISPLAY=:0. sudo -H -u insert_your_username_here! zenity --warning --text="$ERRORS\n\nSorry, it seems things are screwed up badly (or WD Passport is simply not connected anymore)."
      fi
  else echo "cancel button was hit..."
 wdp ;
fi

Revision history for this message
Kirill Belokurov (kirill-belokurov) wrote :

I have created another solution for the KDE - so when you click on 'Safely Remove' context menu item, it will also call scsi-spin, if this is a SCSI removable device. The solution is to patch /usr/bin/kdeeject - I am attaching the patch. Note, that 'Safely Remove' can (and should) be called even for not mounted devices.

Revision history for this message
Kirill Belokurov (kirill-belokurov) wrote :

Attached newer version of patch: we don't need scsitools anymore, as we are using only sdparm for doing sync and stop.

Revision history for this message
Kirill Belokurov (kirill-belokurov) wrote :

Latest version of patch, respects "-q" (quiet) switch. Also removed check for the scsi-spin binary (left from previous patch).

Revision history for this message
morgengenuss (morgengenuss) wrote :

@ kirill: nice patch, although unfortunately i can't use it in xfce. maybe i'll try to do something similar, but first i'd have to find out which binary thunar uses to eject removable media... (if anyone knows, would be glad to hear bout it)

Revision history for this message
morgengenuss (morgengenuss) wrote :

this bug is still present in xubuntu 8.04 using thunar 0.9

Revision history for this message
al2cane (al2cane) wrote :

I tried some of the above steps to spin down the drive before ejecting it, and now when I plug in the drive, it doesn't spin up at all, can't find it in /dev, or do anything with it. The drive works fine on other machines, so it's not the hard drive that's screwed.

Any ideas on how to get it going again?

Revision history for this message
Clément Léger (clem-vangelis) wrote :

if you are using hardy you need to be root to use sdparm : sudo "sdparm ..." or gksu "sdparm ..."

Revision history for this message
al2cane (al2cane) wrote :

I booted into a live windows cd, and a live ubuntu CD, and neither of them can see the drive either. dmesg | tail shows nothing when I plug in or out the drive.

But the drive still works on other PCs.

Revision history for this message
Damien G.E. (vauss) wrote :

I may confirm too I have this kind of bug in Xubuntu 8.04 using Thunar 0.9 with my USB external HD "WD Passport".

Revision history for this message
Clément Léger (clem-vangelis) wrote :

problem still present under intrepid ibex...

Revision history for this message
morgengenuss (morgengenuss) wrote :

true.

i just wanted to add that i recently dissembled the harddrive (well, i took it out of its case) and attached a different sata-usb interface and guess what: the harddrive could be properly unmounted and unplugged without the noise.
so in case you're not afraid of breaking that shabby plastic cover of your wd passport, just go out and buy a new interface for a few bucks (and maybe even an aluminium cover for a few more, might protect it better).

Revision history for this message
Sebastien Bacher (seb128) wrote :

the issue doesn't seem to a gnome-mount one, gnome-mount is just the tool used by GNOME to do the mounting and the comments suggest the command line mount does the same

Changed in gnome-mount:
importance: Undecided → Low
Revision history for this message
Akos Ladanyi (akos-ladanyi) wrote :

I've read it somewhere that this is a kernel driver issue (comment 23 also suggests this). Maybe the usb/sata chip used in these WD devices has some bug which is workarounded by the Windows driver? Maybe someone from the kernel team should take a look at this. Also if someone here was brave enough to disassemble the case, could you please share with us what make and type the usb/sata chip is?

Revision history for this message
morgengenuss (morgengenuss) wrote :

i'm very sorry to say but since a friend of mine accidentally dropped the harddrive and it was broken i decided to trash both the harddrive and the case... obviously the usb/sata-interface was part of that.

@gnome-mount: as far as i can remember this bug also occured when using the command-line mount/umount.
and i think i never mentioned this before, but funnily enough this bug also occured in windows vista (but not in xp).

Revision history for this message
Greg Bognar (greg-bognar) wrote :

I've been using the script above in comment 7 (https://bugs.launchpad.net/ubuntu/+bug/117713/comments/7), but I decided to put an encrypted filesystem on it using the directions here:
https://help.ubuntu.com/community/EncryptedFilesystemsOnRemovableStorage

However, the sdparm commands do not work any more. I get the error message
open error: /dev/mapper/luks [read/write]: No such file or directory

sdparm expects a device name like /dev/sdb1; this is what the script reads out from /etc/mtab. But the encrypted filesystem's entry is something like /dev/mapper/luks[...], and that cannot be given as an argument to sdparm. So is there any file from which the device name can be read off in order to modify the script?

Revision history for this message
Anton Yakutovich (dr-akulavich) wrote :

I have the same problem with sdparm after upgrade to Jaunty (my storage is Transcend StoreJet). Command "sdparm -C stop /dev/sdb1" doesn't work properly.

Revision history for this message
svd (le8) wrote :

sdparm commands:

sudo sdparm --command=sync /dev/sdXY
sudo sdparm --command=stop /dev/sdXY

...fail to stop external drive (despite exit codes equal to zero) after upgrade to Jaunty (in Intrepid they work ok). My drive is WD Passport.

It seems now we (owners of external drives) are deprived of any capability/workaround to stop our drives properly.

Revision history for this message
Akos Ladanyi (akos-ladanyi) wrote :

I can confirm this. The 'stop' command seems to spin down the platters, but only for a second and then they spin up again.

Revision history for this message
Akos Ladanyi (akos-ladanyi) wrote :

Is here anybody who has this problem with an external hard drive that is _not_ a WD Passport? Could these people please confirm if this bug affects them or not?

Revision history for this message
svd (le8) wrote :

@Akos Ladanyi
*Transcend StoreJet* is not being stopped properly too (see Anton's comment above: https://bugs.launchpad.net/ubuntu/+bug/117713/comments/28)

Revision history for this message
Anton Yakutovich (dr-akulavich) wrote :

@Akos Ladanyi

Yes, this bug isn't WD specific.

Revision history for this message
svd (le8) wrote :

Do we need to raise another bug report dedicated specifically to this problem (sdparm commands don't stop external drive)?
There is 2 reports which mention this problem in discussion but they (reports) are indirect (don't dedicated specifically to this problem): this report and https://answers.launchpad.net/ejecter/+question/63177.

There is only one bug report about sdparm related things here: https://launchpad.net/ubuntu/+source/sdparm/+bugs (but it is not related to our problem)..

Revision history for this message
nursoda (olav-seyfarth) wrote :

@Akos Ladanyi

This bug is not specific to (WD external drives|external drives|Ubuntu) - I have the same effect with vanilla debian sid with an internal Hitachi SATA drive. Looks like a kernel bug to me.

Revision history for this message
Akos Ladanyi (akos-ladanyi) wrote :

I've tested this new issue in single user mode (without hal and everything else running) and it works as it should, i.e. 'stop' really spins down the platters. So this does not seem to be a kernel bug.

Revision history for this message
nursoda (olav-seyfarth) wrote :

SHORT VERSION: udev daemon to be blamed?!
__________________________________________

LONG VERSION:

@Akos Ladanyi: very true, sorry, I forgot to test "init 1" prior to blaming the kernel.
Works for me too in single user mode.

BTW: I see no errors related to issuing the SCSI stop command in the logs, nor when using the commands' --verbose options, neither when it works nor when it doesn't. Tried with sdparm, scsi-spin (always gives timeout after 8 sec and resets SCSI card since the disc takes 12 sec to spin up) and sg_start. They all issue the same 1b command...

So I rebooted and after loggin in (at runlevel 2) I manually stopped all services (except sshd) and issued "sdparm -C stop /dev/sdb" again: works fine! (I always test standby using the command "smartctl --all --nocheck standby --device=3ware,3 /dev/twa0")

Now I started udev daemon "/etc/init.d/udev start", and that alone spun up the disc! (Can anyone confirm this?) And: "sdparm -C stop /dev/sdb" and "smartctl --all --nocheck standby --device=3ware,3 /dev/twa0" don't work any more. So It looks like a problem with udev!?

In /var/log/messages I get "udev: deprecated sysfs layout; update the kernel or disable CONFIG_SYSFS_DEPRECATED; some udev features will not work correctly" after starting it. From /usr/share/doc/udev/changelog.Debian.gz I see that there have been major changes including SCSI issues when intruducing new upstream in Version 140.
___

But strangely if I
- switch off computer
- wait :-)
- switch it on again (boots to runlevel 2 w/o GUI)
- log in as root
- "sdparm -C stop /dev/sdb" results in the bug described earlier
- issue "init 1"
- press Ctrl-D (without entering single user mode) to resume normal operation
- log in as root again
- "sdparm -C stop /dev/sdb" now works as expected, too! Although udev is up and running.

?????????????

The only odd thin I noticed is that 4 lines before the single user root password prompt appears, there was an error "outside expected code flow".

Revision history for this message
nursoda (olav-seyfarth) wrote :

I think this bug needs to be split into two, one that focusses on the usability issue to have some eject mechanism to properly spin down external drives, and one that focusses on the udev/sdparm no longer work issue.

summary: - not proper dismounting for WD passport harddrive (making noise when
- unplug)
+ WD external drives need to be spun down, "sdparm --command=stop" doesn't
+ work any more
Revision history for this message
svd (le8) wrote :

Any news when spin down problem will be fixed? This keeps me stuck with Intrepid.
Why priority of this bug is low? WEAR of inner moving parts of external drive is in place if unplugging it without spinning down, no?

Revision history for this message
Peter (peterroots) wrote :

I have had the same problem which I solved in earlier versions of Kubuntu using the following script
#!/bin/bash
# exec >/dev/null 2>&1
exec 2>&1
pumount $1 || umount $1
sdparm --command=sync $1
sdparm --command=stop $1

This worked fine until I moved to Jaunty and now it no longer works - sdparm seems to do nothing although there is a small 'blip' when the stop command is executed so maybe, as others mentioned, the drive does stop and then restarts again.
I am using a WD drive (maybe as passport, I bought it some time ago and it just has WD printed on it). There are a couple of ext3 partitions only on it.
This has been a long standing issue and it is worrying that it may result in hardware damage and/or data loss but it is only set at a low priority.
Please raise the priority of this issue
Thanks

25 comments hidden view all 105 comments
Revision history for this message
memartin (memartin) wrote :

I forgot: when I listen closely, it sounds like the drive getting the signal to stop, but then spinning up again instantly.

I remember dealing with an "allow-restart" parameter for a Seagate FreeAgent disk a few weeks ago, that had to be set in /sys via a udev rule to allow the drive to be restarted by the kernel. It otherwise would suspend even during i/o, causing errors.

It seems that allow_restart is set for the usb disk by default now (karmic), however, it does not help to set it from "1" to "0". suspend-usb-device still fails with the same errors.

Revision history for this message
ssergeje (ssergeje) wrote :

@memartin
I have a Samsung HM250JI SATA notebook drive in an external enclosure (ICY BOX IB-290StUS-B) which doesn't spin down by default either.

On Hardy/Intrepid I could use the suspend-usb-device skript, it worked out of the box. So did a manual sdparm --command=stop. I could hear the drive spin down when I put my ear to it.

Now I'm using Kubuntu Karmic and both the sdparm command and the skript (as a logical consequence it seems) stopped working.

did you try using the menu 'safely remove' by right clicking on the drive on your desktop?

Revision history for this message
memartin (memartin) wrote :

@ssergeje: Thanks for the reply. When I safely remove the drive using the device notifier plasmoid or the dolphin function, i hear the drive "doint something", but it doesn't spin down. But it doesn't make that "spindown-and-up-again" noise either liken when I use the script.

When I unplug the disk, it makes that "power-retract" noise, emergency-parking the heads. So it evidently doesn't get spun down using UI tools.

Revision history for this message
Alain Kalker (miki4242) wrote :

Ok, this is what I have found out so far:

Ubuntu Karmic, when using any full desktop install, uses devicekit-disks by default, which is _very_ tightly integrated with udev, D-Bus, devmapper, etc., so it is probably not a very wise idea to go poking around at hardware with sdparm etc., unless you are in single-user mode without any of those services running.

Instead, use the `devkit-disks` command to unmount partitions, detach hard drives, set spindown timeouts etc. from the command line. Please look at `man devkit-disks`, it has an entire section on spinning down disks.

An example pertaining to this bug report:

#Detach (spindown & prepare to safely remove) a disk on /dev/sdb
#First, unmount any mounted partitions
$ devkit-disks --unmount /dev/sdb1
#Then, detach the disk from the system
$ devkit-disks --detach /dev/sdb

None of these commands should need root privileges for disks which the user is allowed to mount/unmount from the desktop.

Revision history for this message
Peter (peterroots) wrote :

Thanks for that - I had not heard of devkit-disks before so did not even know it was on my system.
The gnome-disk-utility (palimpsest) works fine on Kubuntu as well (and can be found searching on palimpsest using synaptic even if it can't in the default, useless package manager - another gripe well and truly covered by others elsewhere!)
Nice to find there is a working alternative to sdparm though, for those who quake at the idea of installing gnome things under kde.

Considering that devkit-disks is, as you say, tightly integrated and installed by default I wonder why it is not apparently called when trying to remove a removable hard drive?
Maybe this bug should be changed to something like 'eject removable hard drive does not use devkit-disks'

Thanks for the enlightenment!

Revision history for this message
memartin (memartin) wrote :

Peter, I second your thought that devkit-disks should be called by the GUI tools that help safely remove external storage devices.

After some quick testing, devkit-disks seems to solve all the problems I've described above. Thanks for the information, Alain!

Cheerz, Martin

Revision history for this message
Alain Kalker (miki4242) wrote :

You're welcome :-)

I found just a minor (packaging, policy?) issue for Kubuntu/Xubuntu etc. users: I don't know if devicekit-disks is officially supported as part of the desktop task.

For Kubuntu at least (which I don't use myself, please verify what I say), only the package 'usb-creator-kde' actually has an (indirect) dependency on the package 'devicekit-disks'. Not a very strong case to make for saying that Kubuntu "supports" DeviceKit, so I think we should make sure that including it in non-Gnome desktops doesn't break anything else.

Kind regards,

Alain

Revision history for this message
clubber (fkramer) wrote :

Hi all,

i followed the recent idea by Peter and spinning down using devkit-disks on the console worked like a charm for me. Nevertheless this is only half way through since i cannot invoke spinning up the disk again. Does anybody have an idea why the disk cannot be awoken by using the devkit-disks again. Btw. disks block file under /dev gets lost while spinning down. Maybe it has something to do with the USB connector.

I appreciate every idea to play around with '-)

Kind regards

Frederik

Revision history for this message
Antti Salminen (antti-salminen) wrote :

I am pretty sure this bug is the same as https://bugs.launchpad.net/ubuntu/+source/sdparm/+bug/444818 although the success reports with the posted scripts in earlier comments are confusing as they should not be working if that is the case. In any case that one should prevent all USB disks from spinning down when issued with the stop command and can be easily fixed by patching sdparm/sg_start to not open the device in read-write mode as I described in that bug's comments.

Revision history for this message
memartin (memartin) wrote :

In case anyone wonders like I did about the whereabouts of devkit-disks in lucid: the package devicekit-disks no longer exists in lucid, the whole thing is now called udisks.

So removing the drive in lucid can accordingly be done via 'udisks --detach /dev/sdX'

HTH

Revision history for this message
Peter (peterroots) wrote :

Thanks for that info.
Yes, I can confirm that you can remove a hard drive, in Kubuntu10.4, using either udisks (as above) or using the gnome disk utility (even further above).

Why oh why does this STILL not happen automatically when you use the normal safe removal option? Kubuntu is a graphical front to Linux that supposedly 'just works' - for something as basic as removing a hard drive you should not have to resort to bash. I wonder how many disks just get pulled out of the usb socket, still spinning, because the save removal has done its bit and a lot of people don't even realise there is a problem.

I notice the bug is still regarded as a low priority - tell that to someone who looses a nice fancy usb hard-drive after the heads bounce all across the surface when they pull the plug on it!

Revision history for this message
Keoni Mahelona (keoni) wrote :

Aloha.

Natty Narwhal is here, and still my USB Harddrive doesn't stop spinning after eject even when it hasn't been used.

Also, it doesn't spin down when the computer is suspended.

Serious usability issue.

Ubuntu 11.04
Lacie Rugged External Drive - USB 2, FIrewire (both types)

Revision history for this message
Peter (peterroots) wrote :

Keoni
I can confirm that safe removal still does not work in Natty but that the Gnome disk utilities (Palimpsest) still does work, if you install it along with the various Gnome dependencies. I agree it is a serious usability issue as
a) should not need to install anything else to do this
b) it should happen from the existing safe removal button
c) this has been going on for years with out a fix!

Peter

Revision history for this message
takilaci (holzmichl) wrote :

I can confirm that safe removal still does not work in Oneiric.

Revision history for this message
Anton Yakutovich (dr-akulavich) wrote :

Yes, me too. Oneiric has the same problem.

Revision history for this message
Peter (peterroots) wrote :

Kubuntu Oneiric
Click the nice little device manager plasmoid and click the remove arrow for an external hard drive (in this case a toshiba) and it very helpfully says you can now safely remove the device.
Still does not spin the drive down though.

udisks does and so does the gnome disk utility (palimpsest)

Gnome disk utility is obviously not installed by default in Kubuntu

Revision history for this message
Rod J (rod-jamieson) wrote :

I couldn't agree more with Peter (comment #76).

This problem still seems to exist in Kubuntu 12.04.

I just bought a Seagate Expansion drive 1 TB and while the little USB device notifier plasmoid dutifully unmounts the drive and reports that it is safe to remove it, the drive is still spinning and no discernable head parking has taken place.

I tried it in Windows XP and it definitely behaves differently ... very noticeable head parking (can be felt more than heard) and then it completely powers down also.

Is nothing being done to fix this? You're expected to carry these little drives from place to place ... it has to be causing premature drive failure by not parking the heads and powering them down in an orderly fashion. I thought the heads might self-park when the USB plug is removed but there is no discernable sound of this happening.

Revision history for this message
Peter (peterroots) wrote :

exactly the same issue with Fedora 17 - udisks works from the command line but palimpsest is not available in yum

Revision history for this message
M4rc05 (m4rc05) wrote :

I have the same problem in Elementary OS (based on ubuntu).

Revision history for this message
penalvch (penalvch) wrote :

Clément Léger, thank you for reporting this bug to Ubuntu. Intrepid reached EOL on April 30, 2010.
See this document for currently supported Ubuntu releases: https://wiki.ubuntu.com/Releases

Is this still and issue in a supported release? If so, could you please execute the following command, as it will automatically gather debugging information, in a terminal:
apport-collect 117713

affects: ubuntu → linux (Ubuntu)
Changed in linux (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Peter (peterroots) wrote :

I am not currently using Kubuntu but Linux Mint 17 - safe removal, using the device notifier (plasma desktop), still does not spin down removable drives. udisks --detach /dev/sdb does still work though
Just installing apport and will run it once done

tags: added: apport-collected qiana
Revision history for this message
Peter (peterroots) wrote : apport information

ApportVersion: 2.14.1-0ubuntu3.6
Architecture: amd64
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC0: peter 2784 F.... pulseaudio
CurrentDesktop: KDE
DistroRelease: Ubuntu 14.04
EcryptfsInUse: Yes
InstallationDate: Installed on 2014-07-29 (145 days ago)
InstallationMedia: Linux Mint 17 "Qiana" - Release amd64 20140619
MachineType: Hewlett-Packard HP G60 Notebook PC
Package: linux (not installed)
ProcFB: 0 inteldrmfb
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-3.13.0-24-generic root=UUID=b9197503-27d1-4f90-bade-a411d7f6a295 ro quiet splash vt.handoff=7
ProcVersionSignature: Ubuntu 3.13.0-24.47-generic 3.13.9
RelatedPackageVersions:
 linux-restricted-modules-3.13.0-24-generic N/A
 linux-backports-modules-3.13.0-24-generic N/A
 linux-firmware 1.127.10
RfKill:
 0: phy0: Wireless LAN
  Soft blocked: no
  Hard blocked: no
Tags: qiana
Uname: Linux 3.13.0-24-generic x86_64
UnreportableReason: Your system partition has less than 29 MB of free space available, which leads to problems using applications and installing updates. Please free some space.
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm cdrom dip libvirtd lpadmin plugdev sambashare sudo vboxusers
_MarkForUpload: True
dmi.bios.date: 12/15/2010
dmi.bios.vendor: Hewlett-Packard
dmi.bios.version: F.65
dmi.board.asset.tag: Base Board Asset Tag
dmi.board.name: 3612
dmi.board.vendor: Hewlett-Packard
dmi.board.version: 09.67
dmi.chassis.asset.tag: Chassis Asset Tag
dmi.chassis.type: 10
dmi.chassis.vendor: Hewlett-Packard
dmi.chassis.version: Chassis Version
dmi.modalias: dmi:bvnHewlett-Packard:bvrF.65:bd12/15/2010:svnHewlett-Packard:pnHPG60NotebookPC:pvr0392120000200C10000020000:rvnHewlett-Packard:rn3612:rvr09.67:cvnHewlett-Packard:ct10:cvrChassisVersion:
dmi.product.name: HP G60 Notebook PC
dmi.product.version: 0392120000200C10000020000
dmi.sys.vendor: Hewlett-Packard

Revision history for this message
Peter (peterroots) wrote : AlsaInfo.txt

apport information

Revision history for this message
Peter (peterroots) wrote : BootDmesg.txt

apport information

Revision history for this message
Peter (peterroots) wrote : CRDA.txt

apport information

Revision history for this message
Peter (peterroots) wrote : CurrentDmesg.txt

apport information

Revision history for this message
Peter (peterroots) wrote : IwConfig.txt

apport information

Revision history for this message
Peter (peterroots) wrote : Lspci.txt

apport information

Revision history for this message
Peter (peterroots) wrote : Lsusb.txt

apport information

Revision history for this message
Peter (peterroots) wrote : ProcCpuinfo.txt

apport information

Revision history for this message
Peter (peterroots) wrote : ProcEnviron.txt

apport information

Revision history for this message
Peter (peterroots) wrote : ProcInterrupts.txt

apport information

Revision history for this message
Peter (peterroots) wrote : ProcModules.txt

apport information

Revision history for this message
Peter (peterroots) wrote : PulseList.txt

apport information

Revision history for this message
Peter (peterroots) wrote : UdevDb.txt

apport information

Revision history for this message
Peter (peterroots) wrote : UdevLog.txt

apport information

Revision history for this message
Peter (peterroots) wrote : WifiSyslog.txt

apport information

Revision history for this message
penalvch (penalvch) wrote :

Peter, please do not apport-collect to another person's report, as you are not the original reporter.

Linux Mint has a different procedure and location for tracking bug reports. If you want to file a report against Mint, please do so via their bug tracker located at https://bugs.launchpad.net/linuxmint/+filebug .

If you would like to file a bug in Ubuntu (not Mint), and so your problem and hardware may be tracked, please file a new report with Ubuntu by executing the following in a terminal while booted into the default Ubuntu kernel (not a mainline one) via:
ubuntu-bug linux

For more on this, please read the official Ubuntu documentation:
Ubuntu Bug Control and Ubuntu Bug Squad: https://wiki.ubuntu.com/Bugs/BestPractices#X.2BAC8-Reporting.Focus_on_One_Issue
Ubuntu Kernel Team: https://wiki.ubuntu.com/KernelTeam/KernelTeamBugPolicies#Filing_Kernel_Bug_reports
https://wiki.ubuntu.com/Kernel/Policies/DuplicateBugs
Ubuntu Community: https://help.ubuntu.com/community/ReportingBugs#Bug_reporting_etiquette

When opening up the new report, please feel free to subscribe me to it.

As well, please do not announce in this report you created a new bug report.

Thank you for your understanding.

Helpful bug reporting tips:
https://wiki.ubuntu.com/ReportingBugs

tags: removed: apport-collected qiana
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for linux (Ubuntu) because there has been no activity for 60 days.]

Changed in linux (Ubuntu):
status: Incomplete → Expired
Revision history for this message
Peter (peterroots) wrote :

just installed Kubuntu 15.10
this bug is still present
udisksctl power-off -b /dev/sdg will do as expected and spin a drive down

Status was incomplete and now expired. What further info is needed to confirm this bug after being around for at least 7 or so years?

Displaying first 40 and last 40 comments. View all 105 comments or add a comment.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.