Comments on How To Set Up Software RAID1 On A Running System (Incl. GRUB2 Configuration) (Ubuntu 10.04)

How To Set Up Software RAID1 On A Running System (Incl. GRUB2 Configuration) (Ubuntu 10.04) This guide explains how to set up software RAID1 on an already running Ubuntu 10.04 system. The GRUB2 bootloader will be configured in such a way that the system will still be able to boot if one of the hard drives fails (no matter which one).

5 Comment(s)

Add comment

Please register in our forum first to comment.

Comments

By: Bill

asus-bill / # gfdisk -G
asus-bill / # sfdisk -d /dev/sda | sfdisk --force /dev/sdb
Checking that no-one is using this disk right now ...

WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util sfdisk doesn't support GPT. Use GNU Parted.

OK

Disk /dev/sdb: 121601 cylinders, 255 heads, 63 sectors/track
Old situation:
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start     End   #cyls    #blocks   Id  System
/dev/sdb1          0+ 121601- 121602- 976762583+  ee  GPT
/dev/sdb2          0       -       0          0    0  Empty
/dev/sdb3          0       -       0          0    0  Empty
/dev/sdb4          0       -       0          0    0  Empty
New situation:
Units = sectors of 512 bytes, counting from 0

   Device Boot    Start       End   #sectors  Id  System
/dev/sdb1             1 1953525167 1953525167  ee  GPT
/dev/sdb2             0         -          0   0  Empty
/dev/sdb3             0         -          0   0  Empty
/dev/sdb4             0         -          0   0  Empty
Warning: partition 1 does not end at a cylinder boundary
Warning: no primary partition is marked bootable (active)
This does not matter for LILO, but the DOS MBR will not boot this disk.
Successfully wrote the new partition table

Re-reading the partition table ...

If you created or changed a DOS partition, /dev/foo7, say, then use dd(1)
to zero the first 512 bytes:  dd if=/dev/zero of=/dev/foo7 bs=512 count=1
(See fdisk(8).)
asus-bill / # gfdisk -l

Disk /dev/sda: 1000 GB, 1000202273280 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System 
/dev/sda1               1        2835    22772106   83  Linux 
Warning: Partition 1 does not end on cylinder boundary.
/dev/sda2            2835      121601   953987895   83  Linux 
Warning: Partition 2 does not end on cylinder boundary.
Error: /dev/sdb: unrecognised disk label
asus-bill / # 
 
Ok, doesn't work with GPT drive? (sdb in this scenario is an unallocated, new drive straight out of the box, Seagate Barracuda 1TB 64mb cache, identical to sda)
 

By: Hans

Thank you for this excellent Tutorial!

Still, grub2 comes with surprises. When /dev/sda fails it might happen that the system runs into an endless loop of boot trials (not even showing the grub menu) because grub won't be able to find the files needed. I could solve the problem with 

grub-install --modules="raid" /dev/sdx
See http://ubuntuforums.org/showthread.php?p=12534060#post12534060:

1. Install grub on EACH of the array's disks and pass grub-install the option flag --modules="raid". Without --modules="raid" it will fail.
2. Rebuild your initramfs.

By: HST

This was a great help to me in a slightly harder (?) problem, namely moving to RAID10 from RAID1 with only two disks.  I had to make a few appropriate minor changes for Debian, for raid10 and for an existing RAID in place.

Details on request.

By: sysadmin

On CentOS 7 I have not found grub-install command. But grub2-install present:# grub2-install /dev/sdb

Installing for i386-pc platform.

Installation finished. No error reported.

By: Mujeeb S

cant edit file /etc/mtab even as a super user on ubuntu 20.04 server