LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
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 06-07-2012, 04:50 AM   #1
sluge
Member
 
Registered: Dec 2006
Location: Russia,52
Posts: 101

Rep: Reputation: 6
Question persistent name of SD card


Hello!
SD memory card is inserted to internal slot of my server. Sometimes when I boot, this card is /dev/sda, sometimes it's /dev/sdi. Is any way to completly define name of usb card?

PS:
It will be great if all internal hard drives would be sda, sdb, ... sdh, and any usb devices would be sdi(SD card), sdj(my USB key) and others...
 
Old 06-07-2012, 05:03 AM   #2
Didier Spaier
Senior Member
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slackware{,64}-{14.1,current} on a Lenovo Thinkpad T61 6457-4XG
Posts: 4,300

Rep: Reputation: 1063Reputation: 1063Reputation: 1063Reputation: 1063Reputation: 1063Reputation: 1063Reputation: 1063Reputation: 1063
Quote:
Originally Posted by sluge View Post
Is any way to completly define name of usb card?.
Yes with udev rules but that depend on the distribution & version used.
So please tell us which they are.
 
Old 06-07-2012, 03:43 PM   #3
jefro
Guru
 
Registered: Mar 2008
Posts: 11,590

Rep: Reputation: 1419Reputation: 1419Reputation: 1419Reputation: 1419Reputation: 1419Reputation: 1419Reputation: 1419Reputation: 1419Reputation: 1419Reputation: 1419
The problem is using sd(x) as a way to identify it.

As Didier Spaier suggests, a udev rule may work.
Here is an example. http://ubuntuforums.org/showthread.php?t=168221


It is possible that you could change how usb interacts with scsi mass storage maybe and change how it reports. Never looked into that. change the way it s called from sd to su or such.

Last edited by jefro; 06-07-2012 at 03:48 PM.
 
Old 06-07-2012, 04:08 PM   #4
Didier Spaier
Senior Member
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slackware{,64}-{14.1,current} on a Lenovo Thinkpad T61 6457-4XG
Posts: 4,300

Rep: Reputation: 1063Reputation: 1063Reputation: 1063Reputation: 1063Reputation: 1063Reputation: 1063Reputation: 1063Reputation: 1063
Second thought I think that there is another (and easier) way.

Plug in your SD card, check how it is identified; let's suppose it's /dev/sdx

Then issue following command:
Code:
blkid /dev/sdx
I don't have a SD card at hand but I just tried with an USB key and got this:
Code:
bash-4.1$ blkid /dev/sdb1
/dev/sdb1: UUID="4E95-B2D0" TYPE="vfat"
All you have to do is add a line to your /etc/fstab, e.g.:
Code:
UUID=4E95-B2D0 /media/USBkey1 vfat noauto,user,rw 0 0
Of course I would need to "mkdir media/USBkey1" first.

Then I can plug in my USB key and type "mount /media/USBkey1" or have it automatically mounted.

I'm not 100% sure this works for a SD card but that's worth trying

Last edited by Didier Spaier; 06-07-2012 at 04:45 PM. Reason: line of /etc/fstab corrected
 
  


Reply

Tags
usb


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
Persistent persistent Persistent Going Nuts Here Fcukinyahoo Linux - Newbie 6 11-17-2011 09:56 PM
Will Deleting 70-persistent-cd.rules and 70-persistent-net.rules Work As a "Live USB" Konphine Linux - General 1 10-09-2011 03:55 PM
persistent routing ubee Linux - Networking 5 12-09-2009 07:03 AM
persistent something-or-other... catworld Linux - Networking 1 05-01-2007 09:27 AM
persistent static routes, not so persistent Hewson Linux - Networking 4 04-27-2007 05:09 PM


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