LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 07-30-2008, 02:39 PM   #1
rperrine
LQ Newbie
 
Registered: Jul 2008
Posts: 2

Rep: Reputation: 0
Exclamation 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!

Last edited by rperrine; 07-30-2008 at 02:42 PM. Reason: Additions
 
Old 07-30-2008, 03:07 PM   #2
TB0ne
Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 14,778

Rep: Reputation: 2614Reputation: 2614Reputation: 2614Reputation: 2614Reputation: 2614Reputation: 2614Reputation: 2614Reputation: 2614Reputation: 2614Reputation: 2614Reputation: 2614
Quote:
Originally Posted by rperrine View Post
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.
 
Old 07-30-2008, 03:13 PM   #3
rperrine
LQ Newbie
 
Registered: Jul 2008
Posts: 2

Original Poster
Rep: Reputation: 0
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...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems mounting/unmounting flash USB drive LordSurvivoR Linux - Hardware 1 07-12-2005 11:19 PM
Need help identifying and mounting/unmounting USB drive. calathar Linux - Newbie 2 05-01-2005 03:50 AM
Unmounting USB Flash drive alanbarnard JDS 2 02-20-2005 11:16 AM
External USB drive mounting/unmounting nsk078 Linux - Hardware 1 09-22-2004 05:15 PM
unmounting my usb drive flinchumj Linux - General 6 05-29-2003 10:16 AM


All times are GMT -5. The time now is 03:07 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration