LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Reply
 
Search this Thread
Old 09-05-2004, 04:26 PM   #1
minm
Member
 
Registered: Jun 2003
Location: Canada
Distribution: suse 9.2
Posts: 582

Rep: Reputation: 30
mounting a pendrive


when i type

linux:/mnt # mount -t vfat /dev/sda1 /mnt/flashdrive

it gives me this error

mount: /dev/sda1 is not a valid block device


What can i do to fix this?
 
Old 09-05-2004, 04:30 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 64
It sounds like sda isn't your pen drive. Take a look at the output from "dmesg | grep remov" or "fdisk -l" to see the device name.
 
Old 09-05-2004, 04:49 PM   #3
minm
Member
 
Registered: Jun 2003
Location: Canada
Distribution: suse 9.2
Posts: 582

Original Poster
Rep: Reputation: 30
ok, for some reason each time itake my pen drive out of the USB then i put it back in, it changes it's location, at first it would be /dev/sda then it woul be /dev/sdb

what's wrong?
 
Old 09-05-2004, 04:50 PM   #4
minm
Member
 
Registered: Jun 2003
Location: Canada
Distribution: suse 9.2
Posts: 582

Original Poster
Rep: Reputation: 30
linux:/home/mark # dmesg | grep remov
Attached scsi removable disk sda at scsi0, channel 0, id 0, lun 0
Attached scsi removable disk sda at scsi1, channel 0, id 0, lun 0
Attached scsi removable disk sdb at scsi2, channel 0, id 0, lun 0


what do i do from there?
 
Old 09-05-2004, 04:59 PM   #5
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 64
Are you remembering to unmount it before removing it?
 
Old 09-05-2004, 05:24 PM   #6
minm
Member
 
Registered: Jun 2003
Location: Canada
Distribution: suse 9.2
Posts: 582

Original Poster
Rep: Reputation: 30
no, but i heard stories of people being able to plug it in, it automatically detects it.

when i umount it, it says the device is busy :\
 
Old 09-05-2004, 05:33 PM   #7
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 64
When it is mounted you can see what proccesses are using it with lsof or fuser:
fuser -v /mnt/flashdrive

Once you only have the kernel showing you can unmount it.
 
Old 09-05-2004, 05:33 PM   #8
J.W.
LQ Veteran
 
Registered: Mar 2003
Location: Milwaukee, WI
Distribution: Mint
Posts: 6,642

Rep: Reputation: 69
If you get the "busy" message, then it means that you've got an open process accessing it. For example, if opened up a terminal session, then mounted the pendrive and nagivated over to /mnt/flashdrive, you will not be able to unmount it (because your session is accessing it). cd to a higher level directory and you should be OK, assuming that no other process is still acessing it -- J.W.
 
Old 09-05-2004, 06:13 PM   #9
minm
Member
 
Registered: Jun 2003
Location: Canada
Distribution: suse 9.2
Posts: 582

Original Poster
Rep: Reputation: 30
ok this is what i do in the konsole

linux:/home/mark # fuser -v /mnt/flashdrive
linux:/home/mark # dmesg | grep remov
Attached scsi removable disk sda at scsi0, channel 0, id 0, lun 0
Attached scsi removable disk sda at scsi1, channel 0, id 0, lun 0
Attached scsi removable disk sdb at scsi2, channel 0, id 0, lun 0


it's still there ?;\
 
Old 09-05-2004, 06:20 PM   #10
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 64
it's still where? What is mounted:
mount
 
Old 09-05-2004, 06:35 PM   #11
minm
Member
 
Registered: Jun 2003
Location: Canada
Distribution: suse 9.2
Posts: 582

Original Poster
Rep: Reputation: 30
linux:/home/mark # mount
/dev/hda2 on / type reiserfs (rw,acl,user_xattr)
proc on /proc type proc (rw)
tmpfs on /dev/shm type tmpfs (rw)
devpts on /dev/pts type devpts (rw,mode=0620,gid=5)
/dev/hda3 on /home type reiserfs (rw,acl,user_xattr)
/dev/hdc on /media/dvdram type subfs (ro,nosuid,nodev,fs=cdfss,procuid,iocharset=utf8)
/dev/fd0 on /media/floppy type subfs (rw,nosuid,nodev,sync,fs=floppyfss,procuid)
usbfs on /proc/bus/usb type usbfs (rw)


hmm ok, so from scratch assuming i deleted the flashdrive dir in /mnt

i would mkdir flashdrive in /mnt?

then what
thats when i get problems..
 
Old 09-06-2004, 01:10 PM   #12
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 64
The procedure should be:
mkdir /mnt/flashdrive

Then for each mount time:
dmesg | grep remov

Mount the first partition n the sd device shown above:
mount /dev/sdX1 /mnt/flashdrive

Do what you want to do, then:
umount /mnt/flashdrive
 
Old 09-06-2004, 01:56 PM   #13
minm
Member
 
Registered: Jun 2003
Location: Canada
Distribution: suse 9.2
Posts: 582

Original Poster
Rep: Reputation: 30
ok i got it, but is there a way so when i'm done with everything it will kil lall the processes immediately?
is there away to make a script like that???
it's a pain to always see whats running it, etc.
 
Old 09-06-2004, 02:05 PM   #14
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 64
Take a look at the -k flag:
man fuser

Note that this may close some apps that you really want to remain open.
 
  


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
error:mounting usb pendrive in debian pspec Linux - Newbie 3 12-01-2005 12:24 AM
Mounting USB pendrive on Debian malesandro Linux - Newbie 15 10-14-2005 05:19 PM
Mounting USB-Pendrive in Debian Elbryan Linux - Software 4 09-22-2005 01:39 PM
mounting pendrive ankscorek Linux - Hardware 5 08-18-2005 09:37 AM
automate mounting pendrive carboncopy Slackware 2 08-10-2004 01:33 PM


All times are GMT -5. The time now is 05:00 AM.

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