From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id C623E1381F3 for ; Thu, 24 Oct 2013 18:54:04 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id DC41EE0A92; Thu, 24 Oct 2013 18:53:53 +0000 (UTC) Received: from mail-wg0-f54.google.com (mail-wg0-f54.google.com [74.125.82.54]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id A9B9CE0A72 for ; Thu, 24 Oct 2013 18:53:52 +0000 (UTC) Received: by mail-wg0-f54.google.com with SMTP id c11so2826840wgh.9 for ; Thu, 24 Oct 2013 11:53:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:reply-to:to:subject:date:user-agent:references:in-reply-to :mime-version:content-type:content-transfer-encoding:message-id; bh=z3qKWzZj2MeQt6iZ8gwtN2DI9v7qA45b9z+IhfDVeoc=; b=MAgBP+CRRGK1ufSMOPU/foIOvtp23kAVndZH2AtKxo6AjyIzKlkkEU0NairPjfxSNX Nw/zW3jz+pFZlyjty2CsOHXkGSClu5PZWMvNr5Obw9/9vuVVhbpRPgY1aY582oB5eJuS kVoGTHM4GRXWV7gN2fFCmB9Ujo8u/8CfvV6ANIDh34KuEkBF12VazYZfb9H9My6FAv6b cOjtHJ/zmSOrPFRBvOMlj+mT0eLjPkOImj8aiprM8UFQSunc6isrzW3HH2NDaYJt3b2F 2DPz5u6Q2VFZioMGckbrRonlyic2jhYzsTdqawsUSYMFoMluzlIo/u+pS38nrF3z6H+E p45g== X-Received: by 10.180.188.164 with SMTP id gb4mr3457691wic.52.1382640830847; Thu, 24 Oct 2013 11:53:50 -0700 (PDT) Received: from dell_xps.localnet (230.3.169.217.in-addr.arpa. [217.169.3.230]) by mx.google.com with ESMTPSA id fb4sm29728259wib.8.2013.10.24.11.53.49 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 Oct 2013 11:53:49 -0700 (PDT) From: Mick To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] Re: [O/T] RAID help - now won't boot Date: Thu, 24 Oct 2013 19:53:20 +0100 User-Agent: KMail/1.13.7 (Linux/3.10.7-gentoo-r1; KDE/4.10.5; x86_64; ; ) References: <201310150834.21103.michaelkintzios@gmail.com> <201310212243.07180.michaelkintzios@gmail.com> <20131022071018.GB8510@nicolas-desktop.logifi.fr> In-Reply-To: <20131022071018.GB8510@nicolas-desktop.logifi.fr> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart4871704.2Qf6FlfdnS"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <201310241953.44553.michaelkintzios@gmail.com> X-Archives-Salt: e81ee930-349f-4f9b-af12-c3b2a3e05aeb X-Archives-Hash: 4e0579172b31ddf9669acb057df0e462 --nextPart4871704.2Qf6FlfdnS Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Tuesday 22 Oct 2013 08:10:18 Nicolas Sebrecht wrote: > The 21/10/13, Mick wrote: > > I'm fast gravitating towards this option ... > >=20 > > Although with metadata 0.90 I was able to progress with the installation > > (after I deselected the swap partitions) the grub-install script wanted > > to install in /dev/md127p1 but it failed. I had to override the Ubuntu > > installer since I could only install grub in the /dev/md127 block > > device. >=20 > Which is the one we expect. /dev/md127p1 is the first partition of > /dev/md127. Right, although Ubuntu's installer would point only to /dev/md127p1. I had= to=20 ask it to not install GRUB in the MBR (why would it choose /dev/md127p1 as = the=20 device where the MBR resides is another matter) which then allowed me to ed= it=20 the entry and point it to /dev/md127. Pointing GRUB installer to /dev/sda = or=20 sdb failed (no filesystem found). > > Either way, it won't boot again. Now it stays on a blank screen, no > > error at all shown. >=20 > I don't understand why this blank screen. Or do you mean a black screen? Yes, sorry, poor choice of words the colour of the screen is black, and the= =20 content blank (well, there is a horizontal, non-flashing cursor at the top= =20 left of the screen). > > I'll have another go with sysrescueCD to see if I install grub on > > /dev/sda and /dev/sdb and if this does not work either, >=20 > It should work. Linux software RAID is assembled once the kernel is up > and running. Before, the system boot as usual on a single disk. Though, > I'm not sure how mdadm will handle the disk change behind his back. Yes, it will! :-) OK, having tried a couple of options this is what I have concluded. Superblock with metadata 0.90 is written at the front of the disk. No need= to=20 partition each disk separately, because any partitions created on /dev/md0= =20 also show up on each disk, i.e. the partition table created on /dev/md0 see= ms=20 to be readily recognised on each /dev/sda & sdb disks, as can be verified w= ith=20 fdisk -l. Installing grub on /dev/sda and /dev/sdb is a straight forward=20 exercise either with the Ubuntu installer, or afterwards once booted into t= he=20 new installation with sysrescueCD. With any other metadata format things are more complicated. This may be=20 because the location of the metadata changes (not always at the start of th= e=20 disk) or because the format is different and the kernel doesn't deal with i= t=20 natively. Not sure and it doesn't matter. This is what I did to be able t= o=20 use mdadm -e 1.2, which is the default metadata format these days: Boot with sysrescueCD to create the array and partitions on it =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D mdadm --create --auto=3Dmdp --verbose /dev/md0 --level=3Dmirror --raid-devi= ces=3D2 \=20 /dev/sda /dev/sdb Then fdisk /dev/md0 and create 4 partitions. Leave them all with the defau= lt=20 linux type of 83 (unless you want to use some fs exotica here). Then 'fdis= k=20 /dev/sda' which will create an MSDOS partition table automatically, in case= =20 the disk doesn't yet have a partition table on it. Then I created one prim= ary=20 partition accepting the default start and end values offered by fdisk. Rep= eat=20 for /dev/sdb. Create fs on the RAID array: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D 'mkfs.ext4 -c -L /dev/md0p1' and repeat for each partition on = the=20 RAID except for the swap partition (if you have created one for this purpos= e). Boot with Ubuntu server CD to install the OS: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Go through the tedious installation process; yeah, I know - it is faster th= an=20 Gentoo, but it *feels* more tedious to me! :p=20 You'll find that the fs and labels are not recognised by Ubuntu's partition= =20 manager. Select each RAID partition (except swap) and set a fs plus a moun= t=20 point. These are used by the installer to populate the fstab with. Leave = the=20 partitions unformatted and ignore any warnings that come up later when you= =20 write these changes on disk. Continue with the installation until it is time to install GRUB. The=20 installer will choose /dev/md127p1. Select to *not* install GRUB in the MB= R,=20 which will allow you to edit the drive entry. Choose /dev/md127 and comple= te=20 the installation. =46ormat a swap partition on the RAID: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Reboot with sysrescueCD, use fdisk /dev/md0 (that's how it will be recognis= ed=20 by sysrescueCD) and change the fs type of the swap partition to 82. Then,= =20 'mkswap -c -l swap /dev/md0p2' or whichever partition you have your swap on= =2E =20 Edit /etc/fstab to include your new swap partition. I don't know why Ubunt= u's=20 installer would not accept the swap partition on a RAID1 device, but this w= as=20 the work around I used. Install GRUB on each disk: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Reboot sysrescueCD, but now use the alternative option to boot into a Linux= OS=20 on the disk. It will probe the disks, assemble the RAID1 array and boot in= to=20 Ubuntu OS. Install grub on /dev/sda and /dev/sdb - no need to stop the arr= ay. =20 Then 'update-initramfs -u' and from then on you can reboot into your new=20 installation. Note, if you get a drive failure, you will need to reinstall grub in the MB= R=20 of the new disk. I've written all this from memory so please correct any errors I've made. The problem (at least with grub2 which is all that I tried) is that the gru= b=20 installer does not take kindly to installing itself on the MBR of disks whi= ch=20 are partitionless and the position of the RAID metadata on the disk messes = up=20 GRUB's ability to find the partition table. I thought that creating a=20 partition table alone will stop it having a fit, but ultimately the creatio= n=20 of an empty partition with fd partition type was necessary. I'm posting this in the odd chance that anyone would like to run a RAID1 wi= th=20 RAID partitions on a single RAID device, with no LVM. It makes=20 removing/adding a disk a single line command, which reduces the likelihood = of=20 operator error for the users I have in mind for this particular=20 implementation. Thanks again for your help! :-) =2D-=20 Regards, Mick --nextPart4871704.2Qf6FlfdnS Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQEcBAABAgAGBQJSaWy4AAoJELAdA+zwE4YenJYH/1ewK//1kXbW4cxFwtHsEvJr DraLFBFteujicaR6roIcYmTeWFE5tu1ABvHw2vpOxGk/+2m5TSaK1dL+J26pyDjm mEgWanX5z5unq4VhltA0hZud/keVPgUAc1L7kODUyNApgcJY10IYB6i1wFbebmyM 5YMT0sN7Wxq51cgLBwoq4f+LBMUeUWQryG16XKAD4Vv4wL8Al8aJyV7GyT4iumQG xKliZaBfswZ6MhLyCulq8aIbwg1++JBM6k039qAYQV8b8fRGL1lHUjfjm6pRS2Ya cyrUTbD/ALsKSv+/43ERUWhHpBndobd/V0CqcJMKUbnBxGo3ZR7g5JUbu1SjQBQ= =H8Am -----END PGP SIGNATURE----- --nextPart4871704.2Qf6FlfdnS--