LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 02-05-2020, 12:17 AM   #1
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 1,728

Rep: Reputation: 136Reputation: 136
Does the physical drive matter when restoring an mdadm RAID?


I have a tar backup of a RAID-1, /dev/md0 (actually backing up from /). I would like to restore this to a physically different computer that also has RAID-1 configured. There is no doubt I can do the restore, my concern is whether there is anything in the RAID config (UUID?) that references the specific hard drives of the original machine. Note that the /etc/mdadm.conf of the source machine will also get restored to the target machine.

Will a restore to the target machine's / (/dev/md0) work without problem, or do I have to re --assemble, or something?
 
Old 02-05-2020, 12:32 AM   #2
berndbausch
Senior Member
 
Registered: Nov 2013
Location: Tokyo
Distribution: A few
Posts: 4,321

Rep: Reputation: 1229Reputation: 1229Reputation: 1229Reputation: 1229Reputation: 1229Reputation: 1229Reputation: 1229Reputation: 1229Reputation: 1229
Apart from mdadm.conf, I don't think there is anything in your filesystem that references the array. The filesystem doesn't know that it exists on a RAID.

Each array member has two UUIDs in the RAID superblock: One UUID that identifies the array (i.e. all array members have the same array UUID), and one UUID that identifies the disk (i.e., each disk has its own). I am not sure if a wrong UUID in /etc/mdadm.conf causes a problem; to be certain, you could exclude mdadm.conf from the restore and recreate it later. Current versions of MDRAID work fine without mdadm.conf; you only need it for things like the notification mail address.

EDIT: My source for the statement in the last sentence is https://raid.wiki.kernel.org/index.p...ck_.282011.29:
Quote:
It's not a bad idea to maintain a consistent /etc/mdadm.conf file, since you may need this file for later recovery of the array, although this is pretty much totally unnecessary today.

Last edited by berndbausch; 02-05-2020 at 12:35 AM.
 
1 members found this post helpful.
Old 02-06-2020, 05:57 PM   #3
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 1,728

Original Poster
Rep: Reputation: 136Reputation: 136
berndbausch: thanks for the feedback. I went ahead and tried restoring two different machine backups to the target computer and it worked just fine. The only annoyance was that the backup machines had /dev/md0 configured as boot and /dev/md1 configured as swap and on the target machine that was reverse. To fix that I edited /etc/fstab, /etc/lilo.conf and /etc/mdadm.conf and flipped the /dev/mdX values after the restore and reran lilo, and it booted without problem. In fact, on the 2nd machine restore I forgot to modify /etc/mdadm.conf and it still booted and did not appear to confuse mdadm.

In case you (or anyone) is wondering why I'm doing this, our internal auditor wanted us to routinely restore our Webserver and AD/DC servers from backup to verify the backups are good and can be restored. I created a VERIFY computer that will be used quarterly to restore these backup tarfiles and verify booting.
 
Old 02-06-2020, 06:58 PM   #4
berndbausch
Senior Member
 
Registered: Nov 2013
Location: Tokyo
Distribution: A few
Posts: 4,321

Rep: Reputation: 1229Reputation: 1229Reputation: 1229Reputation: 1229Reputation: 1229Reputation: 1229Reputation: 1229Reputation: 1229Reputation: 1229
Quote:
Originally Posted by mfoley View Post
The only annoyance was that the backup machines had /dev/md0 configured as boot and /dev/md1 configured as swap and on the target machine that was reverse.
You just discovered that non-persistent storage device names can cause headaches. /dev/sda, /dev/md127, /dev/dm-0 and the like are not reliable names; external influences like adding or removing devices can change those names.

MD RAID has persistent names in the /dev/md directory. Persistent names for disks are found in the subdirectories of /dev/disk. They are based on device characteristics that won't change, are extremely unlikely to change, or are under the admin's control, like labels, UUIDs, PCI and SCSI addresses etc.

Last edited by berndbausch; 02-06-2020 at 06:59 PM. Reason: added dm-0
 
  


Reply

Tags
mdadm


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
Downloading A file from Pysical Windows HDD to Redhat Enterprise Linux VM Kfournier Linux - Enterprise 1 03-24-2018 02:37 PM
how to fix Blue screen pysical memory eror PLeaese help me nice_nomi27 General 2 04-06-2011 10:56 AM
Memdisk and pysical disk access exvor Linux - Software 0 10-09-2007 06:13 PM

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

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