LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Reply
 
Search this Thread
Old 02-27-2013, 01:51 PM   #1
newbiesforever
Senior Member
 
Registered: Apr 2006
Location: Glendale, AZ
Distribution: Distro-homeless. Lost.
Posts: 1,892

Rep: Reputation: 62
why does a pluggable device change from sdb1 to sdc1 when I re-plug it?


I notice that if I unplug my MP3 player or USB drive from a USB port and then plug it back in later, it will reappear with a different sd[x] letter (sorry, I can't remember what we call those names). It's sdb1 the first time I plug it in, and when I plug it in the second time, it reappears as sdc1 (or something else, depending on what else I have plugged in). Why is that? Because it's not sdb1 anymore, I can't simply refresh the window displaying the device's contents (if I left it open). I didn't plug in or remove anything else, so it can't be because something else became sdb1, can it?

Last edited by newbiesforever; 02-27-2013 at 01:56 PM.
 
Old 02-27-2013, 07:00 PM   #2
suicidaleggroll
Senior Member
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 3,222

Rep: Reputation: 1155Reputation: 1155Reputation: 1155Reputation: 1155Reputation: 1155Reputation: 1155Reputation: 1155Reputation: 1155Reputation: 1155
device names are volatile, you can't rely on them to stay static, especially not for removable devices.

What window is this that displays drive contents based on device names rather than mount points?
 
Old 02-27-2013, 07:32 PM   #3
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 1,623

Rep: Reputation: 676Reputation: 676Reputation: 676Reputation: 676Reputation: 676Reputation: 676
Probably the program in the window that was displaying the device's contents still has some reference to that device open, making that name unavailable for reuse. Did you unmount or, preferably, "Safely remove" the drive before yanking it out?
 
1 members found this post helpful.
Old 02-27-2013, 08:20 PM   #4
bloody
Member
 
Registered: Feb 2013
Location: Berlin
Distribution: Gentoo, Debian
Posts: 158

Rep: Reputation: 23
Yes, if you leave that window open and just pull out the device, the mountpoint might be still locked when you re-insert it, because that window still has the device/mountpoint "in use". Always unmount the device before pulling it out, so any pending writes can be committed before the device is disconnected. The window will then probably notice the unmount and release it's grip also.

Device names can sometimes change. Some BIOSes even swap local harddisk device names at boot time, so "sda" may become "sdb" and vice versa. So if you can avoid using these hard device names, i'd suggest to do so. You can give every partition a certain disk label and then address it by label, e.g., instead of "/dev/sdc1" you could use "/dev/disk/by-label/MY_USTICK_WORK2", or in the /etc/fstab (if you are creating entries there), instead of "/dev/sdc1" you might use "LABEL=MY_USTICK_WORK2" to address that particular partition. Similar in the GRUB config, and so on.

It's even possible to label swap partitions or NTFS (Windows) partitions. See man e2label/swaplabel/ntfslabel. If you do, use no more than 16 characters for compatibility reasons. At least that'll work on any partition type i know of.

Last edited by bloody; 02-27-2013 at 08:23 PM.
 
1 members found this post helpful.
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
mount: special device /dev/sdb1 does not exist sysbox Linux - Hardware 4 11-11-2013 02:51 AM
[SOLVED] extlinux: cannot open device /dev/sdb1 guoissac Linux - Newbie 1 12-01-2012 04:12 PM
Buffer I/O error on device sdb1 tikit Linux - Hardware 2 02-04-2010 02:55 AM
LXer: Pluggable Schedulers vs. Pluggable Security LXer Syndicated Linux News 0 10-04-2007 12:40 AM
SDB1 IS NOT A VALID BLOCK DEVICE - CF reader help woodo Linux - Software 12 07-07-2004 10:52 AM


All times are GMT -5. The time now is 10:29 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration