Koozali.org: home of the SME Server

How to 'expand' noraid to raid1

Offline tlicht

  • ***
  • 56
  • +0/-0
  • Imagination is more important than knowledge.
How to 'expand' noraid to raid1
« on: June 22, 2014, 10:20:17 AM »
I had an advetureous install of 8.1 and when I finally succeded I used the noraid command line option thinking that having only one drive the default raid1 might be the reason for recurring install failures - as far as I know it might have....

Now I have added a second identical drive and would like to convert the server to raid 1.
This is probably a stupid question, but I have tried to find hints regarding this with poor result - I did find a probably pretty good set of instructions here http://www.howtoforge.com/software-raid1-grub-boot-debian-etch but when examining the disk layout I got this (in Swedish):

[root@sme1 ~]# fdisk -l

Disk /dev/sda: 2000,3 GB, 2000398934016 byte
255 heads, 63 sectors/track, 243201 cylinders
Enheter = cylindrar av 16065 · 512 = 8225280 byte

    Enhet Start     Början        Slut     Block    Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14      243201  1953407610   8e  Linux LVM

Disk /dev/sdb: 2000,3 GB, 2000398934016 byte
110 heads, 44 sectors/track, 807237 cylinders
Enheter = cylindrar av 4840 · 512 = 2478080 byte

    Enhet Start     Början        Slut     Block    Id  System
/dev/sdb2               1      807237  1953512448    f  W95 Utökad (LBA)
/dev/sdb5               1      807237  1953511424   83  Linux


which is about what I expected for the sda disk but fstab seems to have different name/mount point for sda2 - pretty confusing for me:
BTW: as you see I did use the second drive to back up my previous sme server 7.6 ibays.

[root@sme1 ~]# df -h
Filsystem          Storlek Använt Tillg Anv% Monterat på
/dev/mapper/main-root
                      1,8T  1,2T  574G  67% /
/dev/sda1              99M   17M   78M  18% /boot
tmpfs                 914M     0  914M   0% /dev/shm
[root@sme1 ~]#


I imagine that there might be an mdadm command to fix the change from noraid to raid1, but I can't seem to find any documentation on that...
Another strange thing (for me!) is that while fdisk reports the expected sda1 and sda2 partitions fstab seems to have /dev/mapper/main-root for that partition - and where does the swap end up? Is tmpfs the swap?
Many questions....
Grateful for sharing your expertise!  :-?

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: How to 'expand' noraid to raid1
« Reply #1 on: June 22, 2014, 05:28:14 PM »
I had an advetureous install of 8.1 and when I finally succeded I used the noraid command line option thinking that having only one drive the default raid1 might be the reason for recurring install failures

Did you report any of your recurring install failures via the bug tracker? It should "just work".

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: How to 'expand' noraid to raid1
« Reply #2 on: June 22, 2014, 05:30:42 PM »
Now I have added a second identical drive and would like to convert the server to raid 1.

