last day (15 days later) » 

3:08 PM
1
A: Doing a disk copy with dd on RAID1 devices on Ubuntu

hidigoudiThis solution only works with same size's drives as you current production drives (931.5G). First step (only for your new drives) Make sure that your new drives have no partition and are clean of data. You can perform these commands to clear drives : wipefs -a /dev/your_new_drive OR / AND dd if...

 
I was thinking of rebooting the system with just one RAID drive at a time, clone that drive, remove the new drive, re-connect the removed RAID drive, reboot, check if all is OK and then repeat the process with the next drive. This way, I am sure that no matter how badly I mess things, at least one RAID drive will be available for the system to be up. I suspect that this may not work in view of grub internal table. What do you think?
 
Theoretically you can do it like that since it's a RAID 1 and all the data are on all the disks (mirroring). You should boot with only 1 drive. Once again, it's only read operations on your current drives.
Be sure that grub is correctly installed on the boot drive. - Note by doing this that mdadm will tagged your both RAID as degraded as you will have only 1 drive for few seconds while the new drive is added.
 
But when both original drives are reconnected and booted, I guess I will have to run mdadm again with appropriate options to get them to sync. If I follow your original approach, after adding the two new drives and then disconnecting them, will mdadm tag them as degraded? Or will min two drives suffice to not tag them as degraded?
 
It will be fine with 2 drives. No sync will be require for original drives. - It's just a temporary state. - With a RAID 1, you don't risk much. - The original drives will only be used to synchronize the 2 new ones.
 
I went thru steps suggested by you but for only one new disk at this time. I find that "mdadm --detail /dev/md0" shows "STATE" of "/dev/sda1" and "/dev/sdb1" as "active sync" while that of the newly added "/dev/sdc1" as "spare" I have not yet added grub-install at this time not knowing if the synchronization is complete. Please HELP!
Please see the section added to my question at the end. It lists the output of mdadm --detail /dev/md0 as well as of "cat /proc/mdstat"
 
3:08 PM
It's fine, you did well, the spare tag is normal as you current RAID has 2 devices. See here : Raid Devices : 2. It does not affect data. You can continue with your last drive.
 
Should it be "grub-install /dev/sdc" or "grub-install /dev/sdc2"? You implied "grub-install /dev/sdc" I need to read on grub to understand this but for now I need to install it. Thanks for all your help
 
It's grub-install /dev/sdc.
 
Done installing grub. Final question: So now I should be able to boot with just /dev/sdc connected without the other two drives though I plan to have another drive added to the RAID too. If I can boot the system with just the new drive, then the newly added RAID drive is kind of complete backup of the system as of today.
 
Exactly, RAID 1 also called mirroring has the exact same data on all disks. All drives are exactly the same (after the resync).
 
Thought that was the final question. I tried to boot with just the new drive and I got the error: disk 'mduuid....' not found. Entering rescue mode. Then there is the "grub rescue>' prompt.
 
3:08 PM
Ok, yes it's an error with the UUID of the disk. Indeed, I will add this information in my answer. Could you please reboot with your original drives + your 2 new one ? Thanks.
Already is fine, you just need to change the disk attached in this file : /etc/mdadm/mdadm.conf
 
I am a little nervous now because I had added just one drive. WHen I reboot now with all three drives, I get error "symbol grub_calloc not found' Entering rescue mode.
 
Reboot with your 2 original drives
 
I tried to reboot with just the two drives and get the same error of 'symbol grub_calloc not found"
 
What was the state of raids before you reboot ?
 
It was the state I showed you.
I presumed that everything had synced
 
3:22 PM
Yes active I see it
Ok, have you perform a grub-install /dev/sda ?
Or grub-install /dev/sdb ?
 
No. I only did a grub-install /dev/sdc
 
Ok
Right
 
sudo grub-install /dev/sdc
[sudo] password for tare3:
Installing for i386-pc platform.
Installation finished. No error reported.
 
So you tried to reboot with your 2 original drives ?
And same error ?
 
Yes. And the same error whether I reboot with 2 original drives or 2 original plus new one.
I also tried to switch the two Sata cables between the two drives just in case I had switched them by mistake later. Still same issue.
 
3:25 PM
It's weird, I performed this process several times, I never got this issue.
Do you have a systemrescuecd USB ?
 
No. Sorry.
I hope that the other partitions are intact
 
All is intact, it's just a boot issue
Could you please try to boot with only one original disk ?
 
OK. Will try. It is a Intel Server. Is the UEFI in play here?
 
I don't think so
You don't have /boot/efi partition
 
Tried with just one drive. Same messages... grub_calloc not found
 
3:31 PM
Do you know if it is /dev/sda or /dev/sdb ?
 
I tried with both drives, singly. Same messages.
I do not know which is /dev/sda or /dev/sdb
I feel that there was no need to run that final command of grub-install but then it was run on only /dev/sdc
 
