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
-
Good evening,
I have got following problem on my fresh installed SME9.1 after the migration from SME8:
- Situation:
- SME9.1, RAID1, NoLvm, only 1 disk during the installation and configuration.
- Now that everything work and I put the disk#2 inside.
- The disk#2 has (or should have...) the same size than the disk#1. All existing partitions get deleted before and a new partition table (msdos) has been created.
- Start the sync of the RAID from the console.
- md2 don't get sync.
#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>
# mdadm --manage /dev/md2 --add /dev/sdb2
mdadm: /dev/sdb2 not large enough to join array
# fdisk -s /dev/sda2
4096000
# fdisk -s /dev/sdb2
4094017
Ideas:
- with a live CD (systemrescuecd): delete and recreate the md2
- stop md2: mdadm --stop md2
- remove md2: mdadm --remove md2
- remove the superblocks: mdadm --zero-superblock /dev/sda2 /dev/sdb2
- recreate md2: sudo mdadm --create /dev/md2 --level=1 --assume-clean --raid-devices=2 /dev/sda1 /dev/sdb2
- create a swap file system on md2: ???command???
- with a live cd: reduce the size of md2, add sdb2 and re-increase the size
- reduce the size of the swap file system: ???command???
- reduce the size of md2: ?????command?????
- add sdb2 to the raid: mdadm --manage /dev/md2 --add /dev/sdb2
- increase the size of the raid: mdadm --grow /dev/md2 --size=max
- increase the size of the file system: resize2fs /dev/md2 ## does this command work for a swap??
Questions:
why not idea 1?
why not idea 2?
which is the proper way to get sdb2 into the md2?
Thanks.
Regards Arnaud
-
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
-
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 :-)
-
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
-
Good evening,
# 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 ?
-
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
-
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
- for the commands (I'm curious to see what happen)
- for the installation on the disk#2 first to see if disk#1 is still bigger.....
Thanks!
Regards Arnaud
-
Arnaud
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
-
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:
- stop the swap
- delete the RAID device
- recreate it with the partitions of both disks and with the original UUID
- recreate the swap partition, with the original UUID
- reboot
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
-
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
-
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.
what about centralizing all the knowledge in a single place?
It is .........dangerous..... :-P
Bye
Arnaud
-
Arnaud
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.
-
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".
-
You are right: avoiding the problem to come is better than solving it!
ASAP: my sme was 3 days offline...... :sad:
-
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
-
The instructions are now in the contribs's wiki: https://wiki.contribs.org/Repairing_RAID_of_the_swap :cool:
Bye
Arnaud
-
Hi Arnaud,
thanks for the wiki page. Can we ahve a look to make it more descriptive and organized please?
Thanks,
guest
-
....of course!
I'm not against improvements!
Bye.
Arnaud
-
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
-
I never had such an issue
Anyway please raise a bug asap, TIA