Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


Closed Thread
  Search this Thread
Old 04-17-2009, 01:02 AM   #1
LQ Newbie
Registered: Apr 2009
Posts: 6

Rep: Reputation: 0
Question USB Pendrive detection

Hi all,

I need to develop a SW in which the SW has to determine when any USB is connected,it has to identify and do the Read and write operation with the pendrive.
I have to identify the moment when pendrive is connected.System has no GUI only Black Box.
Im using RHEL with Kernel 2.6.18.

My question is how to identify if pendrive is connected.Is any System flag or some other thing will set In OS?

Please help me out to solve this problem

Many Thanks in Advance
Old 04-17-2009, 02:52 AM   #2
Registered: Mar 2009
Location: Genoa, Italy
Distribution: Slackware
Posts: 33

Rep: Reputation: 16

when you connect a usb pendrive to your linux box you should see activity in the file /var/log/messages.

Try to do the follwing command

sudo tail -f /var/log/messages
connect the usb drive and see what happens.

Or you can give as root the command "dmesg".

In what language are you developing? If you are using the C language you could find something useful here

Hope this will help


Old 04-17-2009, 03:37 AM   #3
Junior Hacker
Senior Member
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 61
Did your instructor implement a timeline for you and other students to draft a perspective?
Old 04-18-2009, 08:16 AM   #4
LQ Veteran
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.

See also the forum rules about homework

Closed Thread

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
Problem with usb pendrive and usb modem ZTE ZXDSL 852 AM33N Linux - Hardware 3 12-10-2008 03:25 AM
usb pendrive in dell inspiron with 8 usb ports sergioricardo Linux - Hardware 4 02-12-2008 11:05 AM
Conflicting USB mouse & usb pendrive on Slackware 11.0 aruntom55 Slackware 3 08-26-2007 01:34 AM
usb pendrive, again. dve Linux - Hardware 15 12-12-2006 03:58 AM
usb pendrive carmelo Slackware 3 04-08-2006 10:09 AM > Forums > Linux Forums > Linux - Newbie

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

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