LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 05-13-2024, 03:10 PM   #1
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,593

Rep: Reputation: 180Reputation: 180
Rename mdadm device


I was having some trouble with the boot partition(s) of my RAID-1. My fstab has this as /dev/md2. When I booted from the DVD to check things, /proc/mdstat showed it as /dev/md125, not /dev/md2. I ran the following in an attempt to rename it correctly:
Code:
mdadm --stop /dev/md125
mdadm --assemble /dev/md2 --name=2 --update=name /dev/sda3 /dev/sdb3
but I got:
Code:
mdadm: Merging with already-assembled /dev/md/125
Apparently, I didn't do this right. What is the correct procedure?

Thanks
 
Old 05-13-2024, 11:42 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,147

Rep: Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124
Why do you think you need to do this ?.

You're in a recovery environment, it's just a device name - mount it and check the data. Seems you already have enough problems without inventing new ones.
 
Old 05-14-2024, 02:53 AM   #3
lvm_
Member
 
Registered: Jul 2020
Posts: 970

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
It is the correct procedure, albeit transient, place to store array configuration permanently is /etc/mdadm.conf. What is the status of the array after it is stopped? (cat /proc/mdstat, mdadm -D)
 
Old 05-15-2024, 12:29 AM   #4
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,593

Original Poster
Rep: Reputation: 180Reputation: 180
Quote:
Originally Posted by syg00 View Post
Why do you think you need to do this ?.

You're in a recovery environment, it's just a device name - mount it and check the data. Seems you already have enough problems without inventing new ones.
Hmmm, never thought of that. Maybe it would have been fine once I rebooted back to that as the actual boot drive.
Quote:
Originally Posted by lvm_ View Post
It is the correct procedure, albeit transient, place to store array configuration permanently is /etc/mdadm.conf. What is the status of the array after it is stopped? (cat /proc/mdstat, mdadm -D)
In the "recovery environment" there id no mdadm.conf. On the device in question it is:
Code:
ARRAY /dev/md0 metadata=0.90 UUID=dd5f03be:1895e50c:208cdb8d:9e23b04b
So maybe syg00 is right. The thing is I've booted to recovery numerous time in the past on other RAID configred systems and never noticed a /dev/md125 before. That's what threw me off -- along with numerous posts on how to (supposedly) rename the array. Also, the RAID is initially created from the setup DVD with 'mdadm --create /dev/md0 ...' not md125, but of course, there is still no mdadm.conf on subsequent boots from the DVD. AND, the other partition was still /dev/md1, not something "made up". All this confused me.

Right now, I've temporarily restored the boot drive image to a non-RAID device to get the machine up and running for production. I will re-stage these on a RAID config very soon and I'll check to see what the devices look like when I boot from DVD.

Last edited by mfoley; 05-15-2024 at 12:36 AM.
 
Old 05-15-2024, 01:01 AM   #5
lvm_
Member
 
Registered: Jul 2020
Posts: 970

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
Quote:
Originally Posted by mfoley View Post
In the "recovery environment" there id no mdadm.conf.
Oh, missed that - then why bother? It doesn't affect how the device is called after the normal boot. Device name you are used to is stored in mdadm.conf, it is because it is unavailable the name has changed. But the fact that device won't stop properly still indicates an issue.
 
Old 05-17-2024, 05:02 PM   #6
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,593

Original Poster
Rep: Reputation: 180Reputation: 180
I'm trying to do tests on various aspects of this issue. I booted from the installation DVD with the only the former sda member of the RAID-1 installed. I was pretty sure I have formatted those partitions back to 82 'Linux swap' and 83 'Linux' and fdisk shows that:
Code:
$ fdisk -l /dev/sda
Disk /dev/sda: 1.82 TiB, 2000398934016 bytes, 3907029168 sectors
Disk model: ST32000542AS    
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xb2b13a31

Device     Boot    Start        End    Sectors  Size Id Type
/dev/sda1           2048   16779263   16777216    8G 82 Linux swap
/dev/sda2  *    16779264 3907029167 3890249904  1.8T 83 Linux
However, it still shows as a RAID:
Code:
cat /proc/mdstat
Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5] [raid4] [multipath] 
md0 : active raid1 sda1[0]
      8388544 blocks super 1.0 [2/1] [U_]
      
unused devices: <none>
What's up with that? I did 'mdadm --stop /dev/md0', deleted /etc/mdadm.conf from /dev/sda2, and rebooted. Same thing. It's still showing md0.

Why?

Last edited by mfoley; 05-17-2024 at 05:14 PM.
 
Old 05-18-2024, 02:11 AM   #7
lvm_
Member
 
Registered: Jul 2020
Posts: 970

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
Re-partitioning doesn't remove raid superblock, use 'mdadm --zero-superblock'
 
1 members found this post helpful.
Old 05-20-2024, 12:46 AM   #8
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,593

Original Poster
Rep: Reputation: 180Reputation: 180
Quote:
Originally Posted by lvm_ View Post
Re-partitioning doesn't remove raid superblock, use 'mdadm --zero-superblock'
Good to know! I'll add that to my documentation for the next.

Meanhile, I've formatted these drives to be RAID-1 members again and restored the backups. All seems to be working so I'll put this RAID back into production.
 
  


Reply

Tags
mdadm, rename



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
How to backup MDADM super blocks and other tips I should know about mdadm? road hazard Linux - Newbie 5 08-04-2016 12:21 AM
[SOLVED] Attempts to work around a mdadm bug/ mdadm cannot get exclusive access to /dev/md127 Sereph Linux - Newbie 1 08-16-2011 03:21 AM
MDADM screws up the LVM partitions? Can't mount the LVMs after mdadm stopped alirezan1 Linux - Newbie 3 11-18-2008 04:42 PM
unable to load MDADM module BUT mdadm works?!?!?! alirezan1 Linux - Software 2 09-08-2008 07:58 PM
mdadm says "mdadm: /dev/md1 not identified in config file" when booting FC7 raffeD Linux - Server 1 08-11-2008 11:47 AM

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

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