Koozali.org: home of the SME Server

Obsolete Releases => SME Server 9.x => Topic started by: Arnaud on February 01, 2016, 09:22:29 PM

Title: [solved] Issue by sync of the RAID for /swap
Post by: Arnaud on February 01, 2016, 09:22:29 PM
Good evening,

I have got following problem on my fresh installed SME9.1 after the migration from SME8:

- Situation:


Code: [Select]
#cat /proc/mdstat
Personalities : [raid1]
md0 : active raid1 sdb1[2] sda1[0]
      255936 blocks super 1.0 [2/2] [UU]
     
md1 : active raid1 sdb3[2] sda3[0]
      972277760 blocks super 1.1 [2/2] [UU]
      bitmap: 5/8 pages [20KB], 65536KB chunk

md2 : active raid1 sda2[0]
      4093952 blocks super 1.1 [2/1] [U_]
     
unused devices: <none>
Code: [Select]
# mdadm --manage /dev/md2 --add /dev/sdb2
mdadm: /dev/sdb2 not large enough to join array

Code: [Select]
# fdisk -s /dev/sda2
4096000

# fdisk -s /dev/sdb2
4094017

Ideas:

Questions:
why not idea 1?
why not idea 2?
which is the proper way to get sdb2 into the md2?

Thanks.
Regards Arnaud
Title: Re: Issue by sync of the RAID for /swap
Post by: Stefano on February 01, 2016, 11:07:01 PM
your best bet, to avoid any kind of problem, is to backup your server, reinstall SME on the smaller disk, restore your backup, then add the bigger disk to the array.

I won't play with partitions

my 2c
Title: Re: Issue by sync of the RAID for /swap
Post by: TerryF on February 01, 2016, 11:10:40 PM
your best bet, to avoid any kind of problem, is to backup your server, reinstall SME on the smaller disk, restore your backup, then add the bigger disk to the array.

Took the words right out of my mouth.

I'll chuck in another 2c :-)
Title: Re: Issue by sync of the RAID for /swap
Post by: janet on February 02, 2016, 12:17:30 AM
Arnaud

Maybe you did not clear the MBR on the second drive (as you seem to have old partition info).
https://wiki.contribs.org/Raid#Reusing_Hard_Drives
Title: Re: Issue by sync of the RAID for /swap
Post by: ReetP on February 02, 2016, 12:31:55 PM
Good evening,

Code: [Select]
# fdisk -s /dev/sda2
4096000

# fdisk -s /dev/sdb2
4094017

409 6000 >= 409 4017

So that seems like sdb2 is smaller than sda2 or am I blind ?
Title: Re: Issue by sync of the RAID for /swap
Post by: Stefano on February 02, 2016, 12:35:04 PM
409 6000 >= 409 4017

So that seems like sdb2 is smaller than sda2 or am I blind ?

yes, and that's the problem.. I had a similar issue many years ago.. apparently same disks (brand, model, capacity) but a slight difference in size..
obviously, following Murphy's law, system was setup on a single disk only, the bigger ;-)

backup, reinstall (on the smaller), restore.. that's the (safe) way
Title: Re: Issue by sync of the RAID for /swap
Post by: Arnaud on February 02, 2016, 09:46:29 PM
Hello,

and many thanks for your replies !
even if I would have hoped other indications..... something in direction of a few magic commands......

Maybe you did not clear the MBR on the second drive (as you seem to have old partition info).
https://wiki.contribs.org/Raid#Reusing_Hard_Drives
No, I didn't....
But I can try it: there is nothing to loose. But AFAIM this will not change anything because MBR is for grub and not for datas

yes, and that's the problem.. I had a similar issue many years ago.. apparently same disks (brand, model, capacity) but a slight difference in size..
obviously, following Murphy's law, system was setup on a single disk only, the bigger ;-)
It is exactly the situation.

 
Last evening, I quickly installed another sme9 with the same parameters (raid1, nolvm, only 1 disk) as a VM for tests and I gave it the second disk after the install. It gave the same result: no raid sync on md2 because of a smaller disk --> I wonder that it happen again.......
On my real sme9, I already have taken the disk#2 away a second time for re-deleting the partitions and partition-table after the first flop of syncing the raid. The Gparted of my Fedora gave me this kind of warning message by reading this disk (coming out of the sme9): "the partition can be outside of the disk" --> could it be possible that Anaconda makes a different (not very correct??) partitioning than during an afterward sync??

backup, reinstall (on the smaller), restore..
I hope that the second installed disk isn't seen automatically smaller than the first one!!

As it is "only" the swap, I don't feel in a hurry, so I will further use the VM for tests


Thanks!
Regards Arnaud
Title: Re: Issue by sync of the RAID for /swap
Post by: janet on February 02, 2016, 09:56:46 PM
Arnaud
 
Quote
No, I didn't....
But I can try it: there is nothing to loose. But AFAIM this will not change anything because MBR is for grub and not for datas

All (both) disks should be erased using the commands referred to.
Another old tool is delpart, I think that will do the job also.

