LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-14-2016, 06:53 PM   #1
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,285

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Drive designations change randomly? (sda vs sdb vs sdc)


LinuxMint 18, Mate desktop, GRUB 2

My drive designations change randomly. I'm not doing anything between when they change (like moving cables, changing BIOS, update-grub, etc.) None of that. Just a simple reboot.

Typically I see:
WD Black 1Tb = /dev/sda
Samsung SSD 120Gb (main boot device) = /dev/sdb
old WD 40Gb drive = /dev/sdc

But I just caught it like this:
WD Black 1Tb = /dev/sdb
Samsung SSD 120Gb = /dev/sdc
old WD 40Gb = /dev/sda

I rebooted, and the drive designations changed back to the "typical" configuration.

This is not normally a problem, since /etc/fstab uses UUID. However, I see a potential problem in the GRUB2 boot menu, where it says things like "LinuxMint 18... (on /dev/sdb1)". Well, that's all fine and good, except when the drive known as sdb changes!

Currently I only have two boot devices - the Samsung SSD has LinuxMint18 on it's first partition, and the WD Black drive has LinuxMint13 on it's fourth partition. But my plan is to clone/backup the SSD to the old 40Gb drive's first partition (in case the SSD goes south on me). Once I start doing that cloning/rsyncing, then I will have TWO "LinuxMint18 (on /dev/sdX1)" boot options ... and if X randomly changes, how will I know which is which when choosing a boot device?

I do not expect drive designations to be the same across different distros or even different releases of the same distro. However, I can't say I expected them to change on the same distro, same release, when you just reboot it with no other intervening actions.

If it is typical that drive designations change like this with only a simple reboot, how do others tell what is what in the GRUB2 menu if you have multiple copies of the same distro/release on the same partition, but on different boot devices? I'm specifically referring to the /dev/sdX1 case, where X changes randomly.

Note: Eventually, the WD Black 1Tb drive will become ONLY a media drive (just pictures, documents, music, videos, etc), with no OS installed. Although I'm currently using it as a media drive, it still has a (mostly unused) copy of LinuxMint13 installed. I can still boot it into LM13 if required, but seldom do.

The long-term plan is: OS/applications on SSD (one partition), media on WD black 1Tb drive (two partitions - one for media, one for swap - not that my system ever swaps in the first place), backup of SSD on old 40Gb drive for emergency booting only (one partition). Although the SSD is 120Gb, I'm only using 17Gb of that, so it's backup will easily fit on the smaller 40Gb drive.
 
Old 08-14-2016, 08:59 PM   #2
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 17,714
Blog Entries: 28

Rep: Reputation: 5523Reputation: 5523Reputation: 5523Reputation: 5523Reputation: 5523Reputation: 5523Reputation: 5523Reputation: 5523Reputation: 5523Reputation: 5523Reputation: 5523
To avoid this issue, use the UUID in /etc/fstab.

This is an excellent primer: http://www.cyberciti.biz/faq/linux-f...-update-fstab/
It's the one that educated me.
 
Old 08-14-2016, 11:53 PM   #3
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,285

Original Poster
Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Thanks, but I'm already using UUID in fstab. Once it has booted, I don't care what the drive designations are, since as you recommend, I am using UUID in fstab. I can see the changed designations after boot, but it's a "don't care" situation by that time.

What I'm concerned about, is how the randomly changing designations will work with the GRUB2 menu. This is BEFORE boot. When you are trying to choose which drive designation to boot off of.
 
Old 08-15-2016, 07:35 AM   #4
norobro
Member
 
Registered: Feb 2006
Distribution: Debian Sid
Posts: 792

Rep: Reputation: 331Reputation: 331Reputation: 331Reputation: 331
Grub uses UUIDs also: https://www.gnu.org/software/grub/ma...tml#Device-map
 
Old 08-15-2016, 07:51 AM   #5
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512
You can also use filesystem labels to identify what to mount.
 
Old 08-17-2016, 02:46 AM   #6
mrmazda
Senior Member
 
Registered: Aug 2016
Location: USA
Distribution: openSUSE, Debian, Knoppix, Mageia, Fedora, others
Posts: 3,544
Blog Entries: 1

Rep: Reputation: 1186Reputation: 1186Reputation: 1186Reputation: 1186Reputation: 1186Reputation: 1186Reputation: 1186Reputation: 1186Reputation: 1186
Have you been into BIOS setup lately? Is the CMOS battery running low or has it been recently replaced? Is a newer motherboard BIOS available? It can be the ESCD/DMI Pool at the root of such trouble as this. Maybe clearing CMOS and resetting the clock would make the inconsistency go away?
 
Old 08-17-2016, 05:34 AM   #7
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512
Quote:
Originally Posted by mrmazda View Post
Have you been into BIOS setup lately? Is the CMOS battery running low or has it been recently replaced? Is a newer motherboard BIOS available? It can be the ESCD/DMI Pool at the root of such trouble as this. Maybe clearing CMOS and resetting the clock would make the inconsistency go away?
No. The device list is determined by the order the disk spins up and is ready. For two disks with identical characteristics - it is random. Each controller is independently initiated in parallel. Whatever disk responds first is the one that gets sda.

