Did a fresh install of Ubuntu Server 12.04 on a single disk (guided partitioning, use whole disk), 500GB disk. System boots fine. Tried Raider to convert this to a RAID1 system with a second 500GB disk (different brand). Failed already in initial run with:
sudo raider -R1 [sudo] password for stefan:
:: raider version 0.12.0 started
:: Option: Single disk to RAID 1 (MIRRORING)
:: Linux distro: Ubuntu 12.04 LTS (precise)
:: Test Status (in lab): Tested successfully
:: Advice: You may use raider on it!
:: /dev/sda partition table type: GPT/GUID
:: Bootloader found in the boot sector: Unknown bootloader
:: FATAL ERROR: Bootloader does not exist in /dev/sda!
For some reason Raider does not know about the bootloader that the Ubuntu installation set.
Parted gives the following (sorry for the Swedish but if you know Parted you can guess):
(parted) visa
Modell: ATA SAMSUNG HD501LJ (scsi)
Disk /dev/sda: 500GB
Sektorstorlek (logisk/fysisk): 512B/512B
Partitionstabell: gpt
Nummer Början Slut Storlek Filsystem Namn Flaggor
1 17,4kB 100MB 100MB fat32 startbar
2 100MB 466GB 466GB ext4
3 466GB 500GB 34,3GB
Number 1 looks like a boot partition, it is set to startable.
The confusing part is that Raider says it found a bootloader and then it says it does not exist...
Can also add that instead doing a fresh install with Ubuntu 12.04 Server and setting up RAID1 according to the Ubuntu Server Installation Manual, gives a system that cannot boot.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You installed Ubuntu 12.04 with GPT instead of MBR type parttition.
I didn't tested this way, because Ubuntu installed a MBR partition by default in my system. I must to check that, and I will send you an answer.
Meanwhile if you could send me the logfiles:
/var/log/raider/raider_debig_R1_.log
and
/var/log/raider/raider.log
this could make my work easiest.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Ok, I just followed the standard installation and used guided partitioning, don't remember if I ever got a question for which type of partition. Anyway, here is the log files (if I succeded to attach them :-)). I re-run Raider to get some fresh files.
And, thanks for rapid reply!
Hmm, I think I succeded with attaching one file, the big one, so here is the small one pasted into the post:
2012-05-02 23:20:30
-----------------------------------------------------------
raider version 0.12.0 started [#37:single2raid]
Option: Single disk to RAID 1 (MIRRORING) [#51:single2raid]
-----------------------------------------------------------
/dev/sda2 is the root (/) partition [#920:mainfunctions]
/dev/sda is the system disk [#98:single2raid]
ATENTION: /dev/sdb is not empty. [#136:single2raid]
Linux distro: Ubuntu 12.04 LTS (precise) [#41:linuxdistro]
Test Status (in lab): Tested successfully [#42:linuxdistro]
Advice: You may use raider on it! [#43:linuxdistro]
Creating a database based on /dev/sda [#340:mainfunctions]
List of mounted devices: [#343:mainfunctions]
/dev/sda2
/dev/sda1
/dev/sda2 is the root (/) partition [#920:mainfunctions]
/dev/sda partition table type: GPT/GUID [#234:single2raid]
Bootloader found in the boot sector: Unknown bootloader [#74:grubfunctions]
Bootloader does not exist in /dev/sda! [#243:single2raid]
I didn't find any option to install GPT during Ubuntu installation!
I think you installed Ubuntu over a disk with a GPT partition already writen on it (maybe another distro was on the disk??).
But I think the problem is on Grub.
Check if your grub command is the same as mine:
Nope, did not work. Did the above trick with grub (I had exactly the same version as you) without any errors, the output from the reinstall was:
$ sudo grub-install --no-floppy --recheck /dev/sda
BootCurrent: 0000
Timeout: 1 seconds
BootOrder: 0001,0003
Boot0001* Hard Drive
Boot0003* CD/DVD Drive
BootCurrent: 0000
Timeout: 1 seconds
BootOrder: 0000,0001,0003
Boot0001* Hard Drive
Boot0003* CD/DVD Drive
Boot0000* ubuntu
Installation finished. No error reported.
$ sudo grub-mkconfig -o /boot/grub/grub.cfg
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.2.0-23-generic
Found initrd image: /boot/initrd.img-3.2.0-23-generic
Found memtest86+ image: /boot/memtest86+.bin
done
Running sudo raider -R1 gives the same result as before.
This is not a production system yet and it might be that even that I did a fresh install, there can have been something left on the disk due to it being reused. I thought Ubuntu wiped the disk when one tells it to use the whole disk during partitioning. Will do a reinstall of the system again after wiping the disk manually (just need to figure out how I do that).
Will report back with the results.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Ok, something is weird. I have tried doing a fresh install, with setting up a RAID1 already in Ubuntu 12.04 Server installation, only to end up with a system that does not boot. I have followed the advanced installation instructions step by step. If I do no RAID installation on one of the disk, I get a system that boots (that's why I found Raider as something to get me a RAID1 system).
Your comments on boot loader and question if there had been a system already installed on the disks made me try to do a wipe of all partitions with the LiveCD and then do a fresh install again (making me think that a "fresh install" in Ubuntu installation was not fresh do to not wiping disks). However, tried that yesterday and my RAID1 installation of Ubuntu ended with a system that does not boot. I will now try and wipe the disks again, do a fresh single disk installation and then try Raider again.
The disks was used in a Debian server, but not as boot disk, had a separate for that. These two disks were only for data storage and no RAID anywhere. So they should not have any traces of boot loaders on them. But then again, I have tried RAID1 installation with Ubuntu 12.04 Server a couple of times.
I have no access to the machine for two days now, but will run your commands when I have access again.
The hardware I have is as follows, pretty new except for the disks:
MB: Asus P9X79
CPU: Intel Core i7 - 3820 3,6 GHz
RAM: 32GB Corsair XMS3 Vengeance
HD: Two 500GB HD as of:
/dev/sda: SAMSUNG Model: HD501LJ Serial: S0MUJ1GP729115 (500G)
/dev/sdb: Hitachi Model: HDT725050VLA360 Serial: VFH401R4D1VT3H (500G)
Will post the result from your command in a couple of days, when I have access to the system (and get it to boot, which probably means wipe disk and do a single disk install).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This is what I was suspecting.
Your motherboard has a UEFI BIOS! (read http://www.asus.com/Motherboards/Intel_Socket_2011/P9X79/)
I read several documents about it but I don't have one UEFI motherboard to test it.
This explains why Ubuntu installed a GPT partition and the different install-grub output.
Grub 2 has a grub-efi utility, but I don't know exactly how Ubuntu 12.04 deals with it.
I will do some search about it and will tell you later.
The commands I suggested you to try, must tell something about it, if Ubuntu detected the UEFI system.
Last edit: MCarreira 2012-05-04
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Ok, I'm back with access to the server again. Now I have done a fresh install onto one of the disks with Ubuntu Server 12.04, no raid, selected Guided partitioning and use the whole disk (first disk), this is how it was then partitioned:
As I wrote, I selected to let Ubuntu do the partitioning. However, this time it does not look like the last time. I did not wipe the disk with the LiveCD before doing the isntallation. I did remove the partitions in the install program, but the RAID-part was not removed. Feels like "use the whole disk still re-uses the old partitions (the RAID1 installation through Ubuntu Server installation that was on the system before had a 34Gb swap partition and a 466Gb /-partition). The system boots nice into this singel disk system.
Here is the result of running the commands you needed the output from:
Hmm, interesting, I played around a bit more and installed raider did a sudo raider -d and got this output:
sudo raider -d
raider - Version 0.12.0 (Rev: 130)
List disks:
Disk /dev/sda - 500G - SAMSUNG: HD501LJ - S0MUJ1GP729115
Partition Table: MBR/msdos
âââ/dev/sda1 *boot Pri Linux ext4 466GB /
âââ/dev/sda2 - Ext Extended 34.3GB none
âââ/dev/sda5 - Log Linux swap / Solaris 34.3GB none
Disk /dev/sdb - 500G - Hitachi: HDT725050VLA360 - VFH401R4D1VT3H
Partition Table: GPT/GUID
âââ/dev/sdb1 - swap2 raid 34.0GB none
âââ/dev/sdb2 - root2 raid 466GB none
Did a sudo raider -e /dev/sdb to wipe second disk and so now the list looks like this:
sudo raider -d
raider - Version 0.12.0 (Rev: 130)
List disks:
Disk /dev/sda - 500G - SAMSUNG: HD501LJ - S0MUJ1GP729115
Partition Table: MBR/msdos
âââ/dev/sda1 *boot Pri Linux ext4 466GB /
âââ/dev/sda2 - Ext Extended 34.3GB none
âââ/dev/sda5 - Log Linux swap / Solaris 34.3GB none
Disk /dev/sdb - 500G - Hitachi: HDT725050VLA360 - VFH401R4D1VT3H
Partition table not found
Then I thought, what the heck, let's try raider again and issued a sudo raider -R1 command and, guess what, now raider is working in changing my single disk to a RAID1 system...
I see in the above list that instead of a GPT/GUID partion table we have a MBR/msdos partition table. The output from raider was:
$ sudo raider -R1
-----------------------------------------------------------
:: raider version 0.12.0 started
:: Option: Single disk to RAID 1(MIRRORING)
-----------------------------------------------------------
:: Linux distro: Ubuntu 12.04 LTS (precise)
:: Test Status (in lab): Tested successfully
:: Advice: You may use raider on it!
-----------------------------------------------------------
:: Disks selected (2):
:: /dev/sda: SAMSUNG Model: HD501LJ Serial: S0MUJ1GP729115 (500G)
:: /dev/sdb: Hitachi Model: HDT725050VLA360 Serial: VFH401R4D1VT3H (500G)
-----------------------------------------------------------
:: /dev/sda partition table type: MBR/msdos
:: Bootloader found in the boot sector: GRUB
:: GRUB 2 version: 1.99
:: Initramfs generator: mkinitramfs
:: Initramfs generator command: "update-initramfs -u"
:: You are not running in "single mode"
-----------------------------------------------------------
:: BuildRaid phase will start now!
:: There are 8.05GB of data to be copied to the new raid system
:: BuildRaid phase will take a long time, maybe several minutes to one hour(?).
-----------------------------------------------------------
:: Do you want to continue without changing to "single mode"? (y/[n])y
:: BuildRaid phase started...
:: Working on /dev/sdb ...
-----------------------------------------------------------
:: Copying partitions from disk /dev/sda to /dev/sdb
:: Configure partitions
:: Creating raid 1 array /dev/md0 with devices /dev/sdb1
:: Raid1 array /dev/md0 (metadata=1.2) started...
:: Building file system (format): mkfs.ext4 -q /dev/md0
:: Formating... =====> Done.
:: Copying data from / to /dev/md0...
:: [100% ][=========================>][ Time: 01m30s ]
:: Unmounting partitions
:: Mounting chroot partition
:: Fix name devices in config files, if udev names are used
:: Fixing name devices in /etc/fstab
:: Create initram filesystem and install GRUB in /dev/sdb
:: update-initramfs -u
:: Enter in chroot system...
update-initramfs: Generating /boot/initrd.img-3.2.0-23-generic
Installation finished. No error reported.
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.2.0-23-generic
Found initrd image: /boot/initrd.img-3.2.0-23-generic
Found memtest86+ image: /boot/memtest86+.bin
done
:: Unmounting chroot system
-----------------------------------------------------------
:: Converting to Raid 1
:: End of BuildRaid phase! Now follow the instructions:
--------------------------------------------------------------------
1 - Swap the first (original) disk with the last one in the slot positions,
after shutting down the computer.
2 - Switch on your computer again and boot in "single user" mode
3 - Run this command: "raider --run".
RaidSync will start at once.
--------------------------------------------------------------------
Raider BuildRaid phase took 2.26 minutes to perform
So, now it's time to shutdown and swap disks and continue with step two. However, this needs to wait until tomorrow, I have run out of time today! :-)
Will post the results from the second step tomorrow.
The problem right now, which you may be able to help me with is that I don't really know how I came to this state without a GPT partioning table...
The history is like this:
Wiped both disk through the Ubuntu 12.04 Desktop LiveCD
Tried a RAID1 installation with Ubuntu Server 12.04 installation
=> did not create a system that could boot
Made a new installation of a Ubuntu Server 12.04 installation on the first disk, no RAID. Did remove the partitions but did not remove the RAID part.
Installed Raider, tried to run it, but complained about missing mdadm
Installed mdadm
Run Raider again and successfully completet the first step.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Good! I'm glad you were able to do it!
I also did some research myself and tried to understand what happened, based on your messages.
As I said before, your motherboard has a UEFI BIOS.
These motherboards can boot in UEFI BIOS mode or traditional BIOS mode.
I think the first time you installed ubuntu, it was in UEFI BIOS mode.
Ubuntu-12.04 is able to install the system in UEFI BIOS, that's why it booted with no errors and had a GPT partition table. But raider is not able to deal with UEFI BIOS yet.
The last Ubuntu installation was made when the motherboard was in traditional BIOS mode (I don't know how you've done it!!), so it was installed with a MSDOS partition table and raider was run without errors.
Another tip:
When booting with your computer, if you press F8 you can select the booting disk order, and I think you can also chose UEFI mode (I'm not sure but you can test it if you want). Anyway, "something" happened in your BIOS, and you booted in a NON-UEFI mode.
- Tried a RAID1 installation with Ubuntu Server 12.04 installation
- => did not create a system that could boot
At present time I'm not sure if we can have a linux software raid system booting in a UEFI BIOS. I think linux distros are not yet prepared to do it. Only a few can boot in UEFI BIOS (Fedora16, Ubuntu-12, and... ??), but none can boot in a raid system in a UEFI BIOS.
So, booting as a non-EFI system is the prefered way to boot in raid at the present date.
But sooner, all motherboards will be UEFI BIOS and linux distros will have to make the necessary evolution.
About raider -d :
This raider option is intended to help to identify the disks, the partitions in it, and the raid arrays. Also shows the mountpoints described in /etc/fstab (not the devices already mounted)
About raider -e :
This option removes selectivelly all information about lvm, raid, and wipes partition tables, so you can have a complete disk deletion.
The deletion made while installing the system only erases the partition information.
I will appreciate your feedback.
Thank's Stefan.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
ok, now I have had time to try step two. But it failed. When booting up the machine after swapping disks, it gave me some partition errors that it can't mount swap partition. Trying to bypass that and run raider --run gives the result that raider says it fails.
F8 gives me a list of disk to boot from but not what mode to use.
Your info about the UEFI is interesting and thanks for that. I'm getting a bit frustrated now because this was supposed to be my server in my company (ok, just a 2 person company but still..) to serve me with what I need for my software development projects. I wanted a raid system to be a bit safer on failures and at least be able to buy me time when they happen (which they always do). However, I feel I'm learning a bit too much about things I did not want to learn about... :-) I have done numerous of Ubuntu installations and always been impressed that it works so good, but this RAID installation in 12.04 is just not ok. Fine if they don't support certain hardware (very new HW), but it would be nice if they identified that and told the installer.
I may need to lower my requirements on fail safe system just to get something that works.
If I'm lucky, I can look back at raider sometime in the near future and see that it (and Ubuntu server) can help me convert my singledisk to a RAID1 system.
I will wipe my disk again, and try a single disk system install, see what that give me in terms of partition table (because right now I don't really know how I suddenly got a non GPT table there).
Thanks for your help!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The error in swap partitions during boot in step 2 is normal. This happens because the second disk still does not have the swap partition formatted.
What I don't understand is what failed in step 2 after "raider --run" .
Dit the process stopped and output some error message?
Are you still able to send me the logs?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yes, it stopped and said something about not being able to continue. Dont remember the exact spelling though. I was on the console in single user mode and had no easy way of copy/paste the output. I thought that because it gave this error, it was no meaning to proceed.
I have wiped the disks again, so no access to the logs, I had a system that did not boot after swapping disks so I gave up.
Right now I'm trying to partitioning with LiveCd and see if I can use those partitions in a new Ubuntu install (creating msdos partition tables). Will report back with the result. However, I'm very close to giving up...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You don't need to use single user mode. This is only needed if you have a server with many services running and you don't want to break the things while syncing the disks.
That is a server with a only one user in this moment, like a desktop. So, you can run it in multiuser mode.
I think you are very near to be succeed.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Ok, got the same result running in single user mode and in multi.
Late yesterday evening I did a partitioning with the LiveCD, and then run the Ubuntu server installation using these partions. One thing that was strange was if I did the partitioning only with the Ubuntu Server installation, was that I was not able to set the bootable flag during partitioning. Even that it was an alternative to do so, it did not set it. Thats why I tried doing the partitioning with the LiveCD, because then the bootable flag was set and stayed that during the Ubuntu Server installation (creating the SW RAID in the Ubuntu Server installation).
However, at the end of the installation process I got an error that the installation program could not install grub on md1 (I think). I proceeded anyway and this morning when I rebooted the finished installation, the system did not boot (surprise...). This time it was just a black screen and not the "Please insert a bootable media" message that I got when only using the ubuntu server installation.
I know, it's kind of messy and desperate way, but I'm trying different alternatives. The problem is that it takes such a long time to try each installation, and I don't really have that time.
Now, I'm wondering if the thing that is missing is getting the grub installation to work and if there is a way to do that through LiveCD. I think (!) that I have a complete Ubunut server installation with RAID1 on my system, but missing a working grub. What do you think?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I think you didn't install grub correctly.
It must be installed in /dev/sda and not in /dev/md1.
When the computer is switched on, the bios firmware is the first program to run, and jump to the first byte of the first sector of the disk selected in the bios menu.
There lives the bootloader (in this case: Grub).
So, you must install Grub in the first disk, and not in the raid device to provide a bootable system.
You always can work in a disk that seems to be unbootable. If you boot from a linux cdrom (a liveCD), you can try to mount the unbootable disk and repair it.
These are the steps to do it using the livecd and the unbootable disk:
1- Boot the live cd and login as root.
2- Check what is the raid device name:
# cat /proc/mdstat
(the name can be "md0" or "md127" or other "md???". Let's assume that it is "md0"
3- Mount the raid 1 from the unbootable disk (I think the disk you create has only "/" as a raid device):
# mount /dev/md0 /mnt
Now you have access to the root filesystem "/" which is mounted in "/mnt"
4- Then you can chroot to the unbootable system. Try this steps:
# mount --bind /sys /mnt/sys
# mount --bind /dev /mnt/dev
# mount --bind /proc /mnt/proc
# chroot /mnt /bin/bash
Now you are inside your "unbootable" disk, but you can change whatever you want.
6 - Let's try to reinstall grub in the second disk (the one we are "inside" now):
# grub-install --no-floppy --recheck /dev/sdb
If there were no errors grub is now installed in the first sector of the disk
8 - Now, let's create the grub configuration file:
# grub-mkconfig -o /boot/grub/grub.cfg
The configuration file was created using the default sets.
9- The initramfs disk must be re-created also:
# update-initramfs -u
If there were no errors you must be able to boot the disk now.
Tried it, but it failed on the chroot step, told me that /bin/bash could not be found.
Even tried boot-repair (https://help.ubuntu.com/community/Boot-Repair) but it failed too.
I think the installation is broken and no meaning to continue trying to get it to work. Right now I feel that even if I get it to work, I don't think I will trust it and then all purposes with the adding the RAID fails.
I will give up these attempts of getting this to work, I have spent too many late nights trying and need to get some productive work done instead. Let's face the fact, I bought too new hardware!!
The motherboard supports HW RAID, but I'm not sure I want to go down that alley.
As you wrote earlier, UEFI bios will probably be more and more common in the future and by that there will be better support in Ubuntu.
I will install a single disk system and be happy! :-)
While being happy I will monitor the evolution of the UEFI support and of course the evolution of Raider. I think you are doing a great job and I really appreciate all help, thanks!
I guess that after setting up my single disk system I will not dare to touch it, and I really need my server up and running.
Anyway, thanks for your help.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I think this is a wise decision!
UEFI bios and linux raid software are not enough documented yet.
Unless you can install a hardware raid solution, I agree with you: at the present date, I would install a single system disk, and provide a good backup policy.
Thanks for your feedback!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
What differs is that he did a 11.10 server installation and I want 12.04 (or need 12.04 because 11.10 does not recognize the MB NIC).
Maybe, I should try creating such a bios_grup partition on my system during a RAID1 install of Ubuntu Server. (I will hate myself, again, when the clock shows past midnight and the only thing I see is a system that don't boot... :-))
If I try this, I will update with the result. I guess it's never too late to give up... :-)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Guess what!?!? I have a working Ubuntu Server 12.04 WITH RAID1 !!!
:-)
The trick with a bios_grub partition on each disk did it. I had to do the partition through LiveCD because the Ubuntu installation did not give me clear enough feedback to what I was doing. So I did a basic partitioning with a small bios_grub partition, then a swap partition and finally a "normal" partition. Rebooted and run the Ubuntu Server 12.04 installation and did a manual partition where I reused the partitions from the manual work and added software raid onto that. Finished the installation and the server booted!
I'm pretty happy right now :-)
Should do some tests to see that it actually acts as a RAID1 system (unplug a drive, see what happens, plug it in again and see if we can get the array up and running again).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Good!
You are probably running in a GPT partition with EFI disabled. The bios_grub partition allows Grub 2 to use a GPT partition, but not a EFI enabled motherboard.
When testing a reboot unplugging one of the disks, be sure to have installed grub in both disks before doing the test.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I know this is a bit old now Stefan, but would you mind sharing a little more detail on the steps you took to get this set up? I'm running into the same issue (several late nights, and several fresh installs using Ubuntu 12.04.3 server.
I'm just wanting to verify if you created a raid volume on top of the two bios_grub partitions, or just exactly how you set it up after doing the manual partitioning through the LiveCD.
Thanks!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Did a fresh install of Ubuntu Server 12.04 on a single disk (guided partitioning, use whole disk), 500GB disk. System boots fine. Tried Raider to convert this to a RAID1 system with a second 500GB disk (different brand). Failed already in initial run with:
:: raider version 0.12.0 started
:: Option: Single disk to RAID 1 (MIRRORING)
:: Linux distro: Ubuntu 12.04 LTS (precise)
:: Test Status (in lab): Tested successfully
:: Advice: You may use raider on it!
:: Disks selected (2):
:: /dev/sda: SAMSUNG Model: HD501LJ Serial: S0MUJ1GP729115 (500G)
:: /dev/sdb: Hitachi Model: HDT725050VLA360 Serial: VFH401R4D1VT3H (500G)
:: /dev/sda partition table type: GPT/GUID
:: Bootloader found in the boot sector: Unknown bootloader
:: FATAL ERROR: Bootloader does not exist in /dev/sda!
For some reason Raider does not know about the bootloader that the Ubuntu installation set.
Parted gives the following (sorry for the Swedish but if you know Parted you can guess):
(parted) visa
Modell: ATA SAMSUNG HD501LJ (scsi)
Disk /dev/sda: 500GB
Sektorstorlek (logisk/fysisk): 512B/512B
Partitionstabell: gpt
Nummer Början Slut Storlek Filsystem Namn Flaggor
1 17,4kB 100MB 100MB fat32 startbar
2 100MB 466GB 466GB ext4
3 466GB 500GB 34,3GB
Number 1 looks like a boot partition, it is set to startable.
The confusing part is that Raider says it found a bootloader and then it says it does not exist...
Can also add that instead doing a fresh install with Ubuntu 12.04 Server and setting up RAID1 according to the Ubuntu Server Installation Manual, gives a system that cannot boot.
You installed Ubuntu 12.04 with GPT instead of MBR type parttition.
I didn't tested this way, because Ubuntu installed a MBR partition by default in my system. I must to check that, and I will send you an answer.
Meanwhile if you could send me the logfiles:
/var/log/raider/raider_debig_R1_.log
and
/var/log/raider/raider.log
this could make my work easiest.
Ok, I just followed the standard installation and used guided partitioning, don't remember if I ever got a question for which type of partition. Anyway, here is the log files (if I succeded to attach them :-)). I re-run Raider to get some fresh files.
And, thanks for rapid reply!
Hmm, I think I succeded with attaching one file, the big one, so here is the small one pasted into the post:
I didn't find any option to install GPT during Ubuntu installation!
I think you installed Ubuntu over a disk with a GPT partition already writen on it (maybe another distro was on the disk??).
But I think the problem is on Grub.
Check if your grub command is the same as mine:
Then reinstall grub:
Finally try running raider again and see if the error still persists.
Nope, did not work. Did the above trick with grub (I had exactly the same version as you) without any errors, the output from the reinstall was:
Running sudo raider -R1 gives the same result as before.
This is not a production system yet and it might be that even that I did a fresh install, there can have been something left on the disk due to it being reused. I thought Ubuntu wiped the disk when one tells it to use the whole disk during partitioning. Will do a reinstall of the system again after wiping the disk manually (just need to figure out how I do that).
Will report back with the results.
It seems that sourceforge forum was down for some hours...
Stefan, the output of your grub-install is... weird!
I never saw that before. What kind of hardware do you have?
Could you please print the output of these commands?
Maybe this could help me to understand what's happening.
Thank's!
Ok, something is weird. I have tried doing a fresh install, with setting up a RAID1 already in Ubuntu 12.04 Server installation, only to end up with a system that does not boot. I have followed the advanced installation instructions step by step. If I do no RAID installation on one of the disk, I get a system that boots (that's why I found Raider as something to get me a RAID1 system).
Your comments on boot loader and question if there had been a system already installed on the disks made me try to do a wipe of all partitions with the LiveCD and then do a fresh install again (making me think that a "fresh install" in Ubuntu installation was not fresh do to not wiping disks). However, tried that yesterday and my RAID1 installation of Ubuntu ended with a system that does not boot. I will now try and wipe the disks again, do a fresh single disk installation and then try Raider again.
The disks was used in a Debian server, but not as boot disk, had a separate for that. These two disks were only for data storage and no RAID anywhere. So they should not have any traces of boot loaders on them. But then again, I have tried RAID1 installation with Ubuntu 12.04 Server a couple of times.
I have no access to the machine for two days now, but will run your commands when I have access again.
The hardware I have is as follows, pretty new except for the disks:
MB: Asus P9X79
CPU: Intel Core i7 - 3820 3,6 GHz
RAM: 32GB Corsair XMS3 Vengeance
HD: Two 500GB HD as of:
/dev/sda: SAMSUNG Model: HD501LJ Serial: S0MUJ1GP729115 (500G)
/dev/sdb: Hitachi Model: HDT725050VLA360 Serial: VFH401R4D1VT3H (500G)
Will post the result from your command in a couple of days, when I have access to the system (and get it to boot, which probably means wipe disk and do a single disk install).
This is what I was suspecting.
Your motherboard has a UEFI BIOS! (read http://www.asus.com/Motherboards/Intel_Socket_2011/P9X79/)
I read several documents about it but I don't have one UEFI motherboard to test it.
This explains why Ubuntu installed a GPT partition and the different install-grub output.
Grub 2 has a grub-efi utility, but I don't know exactly how Ubuntu 12.04 deals with it.
I will do some search about it and will tell you later.
The commands I suggested you to try, must tell something about it, if Ubuntu detected the UEFI system.
Last edit: MCarreira 2012-05-04
Ok, I'm back with access to the server again. Now I have done a fresh install onto one of the disks with Ubuntu Server 12.04, no raid, selected Guided partitioning and use the whole disk (first disk), this is how it was then partitioned:
As I wrote, I selected to let Ubuntu do the partitioning. However, this time it does not look like the last time. I did not wipe the disk with the LiveCD before doing the isntallation. I did remove the partitions in the install program, but the RAID-part was not removed. Feels like "use the whole disk still re-uses the old partitions (the RAID1 installation through Ubuntu Server installation that was on the system before had a 34Gb swap partition and a 466Gb /-partition). The system boots nice into this singel disk system.
Here is the result of running the commands you needed the output from:
Hope this can be of some help.
Hmm, interesting, I played around a bit more and installed raider did a sudo raider -d and got this output:
Did a sudo raider -e /dev/sdb to wipe second disk and so now the list looks like this:
Then I thought, what the heck, let's try raider again and issued a sudo raider -R1 command and, guess what, now raider is working in changing my single disk to a RAID1 system...
I see in the above list that instead of a GPT/GUID partion table we have a MBR/msdos partition table. The output from raider was:
So, now it's time to shutdown and swap disks and continue with step two. However, this needs to wait until tomorrow, I have run out of time today! :-)
Will post the results from the second step tomorrow.
The problem right now, which you may be able to help me with is that I don't really know how I came to this state without a GPT partioning table...
The history is like this:
Good! I'm glad you were able to do it!
I also did some research myself and tried to understand what happened, based on your messages.
As I said before, your motherboard has a UEFI BIOS.
These motherboards can boot in UEFI BIOS mode or traditional BIOS mode.
I think the first time you installed ubuntu, it was in UEFI BIOS mode.
Ubuntu-12.04 is able to install the system in UEFI BIOS, that's why it booted with no errors and had a GPT partition table. But raider is not able to deal with UEFI BIOS yet.
The last Ubuntu installation was made when the motherboard was in traditional BIOS mode (I don't know how you've done it!!), so it was installed with a MSDOS partition table and raider was run without errors.
Another tip:
When booting with your computer, if you press F8 you can select the booting disk order, and I think you can also chose UEFI mode (I'm not sure but you can test it if you want). Anyway, "something" happened in your BIOS, and you booted in a NON-UEFI mode.
At present time I'm not sure if we can have a linux software raid system booting in a UEFI BIOS. I think linux distros are not yet prepared to do it. Only a few can boot in UEFI BIOS (Fedora16, Ubuntu-12, and... ??), but none can boot in a raid system in a UEFI BIOS.
So, booting as a non-EFI system is the prefered way to boot in raid at the present date.
But sooner, all motherboards will be UEFI BIOS and linux distros will have to make the necessary evolution.
About raider -d :
This raider option is intended to help to identify the disks, the partitions in it, and the raid arrays. Also shows the mountpoints described in /etc/fstab (not the devices already mounted)
About raider -e :
This option removes selectivelly all information about lvm, raid, and wipes partition tables, so you can have a complete disk deletion.
The deletion made while installing the system only erases the partition information.
I will appreciate your feedback.
Thank's Stefan.
ok, now I have had time to try step two. But it failed. When booting up the machine after swapping disks, it gave me some partition errors that it can't mount swap partition. Trying to bypass that and run raider --run gives the result that raider says it fails.
F8 gives me a list of disk to boot from but not what mode to use.
Your info about the UEFI is interesting and thanks for that. I'm getting a bit frustrated now because this was supposed to be my server in my company (ok, just a 2 person company but still..) to serve me with what I need for my software development projects. I wanted a raid system to be a bit safer on failures and at least be able to buy me time when they happen (which they always do). However, I feel I'm learning a bit too much about things I did not want to learn about... :-) I have done numerous of Ubuntu installations and always been impressed that it works so good, but this RAID installation in 12.04 is just not ok. Fine if they don't support certain hardware (very new HW), but it would be nice if they identified that and told the installer.
I may need to lower my requirements on fail safe system just to get something that works.
If I'm lucky, I can look back at raider sometime in the near future and see that it (and Ubuntu server) can help me convert my singledisk to a RAID1 system.
I will wipe my disk again, and try a single disk system install, see what that give me in terms of partition table (because right now I don't really know how I suddenly got a non GPT table there).
Thanks for your help!
The error in swap partitions during boot in step 2 is normal. This happens because the second disk still does not have the swap partition formatted.
What I don't understand is what failed in step 2 after "raider --run" .
Dit the process stopped and output some error message?
Are you still able to send me the logs?
Yes, it stopped and said something about not being able to continue. Dont remember the exact spelling though. I was on the console in single user mode and had no easy way of copy/paste the output. I thought that because it gave this error, it was no meaning to proceed.
I have wiped the disks again, so no access to the logs, I had a system that did not boot after swapping disks so I gave up.
Right now I'm trying to partitioning with LiveCd and see if I can use those partitions in a new Ubuntu install (creating msdos partition tables). Will report back with the result. However, I'm very close to giving up...
You don't need to use single user mode. This is only needed if you have a server with many services running and you don't want to break the things while syncing the disks.
That is a server with a only one user in this moment, like a desktop. So, you can run it in multiuser mode.
I think you are very near to be succeed.
Ok, got the same result running in single user mode and in multi.
Late yesterday evening I did a partitioning with the LiveCD, and then run the Ubuntu server installation using these partions. One thing that was strange was if I did the partitioning only with the Ubuntu Server installation, was that I was not able to set the bootable flag during partitioning. Even that it was an alternative to do so, it did not set it. Thats why I tried doing the partitioning with the LiveCD, because then the bootable flag was set and stayed that during the Ubuntu Server installation (creating the SW RAID in the Ubuntu Server installation).
However, at the end of the installation process I got an error that the installation program could not install grub on md1 (I think). I proceeded anyway and this morning when I rebooted the finished installation, the system did not boot (surprise...). This time it was just a black screen and not the "Please insert a bootable media" message that I got when only using the ubuntu server installation.
I know, it's kind of messy and desperate way, but I'm trying different alternatives. The problem is that it takes such a long time to try each installation, and I don't really have that time.
Now, I'm wondering if the thing that is missing is getting the grub installation to work and if there is a way to do that through LiveCD. I think (!) that I have a complete Ubunut server installation with RAID1 on my system, but missing a working grub. What do you think?
I think you didn't install grub correctly.
It must be installed in /dev/sda and not in /dev/md1.
When the computer is switched on, the bios firmware is the first program to run, and jump to the first byte of the first sector of the disk selected in the bios menu.
There lives the bootloader (in this case: Grub).
So, you must install Grub in the first disk, and not in the raid device to provide a bootable system.
You always can work in a disk that seems to be unbootable. If you boot from a linux cdrom (a liveCD), you can try to mount the unbootable disk and repair it.
These are the steps to do it using the livecd and the unbootable disk:
1- Boot the live cd and login as root.
2- Check what is the raid device name:
# cat /proc/mdstat
(the name can be "md0" or "md127" or other "md???". Let's assume that it is "md0"
3- Mount the raid 1 from the unbootable disk (I think the disk you create has only "/" as a raid device):
# mount /dev/md0 /mnt
Now you have access to the root filesystem "/" which is mounted in "/mnt"
4- Then you can chroot to the unbootable system. Try this steps:
# mount --bind /sys /mnt/sys
# mount --bind /dev /mnt/dev
# mount --bind /proc /mnt/proc
# chroot /mnt /bin/bash
Now you are inside your "unbootable" disk, but you can change whatever you want.
6 - Let's try to reinstall grub in the second disk (the one we are "inside" now):
# grub-install --no-floppy --recheck /dev/sdb
If there were no errors grub is now installed in the first sector of the disk
8 - Now, let's create the grub configuration file:
# grub-mkconfig -o /boot/grub/grub.cfg
The configuration file was created using the default sets.
9- The initramfs disk must be re-created also:
# update-initramfs -u
If there were no errors you must be able to boot the disk now.
10- Get out from the chroot environment:
# exit
10- Unmount the mounted points:
# umount /mnt/sys
# umount /mnt/dev
# umount /mnt/proc
# umount /mnt
11- Reboot the computer, but remove the cdrom before booting. Now the disk must boot from itself.
I hope you don't find this very complicated, but it is easiest then reinstall the system again.
Hope this helps!
Last edit: MCarreira 2012-05-07
Tried it, but it failed on the chroot step, told me that /bin/bash could not be found.
Even tried boot-repair (https://help.ubuntu.com/community/Boot-Repair) but it failed too.
I think the installation is broken and no meaning to continue trying to get it to work. Right now I feel that even if I get it to work, I don't think I will trust it and then all purposes with the adding the RAID fails.
I will give up these attempts of getting this to work, I have spent too many late nights trying and need to get some productive work done instead. Let's face the fact, I bought too new hardware!!
The motherboard supports HW RAID, but I'm not sure I want to go down that alley.
As you wrote earlier, UEFI bios will probably be more and more common in the future and by that there will be better support in Ubuntu.
I will install a single disk system and be happy! :-)
While being happy I will monitor the evolution of the UEFI support and of course the evolution of Raider. I think you are doing a great job and I really appreciate all help, thanks!
I guess that after setting up my single disk system I will not dare to touch it, and I really need my server up and running.
Anyway, thanks for your help.
I think this is a wise decision!
UEFI bios and linux raid software are not enough documented yet.
Unless you can install a hardware raid solution, I agree with you: at the present date, I would install a single system disk, and provide a good backup policy.
Thanks for your feedback!
Just when I had given up, I found this http://www.cynick.com/2011/12/05/successfully-installing-ubuntu-11-10-with-software-raid/ when searching for info in UEFI and Ubuntu. Looks like someone else has been spending late nights having fun (!) with re-installing Ubuntu.
What differs is that he did a 11.10 server installation and I want 12.04 (or need 12.04 because 11.10 does not recognize the MB NIC).
Maybe, I should try creating such a bios_grup partition on my system during a RAID1 install of Ubuntu Server. (I will hate myself, again, when the clock shows past midnight and the only thing I see is a system that don't boot... :-))
If I try this, I will update with the result. I guess it's never too late to give up... :-)
Update:
Guess what!?!? I have a working Ubuntu Server 12.04 WITH RAID1 !!!
:-)
The trick with a bios_grub partition on each disk did it. I had to do the partition through LiveCD because the Ubuntu installation did not give me clear enough feedback to what I was doing. So I did a basic partitioning with a small bios_grub partition, then a swap partition and finally a "normal" partition. Rebooted and run the Ubuntu Server 12.04 installation and did a manual partition where I reused the partitions from the manual work and added software raid onto that. Finished the installation and the server booted!
I'm pretty happy right now :-)
Should do some tests to see that it actually acts as a RAID1 system (unplug a drive, see what happens, plug it in again and see if we can get the array up and running again).
Good!
You are probably running in a GPT partition with EFI disabled. The bios_grub partition allows Grub 2 to use a GPT partition, but not a EFI enabled motherboard.
When testing a reboot unplugging one of the disks, be sure to have installed grub in both disks before doing the test.
I know this is a bit old now Stefan, but would you mind sharing a little more detail on the steps you took to get this set up? I'm running into the same issue (several late nights, and several fresh installs using Ubuntu 12.04.3 server.
I'm just wanting to verify if you created a raid volume on top of the two bios_grub partitions, or just exactly how you set it up after doing the manual partitioning through the LiveCD.
Thanks!