LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-06-2013, 09:05 AM   #1
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
Non-consistend device names (sda, sdb) on RAIDED system


I have a RAID1 system, on which the devices are laid out as:
hdd1: /dev/sda
hdd2: /dev/sdb
Everything, root file system, data files are on this array.

I use mdadm. No problems here.

However, I have a external USB disk attached for daily backups. When I plug this USB disk into the running machine it becomes /dev/sdc. No problem here either.

However, when I boot the system again, the situation becomes:
usb: /dev/sda
hdd1: /dev/sdb
hdd2: /dev/sdc

The result is that the system starts to assemble /dev/sda and /dev/sdb. sda is considered defective or new and mdamd starts to recreate the array.

This is of course an unwanted situation because when it happens, it usually is due to an unexpected reboot event.

I know I can assign UUIDs in fstab, or do things in udev rules, but whatever I do, it is only accessible after the RAID is assembled.

How should I solve this? It is more or less an academic question as I will decommission this server soon, but sooner or later I have to set up something similar.

jlinkels
 
Old 01-06-2013, 10:08 AM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,140

Rep: Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263
You are better off to use partitions with mdadm so that they are labeled as RAID devices. The partitions can be almost as large as the device. It also makes it easier if you have to replace a failed disk.

Make sure you do not have device names in /etc/mdadm.conf. It should build your arrays by the UUID in the RAID superblock.
Code:
MAILADDR root
AUTO -all
DEVICE partitions
ARRAY /dev/md1 UUID=3d29f5be:d6e4d69e:ccbae606:acfd4ebe
I use the "AUTO -all" to prevent mdadm from trying to build any arrays except the ones listed.
 
Old 01-06-2013, 06:53 PM   #3
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Original Poster
Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
I do use partitions, and I have mdadm.conf the way you have it.

The problem seems to be that mdadm cannot distinguish between sda being an external hard disk and sda being a new disk which was inserted to replace a failed disk.

No you have stated this about partitions and mdadm.conf I think it is even more strange that mdadm tries to build this array.

jlinkels
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux HDD serial number from logical drive names sda sdb etc Avirup Linux - Software 3 08-19-2011 04:27 PM
[SOLVED] Grub: If exists sdb, then boot sdb, else sda defaultyeti Linux - Desktop 6 06-28-2011 02:38 AM
Device name confusion (sda VS sdb) Virchanza Linux - General 5 01-11-2010 06:58 AM
Cannot see sda and sdb in CentOS install, only Linux device-mapper soslinux Red Hat 11 01-04-2010 02:00 AM
[SOLVED] Install grub for a filesystem on sdb from a rescue system on sda simonb Linux - General 4 08-27-2009 11:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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