Tony Mountifield
2017-Jan-25 16:46 UTC
[CentOS] CentOS 7 install on one RAID 1 [not-so-SOLVED]
In article <1485342377.3072.6.camel at biggs.org.uk>, Pete Biggs <pete at biggs.org.uk> wrote:> On Tue, 2017-01-24 at 17:14 -0500, m.roth at 5-cent.us wrote: > > So, it installed happily. > > > > Then wouldn't boot. No problem, I'll bring it up with pxe, then chroot and > > grub2-install. > > > > Um, nope. I edited the device map from hd0 and hd1 being the RAID to > > /dev/sda and /dev/sdb, then ran grup2-install. It now tells me can't > > identify the filesystem on hd0, and can't perform a safety check, and > > gives up. > > > > What am I missing? Google is not giving me any answers.... > > > > Surely, if you are using software RAID, then you should configure that > RAID in anaconda, that will then cope with setting up the partitions to > allow booting. Basically it needs a small non-RAID partition to hold > /boot on the boot disk. > > Remember that the boot sequence is generally: BIOS reads MBR and > executes it; MBR code reads kernel from /boot and executes it (yes, > it's more complicated than that). If the MBR code doesn't know how to > read a RAID partition, then it's going to fail, that's why you have a > small non-RAID partition to hold /boot. > > Hardware RAID is different because it interfaces at the BIOS level so > the MBR code doesn't need to know how to specifically read it.If you are using RAID 1 kernel mirroring, you can do that with /boot too, and Grub finds the kernel just fine. I've done it many times: 1. Primary partition 1 type FD, size 200M. /dev/sda1 and /dev/sdb1. 2. Create /dev/md0 as RAID 1 from /dev/sda1 and /dev/sdb1. 3. Assign /dev/md0 to /boot, ext3 format (presumably ext4 would work too?) 4. Make sure to setup both drives separately in grub. Typically I then go on to have /dev/sda2+/dev/sdb2 => /dev/md1 => swap, and /dev/sda3+/dev/sdb3 => /dev/md2 => / Cheers Tony -- Tony Mountifield Work: tony at softins.co.uk - http://www.softins.co.uk Play: tony at mountifield.org - http://tony.mountifield.org
On 26/01/17 05:46, Tony Mountifield wrote:> In article <1485342377.3072.6.camel at biggs.org.uk>, > Pete Biggs <pete at biggs.org.uk> wrote: >> On Tue, 2017-01-24 at 17:14 -0500, m.roth at 5-cent.us wrote: >>> So, it installed happily. >>> >>> Then wouldn't boot. No problem, I'll bring it up with pxe, then chroot and >>> grub2-install. >>> >>> Um, nope. I edited the device map from hd0 and hd1 being the RAID to >>> /dev/sda and /dev/sdb, then ran grup2-install. It now tells me can't >>> identify the filesystem on hd0, and can't perform a safety check, and >>> gives up. >>> >>> What am I missing? Google is not giving me any answers.... >>> >> Surely, if you are using software RAID, then you should configure that >> RAID in anaconda, that will then cope with setting up the partitions to >> allow booting. Basically it needs a small non-RAID partition to hold >> /boot on the boot disk. >> >> Remember that the boot sequence is generally: BIOS reads MBR and >> executes it; MBR code reads kernel from /boot and executes it (yes, >> it's more complicated than that). If the MBR code doesn't know how to >> read a RAID partition, then it's going to fail, that's why you have a >> small non-RAID partition to hold /boot. >> >> Hardware RAID is different because it interfaces at the BIOS level so >> the MBR code doesn't need to know how to specifically read it. > If you are using RAID 1 kernel mirroring, you can do that with /boot too, > and Grub finds the kernel just fine. I've done it many times: > > 1. Primary partition 1 type FD, size 200M. /dev/sda1 and /dev/sdb1.I think it wiser to have /boot at 1Gb nowadays.> 2. Create /dev/md0 as RAID 1 from /dev/sda1 and /dev/sdb1. > 3. Assign /dev/md0 to /boot, ext3 format (presumably ext4 would work too?) > 4. Make sure to setup both drives separately in grub. > > Typically I then go on to have /dev/sda2+/dev/sdb2 => /dev/md1 => swap, > and /dev/sda3+/dev/sdb3 => /dev/md2 => / > > Cheers > Tony
> > If you are using RAID 1 kernel mirroring, you can do that with /boot too, > and Grub finds the kernel just fine. I've done it many times: > >Hmm, OK. I wonder why anaconda doesn't do it then. Reading various websites, it looks like grub2 can do it, but you have to make sure that various grub modules are installed first - i.e. do something like grub-install --modules='biosdisk ext2 msdos raid mdraid' /dev/xxx I don't know if they are added by default these days. The other gotcha is, of course, that the boot sectors aren't RAID'd - so if /dev/sda goes, replacing it will make the system unbootable since it doesn't contain the boot sectors. Hot swap will keep the system running but you have to remember to re-install the correct boot sector before reboot. If you have to bring the machine down to change the disk, then things could get interesting! P.
Tony Mountifield
2017-Jan-26 09:40 UTC
[CentOS] CentOS 7 install on one RAID 1 [not-so-SOLVED]
In article <1485416344.2047.1.camel at biggs.org.uk>, Pete Biggs <pete at biggs.org.uk> wrote:> > > > > If you are using RAID 1 kernel mirroring, you can do that with /boot too, > > and Grub finds the kernel just fine. I've done it many times: > > > > > Hmm, OK. I wonder why anaconda doesn't do it then. > > Reading various websites, it looks like grub2 can do it, but you have > to make sure that various grub modules are installed first - i.e. do > something like > > grub-install --modules='biosdisk ext2 msdos raid mdraid' /dev/xxx > > I don't know if they are added by default these days.I don't know, but I've never had to do it, when using plain mirroring, on either C4, C5 or C6. I can imagine you would need to if /boot was RAID 0 striped, if indeed that is even possible.> The other gotcha is, of course, that the boot sectors aren't RAID'd - > so if /dev/sda goes, replacing it will make the system unbootable since > it doesn't contain the boot sectors. Hot swap will keep the system > running but you have to remember to re-install the correct boot sector > before reboot. If you have to bring the machine down to change the > disk, then things could get interesting!Yup, been there, done that. So long as you use grub to install the boot sector on both drives, then you can always tell the BIOS to boot from the other drive to bring the system up after replacing the first disk. Anaconda doesn't set up the boot sector on the second drive by default, so I put some grub commands in the post-install section of kickstart to do so. Cheers Tony -- Tony Mountifield Work: tony at softins.co.uk - http://www.softins.co.uk Play: tony at mountifield.org - http://tony.mountifield.org