Quoting:
If it was ever installed on a Windows machine (or in some cases an old system) then you will need to clear the MBR first before installing it.
From the linux command prompt, type the following:
dd if=/dev/zero of=/dev/hdx bs=512 count=1
dd if=/dev/zero of=/dev/sdx bs=512 count=1
Title: Re: Issue by sync of the RAID for /swap
Post by: Arnaud on February 06, 2016, 05:00:01 PM
Hello,

because I wanted to avoid to wait 5h for the restoration of the backup in addition to some supplementary hours to reinstall all the contribs, I tried to get it run without starting from zero.

In fact it is very easy to solve, ..............as soon as the right method is known...... 8-) Further more, the sme can run without swap --> I didn't have to stop the server!
The main steps were given in the first post:

The details are given here https://wiki.guedel.eu/doku.php?id=Welcome:SME-server:Rebuild%20RAID

Reusing the original UUID makes the things very simple: all the parameters are still valid and don't need any modification.

Bye
Arnaud
Title: Re: [solved] Issue by sync of the RAID for /swap
Post by: Stefano on February 06, 2016, 05:27:30 PM
glad to hear that you solved you issue..

Arnaud, is that wiki yours? if so, would you mind to add that page in our wiki too?

what about centralizing all the knowledge in a single place? :-)

TIA
Title: Re: [solved] Issue by sync of the RAID for /swap
Post by: Arnaud on February 06, 2016, 06:37:43 PM
Arnaud, is that wiki yours? if so, would you mind to add that page in our wiki too?
Yes, no!   :-D

Of course I can (and will) do it if it is wished and recognized as "best practice deserving to be pinned".
I just wanted to avoid top pollute the "official" wiki with every small trick.

Quote
what about centralizing all the knowledge in a single place?
It is .........dangerous.....  :-P

Bye
Arnaud
Title: Re: [solved] Issue by sync of the RAID for /swap
Post by: janet on February 07, 2016, 12:04:17 AM
Arnaud

Quote
I just wanted to avoid to pollute the "official" wiki with every small trick.

Adding small tricks (as you call them) to the contribs.org wiki, is a good thing to do. People can then find a wealth of information for various workarounds & fixes etc.
Tips like this one can certainly aid troubleshooting.

Title: Re: Issue by sync of the RAID for /swap
Post by: CharlieBrady on February 07, 2016, 04:26:29 AM
Last evening, I quickly installed another sme9 with the same parameters (raid1, nolvm, only 1 disk) as a VM for tests and I gave it the second disk after the install. It gave the same result: no raid sync on md2 because of a smaller disk --> I wonder that it happen again.......

Please report all the details carefully in the bug tracker. Perhaps someone can come up with a fix so that it all "just works".
Title: Re: [solved] Issue by sync of the RAID for /swap
Post by: Arnaud on February 08, 2016, 10:17:29 PM
You are right: avoiding the problem to come is better than solving it!

ASAP: my sme was 3 days offline...... :sad:
Title: Re: [solved] Issue by sync of the RAID for /swap
Post by: Stefano on February 09, 2016, 09:47:42 AM
Please report all the details carefully in the bug tracker. Perhaps someone can come up with a fix so that it all "just works".

well.. IMO there's nothing that can be fixed.. if you install SME on a single disk (raid1 degraded) and then add a disk which is smaller... :-)

the real fact is that with a reasonable amount of ram you can live without swap, at least temporarily.. and then you can resize swap partition
Title: Re: [solved] Issue by sync of the RAID for /swap
Post by: Arnaud on February 10, 2016, 09:13:00 PM
The instructions are now in the contribs's wiki: https://wiki.contribs.org/Repairing_RAID_of_the_swap  :cool:

Bye
Arnaud
Title: Re: [solved] Issue by sync of the RAID for /swap
Post by: guest22 on February 10, 2016, 10:52:08 PM
Hi Arnaud,


thanks for the wiki page. Can we ahve a look to make it more descriptive and organized please?


Thanks,
guest





Title: Re: [solved] Issue by sync of the RAID for /swap
Post by: Arnaud on February 11, 2016, 03:51:19 PM
....of course!

I'm not against improvements!

Bye.
Arnaud
Title: Re: [solved] Issue by sync of the RAID for /swap
Post by: Arnaud on February 11, 2016, 09:02:39 PM
well.. IMO there's nothing that can be fixed.. if you install SME on a single disk (raid1 degraded) and then add a disk which is smaller... :-)
The bug is that the second disk isn't smaller than the first!
I made following experience on the VM:
- 2 disks defined with 20GB
- installation on disk#1 and add disk#2 later --> disk#2 too small
- erase both disks (NOT create others!)
- installation on disk#2 and add disk#1 later --> disk#1 too small.....
--> the last added disk is seen smaller than the first one in any cases.

IMHO it isn't normal.

Bye
Arnaud

Title: Re: [solved] Issue by sync of the RAID for /swap
Post by: Stefano on February 11, 2016, 09:17:17 PM
I never had such  an issue
Anyway  please raise a bug asap, TIA