LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 10-06-2004, 04:16 PM   #1
steven2357
LQ Newbie
 
Registered: Aug 2004
Posts: 6

Rep: Reputation: 0
Cool unmounting usb memory stick


I just installed rh 7.3 (on an old computer)

I have a Kingston USB memory stick, and I want to be able to use it.

I added the following line to /etc/fstab
/dev/sda1 /mnt/usbstick vfat user,noauto,unmask=0 0 0

I made the directory
/mnt/usbstick

I mounted the usbstick with
mount /mnt/usbstick

I could read the files, but not write to the memory stick. An icon in GNOME appeared, but when I opened the folder it said no write.

I tried to unmount it with
umount /mnt/usbstick and it gave:

"umount: /mnt/usbstick: device is busy" but I didn't have anything open.

cat /proc/mounts gives:
/dev/sda1 /mnt/usbstick vfat rw,nosuid,nodev,noexec 0 0

cat /etc/mtab gives:
/dev/sda1 /mount/usbstick vfat rw,noexec,nosuid,nodev,unmask=0,user=steven 0 0

Thank you!!
By the way, adding the line worked in rh9. I downgraded because it ran too slow on my older machine.
 
Old 10-06-2004, 04:34 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Have a look with lsof to see which process is
grabbing it ... probably nauseous. Worst case
scenario: log out of gnome, switch to a full-
screen and unmount from there....


Cheers,
Tink
 
Old 10-06-2004, 04:37 PM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670
Try using the 'fuser -m /dev/sda1' to identify the pid of the process which has the lock. Also, make sure that you don't have a file manager window open on the device, and non of the shells have their present working directories on /mnt/usbstick or one of its subdirectories.

I prefer to use the uid= and/or the gid= options to control access and permissions on vfat devices. Also, I think you had a typo of unmask rather than umask. ( Or it's the first time I've seen that option )

-----
OK, I stole this sig...

How does a UNIX Guru have sex ?
* unzip; strip; touch; finger; mount; fsck; more; yes; fsck; fsck; fsck; umount; sleep;
 
Old 10-06-2004, 11:53 PM   #4
steven2357
LQ Newbie
 
Registered: Aug 2004
Posts: 6

Original Poster
Rep: Reputation: 0
Cool

I fixed the typo, but it still doesn't work.

??? "fuser -m ..." isn't a valid command?

??? "lsof" isn't a valid command?

What did I do wrong?
Also, the line worked when added in red hat 9, but I don't know what all of it does. How do you suggest using uid=?
 
Old 10-06-2004, 11:56 PM   #5
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Looks like you failed to install a few important
system tools :) ... browse your rpms.


Cheers,
Tink
 
Old 10-06-2004, 11:58 PM   #6
Sabicas
Member
 
Registered: Aug 2004
Distribution: Slackware 10
Posts: 110

Rep: Reputation: 15
You need to be out of the directory your unmounting. Also make sure your su'd in. If it still say's device is busy do a

Code:
lsof +D /mnt/usbstick
Again make sure your su'd in (I think that may be the reason that your getting a command not found).

With the output of the lsof find the PID or process id and type

Code:
kill -9 (whatever pid)
 
Old 10-07-2004, 07:35 AM   #7
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670
The uid and gid mount options allow you to set the ownership of the drive. You can use either the UID and GID numbers or use the names instead. This information cannot be set on fat32 or ntfs drives with the chown and chgrp commands as is the case with native file system types such as ext3 and Reiserfs, and so it is set during the mount process.

Setting the group ownership allows you a finer control over who can access a mounted drive. For example, suppose you have a 'parents' group. Then if you are at the computer and your wife is connected remotely, you both can access the partition, but users in the 'kids' group will not be able to.
 
  


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
Missing memory in USB stick, flash memory, removable hd etc bamboo_spider Linux - Newbie 3 06-14-2006 06:39 PM
USB memory stick Alan Lakin Linux - Hardware 21 11-10-2005 06:53 AM
USB Memory Stick coal-fire-ice Mandriva 11 12-10-2004 12:59 AM
USB Memory Stick freddie_leaf Slackware 15 11-09-2004 02:41 AM
usb memory stick amadkow Linux - Newbie 4 06-14-2004 06:21 PM


All times are GMT -5. The time now is 04:20 PM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration