LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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-10-2007, 10:18 AM   #1
ravime
LQ Newbie
 
Registered: Jul 2007
Posts: 24

Rep: Reputation: 15
USB Detection; when /dev/sda1 or /dev/sdb1


Dear all,

As I know USB will deteceted as eaither /dev/sda1 or /dev/sdb1.

I would like to know when USB will be detected as /dev/sda1 or /dev/sdb1.
on which it sda1 and sdb1 depends.

Thanks for any input.
 
Old 09-10-2007, 10:30 AM   #2
rufius
Member
 
Registered: Oct 2002
Location: Miami, FL
Distribution: Ubuntu
Posts: 184

Rep: Reputation: 30
Well its up to the udev system to decide. If it believes that /dev/sda exists currently in the system (even if its not really there), its going to mount as /dev/sdb. There's no sure-fire way to ensure that it'll always be one or the other unless are thorough in your proper umounting/mounting. Even then, its not guaranteed. What is your end goal?
 
Old 09-10-2007, 11:33 AM   #3
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
If you want to write an fstab entry for a usb external storage device, use "UUID=<the_uuid_number>" or "LABEL=<label>" instead. I have a thumbdrive where I used "mlabel" to label the drive as "PODCASTS". An fstab entry for it could use "LABEL=PODCASTS" instead of the device node.

Even without an fstab entry, udev notices the label and it is mounted at /media/PODCASTS.
 
Old 09-11-2007, 08:43 AM   #4
ravime
LQ Newbie
 
Registered: Jul 2007
Posts: 24

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by rufius View Post
Well its up to the udev system to decide. If it believes that /dev/sda exists currently in the system (even if its not really there), its going to mount as /dev/sdb. There's no sure-fire way to ensure that it'll always be one or the other unless are thorough in your proper umounting/mounting. Even then, its not guaranteed. What is your end goal?
Basically I am running Desktop with LIVE-CD, Whenever system boots up I would like to copy few files from USB to Livecd environment, then operate.
So whenever system boots up I am mounting the USB as /deev/sda1. Sometimes mount fails because USB is detected as /dev/sdb1, resulting failure in next execution also. So I want to make sure on what basis it OS decides it as /dev/sda1 or /dev/sdb1

Regards
ravime
 
Old 09-11-2007, 08:45 AM   #5
ravime
LQ Newbie
 
Registered: Jul 2007
Posts: 24

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by jschiwal View Post
If you want to write an fstab entry for a usb external storage device, use "UUID=<the_uuid_number>" or "LABEL=<label>" instead. I have a thumbdrive where I used "mlabel" to label the drive as "PODCASTS". An fstab entry for it could use "LABEL=PODCASTS" instead of the device node.

Even without an fstab entry, udev notices the label and it is mounted at /media/PODCASTS.

thanks for your kind reply.

I am operating in LIVECD environment. so there is no fstsb entry.
 
Old 09-11-2007, 08:46 AM   #6
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
Does your live cd use udev & hal? Look in /dev/ for directories like /disk-by-label/ & /disk-by-uuid and use those device links in your mount command.
 
Old 09-12-2007, 06:15 AM   #7
ravime
LQ Newbie
 
Registered: Jul 2007
Posts: 24

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by jschiwal View Post
Does your live cd use udev & hal? Look in /dev/ for directories like /disk-by-label/ & /disk-by-uuid and use those device links in your mount command.
Thank you very much. I was trying for shortcut. But no shortcut, I feel.
I should check /dev directory as you said.
 
  


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
USB drive... /dev/sda1 doesn't show unless I try mounting /dev/sda as vfat finite Linux - Hardware 8 03-10-2009 12:52 AM
USB key /dev/sdb1 permissions problem... zparihar Linux - Hardware 6 02-03-2005 05:22 PM
Grub Dual Boot /dev/sda1 /dev/hda1 jono268 Debian 4 01-14-2005 04:54 AM
/dev/sda and /dev/sda1 disappeared using sii3112A striderstrahan Linux - Software 0 09-16-2004 05:00 AM
USB Compact flash card reader hotplug creates /dev/sda but no /dev/sda1 -Mandrake 9.1 bibinono Linux - Hardware 2 08-11-2003 09:37 AM


All times are GMT -5. The time now is 02:35 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