[SOLVED] why does a pluggable device change from sdb1 to sdc1 when I re-plug it?
Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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 12:56 PM.
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?
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.