There is no reason why it cannot boot with all 3 disks.
I perform this process few weeks ago
With my local NAS
I have a disk in space as yours
I rebooted well
 
Let me try again with all three disks. I really need you to help me out of this situation. Please...
 
Yes I know do not worry
The next step is create a bootable USB systemrescue
With it, we will retrieve our both raid
 
Finally some luck. I pressed F6 to get boot menu. I first tried to boot from one disk. It gave the same error. Then I tried another and it booted!
 
3:42 PM
Ok great
Pretty weird
You shouldn't have to press F6
But it's fine
Now we need to be sure that everything is ok
Could you please give me the content of this file : /etc/mdadm/mdadm.conf
And then : blkid
 
# mdadm.conf
#
# !NB! Run update-initramfs -u after updating this file.
# !NB! This will ensure that initramfs has an uptodate copy.
#
# Please refer to mdadm.conf(5) for information about this file.
#

# by default (built-in), scan all partitions (/proc/partitions) and all
# containers for MD superblocks. alternatively, specify devices to scan, using
# wildcards if desired.
#DEVICE partitions containers

# automatically tag new arrays as belonging to the local system
HOMEHOST <system>

# instruct the monitoring daemon where to send mail alerts
:~> blkid
/dev/sda1: UUID="cec496a6-b34b-de28-4a56-871f8dffc234" UUID_SUB="0245b4e6-7311-ec3d-9ab1-316699224a4f" LABEL="august2018:0" TYPE="linux_raid_member" PARTUUID="e78f1647-01"
/dev/sda2: UUID="b2f276cf-f094-d73e-ffcc-df64ef2f21aa" UUID_SUB="67022a94-c6c2-38c9-d31d-c2e4d4dab2c3" LABEL="august2018:1" TYPE="linux_raid_member" PARTUUID="e78f1647-02"
/dev/sdb1: UUID="cec496a6-b34b-de28-4a56-871f8dffc234" UUID_SUB="a45bcbad-5466-f18f-86a3-c04e6b79f5ae" LABEL="august2018:0" TYPE="linux_raid_member" PARTUUID="ee3b4e44-01"
 
Here is the definition of your both Array (md0 and md1)
Seems good to me
As you can see
the "UUID" of md0 matches with all /dev/sdX1
And the "UUID" of md1 with all /dev/sdX2
This is a good thing
 
I checked sudo mdadm --detail /dev/md1 and for md0 too and states are stable.
 
Great normal !
;)
Please let me 2 minutes
I need to check something
 
Of course. You are my savior today.
 
3:48 PM
ok I think, the best is to install grub also on /dev/sda and /dev/sdb
grub-install /dev/sda
grub-install /dev/sdb
To be sure that grub is installed everywhere
then : update-initramfs -u
Now you can try to reboot without pressing F6
To see the behavior
 
I am a little nervous to touch those old disks. I think grub must have been installed on those disks otherwise they would not have booted earlier. What I suggest is that I try F6 and select all three drives and see if it cannot boot from any specific ones from the old ones. If it can boot only from the new drive than we can be sure thats the problem. What say you?
 
yes it's fine
You can try
It doesn't impact anything
Because if your BIOS select a disk that does not have grub, obviously it can't boot
 
Here is the diagnosis. It boots only with all three drives connected and if booted from the new drive.
I mean if booted from the new drive after pressing F6.
Should I proceed with grub-install on the other two drives? and then run update-initramfs -U?
 
Yes
Let me know
 
4:06 PM
All done. Now I will reboot and pray :)
 
This should be fine
There is litterally no reason
 
Yes. It booted!!! Will it boot with just the new drive installed? Or just the two old drives? Let me first see the state of RAID, lsblk, etc.
Let me try to boot with just the two old disks. Then with just one new disk.
 
Theoretically, it should boot on all disks.
As you installed grub on all disks
The only thing you will have is a degraded raid if you boot only on 1 drive
 
4:21 PM
It boots on all disks. It also boots on only two old disks. But it does not boot on just the new one. Gives the original error of md uuid not found or something like that which I listed earlier. This was the whole purpose of this exercise. Of course I have learnt a lot and there is no damage done as the system boots with two and three too. Anything that can be done to boot just with that one new drive?
 
Ok sound good and normal to me, I think that it does not boot on the new drive because it is a spare one
 
It did boot on just the old single drive. So thats fine too. I guess the spare drive is not bootable. When you have time can you post some way to do that by editing your answer. For now, I am fine. Do not want to take any more of your time. But please, when time permits, let me know how I can make the third drive bootable. DO NOT KNOW HOW TO THANK YOU FOR YOUR PATIENCE AND HELP.
 
No problem ! It's normal ;)
I will edit my answer for that no problem
 
5:16 PM
Done, I added information to extend raid devices number inside your arrays
With those, it should boot on all drives individually
 

last day (15 days later) »