LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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-01-2016, 09:50 AM   #1
grigory
Member
 
Registered: Oct 2015
Posts: 133

Rep: Reputation: Disabled
Two HDDs are switching their device names in Ubuntu Linux


Hello!

Not like it's a problem so far, but mostly my curiosity. I have 2 disks -- internal and external. The latter is connected via USB3 cable. My Ubuntu install is on the external drive. W10 is inside my laptop (it's a dual-boot system). So usually my internal drive is sda and my external one is sdb in Ubuntu (they're both SATA drives, of course). But today they switched their device names, so the internal became sdb and external became sda. After the reboot everything got back to normal. I personally haven't done anything in this regard. To me that's strange. Maybe someone could explain that to me, please.
 
Old 02-01-2016, 10:05 AM   #2
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,348

Rep: Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589
I had the same thing happen to me also about two weeks ago on Xubuntu. Unfortunately for me it had happen after reboot into Xubuntu and then dd a slackware iso to sdb which end up b being my internal hard drive. The good out of all this is it only wrote over first part of the disk including part of my windows partition and was able to recover the MBR and partitions not written over using tesdisk amd windows from the recovery partition that wasn't written over niether. I had done a dd to sdb before the reboot without any problems. So beware with the ubuntu distros check you device naming every time before using DD.
 
Old 02-01-2016, 10:13 AM   #3
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
Device names are not guaranteed, it just depends on the order they're detected on boot. That's why you don't use device names in fstab or other important areas, you use UUID or labels, something that is persistent.
 
Old 02-01-2016, 10:23 AM   #4
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,348

Rep: Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589
I usually check the naming just to make sure before using DD and the one time I don't we'll there you go

Last edited by colorpurple21859; 02-01-2016 at 08:02 PM.
 
Old 02-01-2016, 03:56 PM   #5
grigory
Member
 
Registered: Oct 2015
Posts: 133

Original Poster
Rep: Reputation: Disabled
Thank you all for your replies!
 
Old 02-01-2016, 04:11 PM   #6
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Have a look at https://help.ubuntu.com/community/UsingUUID
 
Old 02-02-2016, 11:26 AM   #7
grigory
Member
 
Registered: Oct 2015
Posts: 133

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Habitual View Post
OK, I'll look into that, thanks!
 
  


Reply



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
How Device Names are assigned in Linux Systems rajeevsam Programming 3 10-03-2011 11:06 PM
Device Manager equivalent? I want to check HDDs chococharlie Linux - Newbie 14 09-11-2008 10:59 AM
wireless card keeps switching device names vvuiverine Linux - Wireless Networking 2 12-25-2005 04:46 AM
Logical device names and instant names Gins Linux - General 8 11-30-2004 08:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:32 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
Open Source Consulting | Domain Registration