3

I have a USB external hard drive with several partitions, and I cannot spin down the hard drive to get it to eject. Any suggestions? I unmounted all partitions through Nautilus, but the drive is still spinning. Nautilus does not seem to have other options besides unmount in Ubuntu 13.10.

After ensuring that no drives are mounted, I tried the udisks to detach the drive, but I get the following error:

[lucas@lucas-ThinkPad-W520]~$ mount | grep ^'/dev'                                      
/dev/sda5 on / type ext4 (rw,errors=remount-ro)
[lucas@lucas-ThinkPad-W520]~$ udisks --detach /dev/sdb
Detach failed: One or more partitions are busy on /dev/sdb
[lucas@lucas-ThinkPad-W520]~$ 

How can other partitions be busy if mount | grep ^'/dev' does not return any of my /dev/sdb partitions? Is there an easy way to detach my external hard drive? A simple solution would be nice...

I am using Ubuntu 13.10 and my external hard drive is a backup my internal hard drive, setup via Clonezilla.

UPDATE I tried lsof, results below:

[lucas@lucas-ThinkPad-W520]~$ lsof /dev/sdb
sdb   sdb1  sdb2  sdb3  sdb4  sdb5  sdb6  
[lucas@lucas-ThinkPad-W520]~$ lsof /dev/sdb
[lucas@lucas-ThinkPad-W520]~$ lsof /dev/sdb1
[lucas@lucas-ThinkPad-W520]~$ lsof /dev/sdb2
[lucas@lucas-ThinkPad-W520]~$ lsof /dev/sdb3
[lucas@lucas-ThinkPad-W520]~$ lsof /dev/sdb4
[lucas@lucas-ThinkPad-W520]~$ lsof /dev/sdb5
[lucas@lucas-ThinkPad-W520]~$ lsof /dev/sdb6
[lucas@lucas-ThinkPad-W520]~$ 
Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175
modulitos
  • 3,097
  • 8
  • 29
  • 44
  • Use `lsof` to see what is using the drive... – jasonwryan Apr 30 '14 at 03:54
  • I just tried it, but my partitions are unmounted. Any ideas? I can still feel and hear my external HDD still spinnning! Should I just unplug it? – modulitos Apr 30 '14 at 04:08
  • `lsof` usually doesn't print enough info if you are not root. Try `sudo lsof ...`. BTW do you use LVM, RAID, LUKS or any such device mapper? – phunehehe Apr 30 '14 at 05:19

2 Answers2

2

Try:

$ sudo lsof /dev/sdb1 

lsof will give you blank output without proper (root) permission to the drive. If the backup program is not running, it's more than likely "ok" to disconnect.

Braiam
  • 35,380
  • 25
  • 108
  • 167
Cbaker510
  • 413
  • 4
  • 6
1

Device mapper or mdadm (RAID) could still be holding a partition open. The present-day setup of udev causes auto-recognition of RAID arrays, even if you don't try to mount or start them. So, for instance, if the disk was part of an array a long time ago, it might still have enough of the RAID signature that udev detected it. To check for that:

cat /proc/mdstat

To check for device mapper:

ls -l /sys/block/*/slaves/

Device mapper entries might be LVM, encrypted volumes, etc.

MikeD
  • 800
  • 5
  • 16
Felix
  • 111
  • 1