Remove your hard drive and do a fresh raid1 install on the new drive. Then do a restore from backup (your "backup" is the current noraid drive you have. I believe there's instructions somewhere on the wiki for how to "restore" from an existing drive.

AFAIK, there's no way to convert a single noraid drive to a raid1 pair.

Offline tlicht

  • ***
  • 56
  • +0/-0
  • Imagination is more important than knowledge.
manually copyRe: How to 'expand' noraid to raid1
« Reply #3 on: June 22, 2014, 06:28:03 PM »
Hi Charlie,
No I just asked for help here - and managed finally - maybe the problem was the hard drive I tried to use, but I am really not sure...

Regarding the fresh raid1 restore - I don't sem to be able to find restore from an exisiting drive. If I after a fresh install on the new drive connect the current noraid drive, I am afraid that the server will just create the raid1 with the new installation as 'master' and reformat the noraid drive.... but naturally I can do the fresh install and then after configring the server with just one drive connect the noraid drive via usb and manually copy the 1.5 TB of ibay data I am trying to 'save'...

Or is there a smoother way that I am missing?

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: manually copyRe: How to 'expand' noraid to raid1
« Reply #4 on: June 23, 2014, 09:57:11 PM »
tlicht

Please familiarize yourself with available Howtos, link at top of forums.
See
http://wiki.contribs.org/UpgradeDisk
& follow instructions completely, especially the commands you need to issue BEFORE removing the existing drive from the current working "one drive" system.
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline tlicht

  • ***
  • 56
  • +0/-0
  • Imagination is more important than knowledge.
Re: How to 'expand' noraid to raid1
« Reply #5 on: June 24, 2014, 01:40:14 AM »
Thank you Janet,

I have actually read that page already and now again but still cannot find if and how this could be applied to a system that was set up as a noraid system with one disk only - but I might fail to understand some finer points hidden there.... Could you please point me to the right direction.

Offline stephdl

  • *
  • 1,523
  • +0/-0
    • Linux et Geekeries
Re: How to 'expand' noraid to raid1
« Reply #6 on: June 24, 2014, 07:50:57 AM »
you cannot use that page, you don't install your sme in a standard way (raid+lvm), since you have installed the sme without raid, you should search about a tutorial on 'Raid and centos5' or try to use that software http://raider.sourceforge.net/

i should advice to do what is needed to install your sme in a standard way else you will always be annoyed.

But in case raider works, please set up a tutorial in the wiki.
See http://wiki.contribs.org/Koozali_Foundation
irc : Freenode #sme_server #sme-fr

!!! Please write your knowledge to the Wiki !!!

Offline tlicht

  • ***
  • 56
  • +0/-0
  • Imagination is more important than knowledge.
Re: How to 'expand' noraid to raid1
« Reply #7 on: June 24, 2014, 11:32:17 AM »
Thank you stephdl,
Raider is a novelty for me - intriguing... but:
I have two 'copies' of my data (1.5 TB) on two identical sata disks: one on the noraid server and one on the disk that I intend to add as part of the raid1. If raider failes  I am afraid I may loose my photos, music etc. - too much of a gamble for me....
So I think I'll do it the 'traditional' or 'hard' but certainly the slow way:
  • remove the functioning noraid server disk (disk1) from the computer (will be my backup for a while)
  • install sme 8.1 on the other hard drive (disk2) in raid1 mode
  • connect and mount disk1 via usb to the 'new' server and copy the data to the corresponding ibays on disk2 (now the actual server)
  • finally add disk1 as the second disk to the server - which then should automagically be formatted, partitioned and installed by the server on disk2.
This way I hope to have at least one good copy of my data all the time ...



Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: How to 'expand' noraid to raid1
« Reply #8 on: June 24, 2014, 04:08:14 PM »
So I think I'll do it the 'traditional' or 'hard' but certainly the slow way:
  • remove the functioning noraid server disk (disk1) from the computer (will be my backup for a while)

Be sure you have read and understood Janet's advice before you do that.

Offline tlicht

  • ***
  • 56
  • +0/-0
  • Imagination is more important than knowledge.
Re: How to 'expand' noraid to raid1
« Reply #9 on: June 24, 2014, 11:31:41 PM »
Read and read again, but not understood  :-o
Janet's link seems to be about upgrading and adding an extra disk.
If I am not compoletely mistaken just removing the noraid disk from a single disk computer will not alter anything on the disk.
Next I intend to install and configure a new server with just the second disk in the computer - this time without the noraid option.
With that working I will connect the noraid disk via usb and mount it. From the noraid disk then I will copy my data (photos, music etc) to the configured ibays on the new server. Then I will again have two copies of my data: one on the new server and one on the noraid disk.
Finally connecting the noraid disk the normal SATA way, possibly after reformating, the server will reconstruct the raid1 it actually never was, but intended to be.
Am I completely off target?

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: How to 'expand' noraid to raid1
« Reply #10 on: June 25, 2014, 12:23:30 AM »
tlicht

Quote
Read and read again, but not understood
Janet's link seems to be about upgrading and adding an extra disk.

How could you not understand what the Howto is about ? It is clearly stated on the first few lines, quoted here now:

Introduction

Hard drive restore requires a complete system. It is meant to take a hard drive from a system, mount it, and do a restore from it.


The method described does relate to installing a larger hard drive & restoring all data & settings to it from a previously configured sme server, without needing to do a backup first. It is a valid answer to your request AFAICT.

Run the comands advised on the old system, then physically disconnect the drive.
Add one or two new blank drives to the system, install sme server OS from CD typically as a RAID1 array, & do any basic configuration. Reconnect the old drive from previous system, mount it as described, then perform a restore directly from the mounted drive.
Follow instructions carefully, & I STRONGLY suggest you do a trial run to sort out procedures & problems you may encounter due to lack of understanding or experience etc. I am not sure about suggestions/comments about no lvm, so see how you go.
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: How to 'expand' noraid to raid1
« Reply #11 on: June 25, 2014, 02:13:36 AM »
tlicht

Quote
Now I have added a second identical drive and would like to convert the server to raid 1.

To also further answer your original post, the usual way to do this is by doing a backup, then build a new RAID1 system & then restore from backup.
The underlying drive structure does not matter.

You can backup your one drive non RAID server, using the admin console menu to manually instigate a backup to an attached USB drive (which must be formatted as ext3). Alternatively use the server manager Backup to workstation function, to backup to a locally connected USB drive (also formatted as ext3).

Then you build the new server by removing the single non RAID drive, insert one or two clean & blank drives (with no partition information on them), & install sme server from CD as RAID1.

Then restore from your USB backup, either at first boot if you are using the console backup, or by using the server manager Restore function, if you did the backup in server manager. You may have to configure the server manager backup.

Alternatively as mentioned by Charlie & myself earlier in this thread, you can bypass the backup stage, & just restore directly from the old single non RAID drive. This can save a lot of time if you have a large amount of data to backup.
When using the Upgradedisk restore method, for the mysql databases to be correctly restored, you MUST run the
/sbin/e-smith/signal-event pre-backup
command BEFORE shutting down the old server.
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline Boris

  • *
  • 783
  • +0/-0
Re: How to 'expand' noraid to raid1
« Reply #12 on: June 25, 2014, 07:30:42 AM »
Janet,
I think tlicht is not concerned much about restoring all the configurations from the backup and willing to manually reconfigure system as new. He is worried only about his actual files in the ibays. His path looks like valid and safe.
If configuration is simple and nothing in configuration (DB, Domains, many users or e-mails) are important enough to hold-on to, i would have done the same way as tlicht is exploring.
Make sure that after files are copied back, verified and you ready to reuse the old drive clean up partition table on it or raid rebuild my not recognize this drive as a valid option.
...

Offline tlicht

  • ***
  • 56
  • +0/-0
  • Imagination is more important than knowledge.
Re: How to 'expand' noraid to raid1
« Reply #13 on: June 25, 2014, 12:30:40 PM »
I am the sigle user of this server, so reconfiguring it is not a big problem.
Anyway, I ordered a third drive so I will be able to install a complete new raid1 server from start and then copy the ibays' contents from the current noraid disk temporarily added as a third sata disk ( I imagine that copying would be faster than if it is added as a usb disk).
Thank you all for your good advice and patience  :P

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: How to 'expand' noraid to raid1
« Reply #14 on: June 26, 2014, 02:48:14 AM »
tlicht

What about email & mysql databases & webmail settings (in mysql dbs) & any other web apps etc that store data in mysql tables, & login DOMAIN machine settings & user ID's & pw's etc ?
Are you not using any of that ?
The built in backup function does work OK & includes all that.
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.