NORMALLY, sda is the disk referenced by the BIOS. But it doesn't have to be. That is why UUID (and LABEL) were added to identify the device uniquely.
 
Old 08-17-2016, 09:29 AM   #8
mrmazda
Senior Member
 
Registered: Aug 2016
Location: USA
Distribution: openSUSE, Debian, Knoppix, Mageia, Fedora, others
Posts: 3,544
Blog Entries: 1

Rep: Reputation: 1186Reputation: 1186Reputation: 1186Reputation: 1186Reputation: 1186Reputation: 1186Reputation: 1186Reputation: 1186Reputation: 1186
Quote:
Originally Posted by jpollard View Post
Each controller is independently initiated in parallel. Whatever disk responds first is the one that gets sda.
"Independently initiated" is why I wrote what I wrote. That "old" 40G could be PATA randomly coming up before SATA instead of normal after because of an imperfect CMOS state.
 
Old 08-17-2016, 11:54 AM   #9
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,285

Original Poster
Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Quote:
Originally Posted by mrmazda View Post
"Independently initiated" is why I wrote what I wrote. That "old" 40G could be PATA randomly coming up before SATA instead of normal after because of an imperfect CMOS state.
Sorry, I've been out of town for a while, not able to respond.

FWIW, the 40Gb is indeed an old PATA device. Everything else in the system is SATA-2. That's as high as the Mobo supports, but the SSD is SATA-3, just not using those SATA-3 speeds obviously.

I do not really care what the drive designations are, except that when I get around to backing up my SSD to that old 40Gb, then I would like to have some indication in the GRUB 2 boot menu of which "Linux Mint 18" is which - since they will be identical installations, just one on SSD and the other on the old 40Gb drive. The only reason I need to have a boot entry for that old 40Gb drive is for random testing - to make sure my backups are working and the drive is indeed bootable. Should my SSD go bad - which is the whole reason I want to back it up in the first place - then I will have to use a different boot manager setup to boot, since all my GRUB 2 files are currently installed on the SSD. Those would disappear if the SSD went bad. So I'd have to create a different boot manager installation on the old 40Gb so I'd have a way to boot if the SSD went bad. But that's doable using a LiveCD (my favorite being SystemRescueCD).

I will start digging through the GRUB 2 documentation to learn more. I've been an old-fart holdout up until now - clinging to legacy GRUB for as long as I could before finally giving in to GRUB 2. I'm kind of the same way with other stuff too - clinging to init over upstart, and now I have to deal with systemd too. Init did (and still does) everything I need, so I saw no need to move to upstart, except as I was forced to by newer distros. Now systemd is crowding out upstart. And 95% of my system administration is done command-line rather than GUI. I can spit out the command-line options to growisofs to burn a DVD faster than I can remember the name of that GUI program to do it graphically. I guess I'm just old...
 
Old 08-17-2016, 01:33 PM   #10
mrmazda
Senior Member
 
Registered: Aug 2016
Location: USA
Distribution: openSUSE, Debian, Knoppix, Mageia, Fedora, others
Posts: 3,544
Blog Entries: 1

Rep: Reputation: 1186Reputation: 1186Reputation: 1186Reputation: 1186Reputation: 1186Reputation: 1186Reputation: 1186Reputation: 1186Reputation: 1186
Quote:
Originally Posted by haertig View Post
I've been an old-fart holdout up until now - clinging to legacy GRUB for as long as I could before finally giving in to GRUB 2.
I still am. Grub2 provides nothing I need, adding overhead and additional complication that my many already complicated multiboot systems don't need. Distros I install that offer no choices other than Grub and no bootloader at all get installed with no bootloader, with the sole exception of *buntu, which I allow for the purpose of watching Grub2 evolution as a "user".

Technically, none of my Linux installations need any bootloader installed, because I keep (openSUSE's) Grub (with Gfxboot) on a primary, loaded by generic MBR code, managed entiredly by me and MC. Grub Legacy's simplicity is its attraction. It just works, with no need for scripts to perform "repairs" after cloning operations.

Put a bootable primary with Grub on each disk yourself, put generic code on every MBR, limit each Distro's bootloader installation to writing to its own /, and you'll have no impediment to getting booted quickly regardless which disk(s) work or not.

UEFI systems are another matter. I don't have any of those that demand I use it, yet.
 
  


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
[SOLVED] sda drive to sdb, so new hdd can become sda? irgunII Slackware 5 03-07-2014 08:38 AM
[SOLVED] Hard Drive showing up as /dev/sde while sda, sdb, sdc, and sdd show nothing swilsy Linux - Hardware 12 06-03-2012 03:02 AM
Can i dd if=/dev/sdb of=/dev/sdc if hdsize(sdb)>hdsize(sdc) & size(sdb)<hdsize(sdc) ? ununun Linux - Software 6 06-28-2011 11:48 AM
sda sdb sdc drives not consistent ufmale Linux - Newbie 6 05-27-2008 06:38 PM
zip drive alternately mounts on /sda and /sdb timsch75 Linux - Hardware 6 09-26-2004 10:00 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:58 AM.

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