-1

I had issues unmounting a device, it kept saying device was busy. lsof and fuser showed no device was attached.

I have managed to umount device with the -l option. However, when I plug the hard drive it has incremented to the next device up. e.g. from /dev/sdc1 to /dev/sdd1.

How can I find what's preventing /dev/sdc from being used again? Thanks.

  • Is there some reason you have not tried rebooting? – mdpc Jan 13 '15 at 9:21
  • It's in a production environment and so I do not want to reboot it. If the problem does occur again, I would like to be able to able to fix the problem and not reboot each time it happens. A work around has been to mount it using label instead. – supmethods Jan 13 '15 at 21:12
  • You aren't supposed to use the /dev/sd** devices normally anyway; you should be using UUIDs or labels. – Michael Hampton Jan 13 '15 at 22:32
1

if you're certain that the block device is no longer in use (including no longer being present in LVM, etc), you can remove it from the scsi subsystem.

_disk=sdc
blockdev --flushbufs /dev/$_disk
print 1 > /sys/block/$_disk/device/delete

consider whether sdd should go as well. from your description, it sounds like it should

then plug in the drive and perform a scsi bus scan again

for i in `ls -d /sys/class/scsi_host/host*`
do
  echo "- - -" > ${i}/scan
done

and hopefully it'll come back as sdc.

this works well and i've removed disks like this in production (albiet under change control), but always take responsibility and put it through your test environments first, if possible

0

I would suggest that you backup the data on the drive as quickly as possible. It's not a good sign when a drive is behaving as you describe. After that I would try the drive in any other machine, that way you can be sure that the hard drive is not the problem. Maybe even try another drive in the same machine. A reboot should leave the device /dev/sdc free.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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