LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   External USB DRIVE - Not fully unmounting (https://www.linuxquestions.org/questions/linux-newbie-8/external-usb-drive-not-fully-unmounting-659328/)

rperrine 07-30-2008 02:39 PM

External USB DRIVE - Not fully unmounting
 
I Have an External USB Drive (NTFS),

When I unplug the drive it removes the folder icon from "/media" however if i do

/media# ls
ls: cannot access DRIVE 8: Input/output error
DRIVE 8

if i do a fdisk -l it reports the drive is gone...

Device Boot Start End Blocks Id System
/dev/sda1 * 1 47888 384660328+ 83 Linux
/dev/sda2 47889 48641 6048472+ 5 Extended
/dev/sda5 47889 48641 6048441 82 Linux swap / Solaris

if i try to remove the directory:
/media# rmdir *
rmdir: failed to remove `DRIVE 8': Device or resource busy

I check processes:
#ps -ax | grep ntfs
7340 ? Ss 1:26 /sbin/mount.ntfs-3g /dev/sdf1 /media/DRIVE 8 -o rw,nosuid,nodev,uhelper=hal,locale=en_US.UTF-

Why is this being held in process? Why is it not being removed automatically? Where is this being held in at?

Smaller NTFS THUMB-drives (4GB - 10GB) work, this particular drive is a 400GB external USB drive.

I have a script which runs and checks /media for content, its holding the script up.

Please help! Urgent!

TB0ne 07-30-2008 03:07 PM

Quote:

Originally Posted by rperrine (Post 3231309)
I Have an External USB Drive (NTFS),

When I unplug the drive it removes the folder icon from "/media" however if i do

/media# ls
ls: cannot access DRIVE 8: Input/output error
DRIVE 8

if i do a fdisk -l it reports the drive is gone...

Device Boot Start End Blocks Id System
/dev/sda1 * 1 47888 384660328+ 83 Linux
/dev/sda2 47889 48641 6048472+ 5 Extended
/dev/sda5 47889 48641 6048441 82 Linux swap / Solaris

if i try to remove the directory:
/media# rmdir *
rmdir: failed to remove `DRIVE 8': Device or resource busy

I check processes:
#ps -ax | grep ntfs
7340 ? Ss 1:26 /sbin/mount.ntfs-3g /dev/sdf1 /media/DRIVE 8 -o rw,nosuid,nodev,uhelper=hal,locale=en_US.UTF-

Why is this being held in process? Why is it not being removed automatically? Where is this being held in at?

Smaller NTFS THUMB-drives (4GB - 10GB) work, this particular drive is a 400GB external USB drive.

I have a script which runs and checks /media for content, its holding the script up.

Please help! Urgent!

We all volunteer our time, so this isn't "urgent".

The reason probably has to do with the fact that you're not actually unmounting the drive. A "umount /media/8" command will sync the drives, and unmount the device. Just unplugging it won't sync things. Also, if you have a script that's banging on a directory (don't know how it's written), and keeping it open, the mount-point will be active.

Are the smaller ones checked for content too? And be aware that a 4 GB drive will sync/flush alot faster than a 400GB.

rperrine 07-30-2008 03:13 PM

Right, thanks for the tip. I assumed it would be quicker.

Added umount to my script for quicker sync.

Script sleeps after it runs for 5 seconds, figure this should work... trying now...


All times are GMT -5. The time now is 11:28 PM.