public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Mick <michaelkintzios@gmail.com>
To: gentoo-user@lists.gentoo.org
Subject: [gentoo-user] Re: [O/T] RAID help - now won't boot
Date: Sun, 20 Oct 2013 10:54:15 +0100	[thread overview]
Message-ID: <201310201054.45575.michaelkintzios@gmail.com> (raw)
In-Reply-To: <20131016201438.GB7388@vidovic>

[-- Attachment #1: Type: Text/Plain, Size: 7522 bytes --]

On Wednesday 16 Oct 2013 21:14:38 Nicolas Sebrecht wrote:
> On Wed, Oct 16, 2013 at 08:10:40PM +0200, Nicolas Sebrecht wrote:
> > On Tue, Oct 15, 2013 at 10:42:18PM +0100, Mick wrote:
> > > mdadm --create --auto=mdp --verbose /dev/md_d0 --level=mirror
> > > --raid-devices=2 /dev/sda /dev/sdb
> > > 
> > > which is thereafter partitioned with fdisk.  This is the one I have
> > > used in the past.
> > > 
> > > Which one is preferable, or what are the pros & cons of each?
> > 
> > For a basic RAID1, the best is to keep it as simple as possible. So
> > mirroring while disk looks better. It will also keep MBR/GPT synced.
> 
> s/while/the whole/
> 
> > I tend to make manual partitions that I mirror but this is because I
> > usually require to do more complex setups (e.g. mixing mirror types), or
> > because I need to have the setup more flexible.

OK, I spent some time to experiment in a VM.  Two small un-partitioned virtual 
disks which I used to create /dev/md0 as RAID 1 using sysrescuecd.  Then I 
used fdisk to create a MSDOS partition table on /dev/md0, followed by 4 
partitions on /dev/md0:
======================
~$ fdisk -l

Disk /dev/sda: 10.5 GB, 10522460160 bytes
255 heads, 63 sectors/track, 1279 cylinders, total 20551680 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/sda doesn't contain a valid partition table

Disk /dev/sdb: 10.5 GB, 10522460160 bytes
255 heads, 63 sectors/track, 1279 cylinders, total 20551680 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/sdb doesn't contain a valid partition table

Disk /dev/md0: 10.5 GB, 10521337856 bytes
2 heads, 4 sectors/track, 2568686 cylinders, total 20549488 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000c3148

    Device Boot      Start         End      Blocks   Id  System
/dev/md0p1   *        2048      718847      358400   83  Linux
/dev/md0p2          718848     3790847     1536000   82  Linux swap / Solaris
/dev/md0p3         3790848    18470911     7340032   83  Linux
/dev/md0p4        18470912    20549487     1039288   83  Linux
======================

So, no partition tables on /dev/sda or /dev/sdb drives and of course no 
partitions at all.  The partitions were created on the /dev/md0 block device.

I then rebooted with a Ubuntu server CD and installed the OS in the 
above filesystem.  It seemed to have recognised the RAID1 array as /dev/md127, 
instead of /dev/md0.

Trying to install GRUB on /dev/sda, or /dev/sdb, or /dev/md127p1 failed.  The 
only way to install GRUB and complete the Ubuntu server OS installation was to 
install it on /dev/md127, which it accepted.  However, on rebooting it failed 
with:  "FATAL: No boot medium found! System halted."


Rebooting with sysrescueCD and selecting to scan and boot any linux OS it 
could find, it picks up the RAID1 installation and it boots into it without 
any problem.  This is what I can see now:
======================
~$ lsblk 
NAME      MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
sda         8:0    0   9.8G  0 disk  
└─md0       9:0    0   9.8G  0 raid1 
  ├─md0p1 259:0    0   350M  0 md    /boot
  ├─md0p2 259:1    0   1.5G  0 md    [SWAP]
  ├─md0p3 259:2    0     7G  0 md    /
  └─md0p4 259:3    0  1015M  0 md    /home
sdb         8:16   0   9.8G  0 disk  
└─md0       9:0    0   9.8G  0 raid1 
  ├─md0p1 259:0    0   350M  0 md    /boot
  ├─md0p2 259:1    0   1.5G  0 md    [SWAP]
  ├─md0p3 259:2    0     7G  0 md    /
  └─md0p4 259:3    0  1015M  0 md    /home
======================


======================
~$ df -h -T
Filesystem     Type   Size  Used Avail Use% Mounted on
/dev/md0p3     ext4   6.9G  1.2G  5.4G  18% /
udev           tmpfs   10M  8.0K   10M   1% /dev
none           tmpfs  146M  352K  146M   1% /run
none           tmpfs  5.0M     0  5.0M   0% /run/lock
none           tmpfs  730M     0  730M   0% /run/shm
/dev/md0p1     ext2   329M   27M  285M   9% /boot
/dev/md0p4     ext4   999M   18M  931M   2% /home
======================


======================
~$ cat /proc/mdstat 
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] 
[raid10] 
md0 : active raid1 sda[0] sdb[1]
      10274744 blocks super 1.2 [2/2] [UU]
      
unused devices: <none>
======================


======================
~$ sudo blkid 

/dev/sr0: LABEL="sysrcd-3.8.0" TYPE="iso9660" 
/dev/sda: UUID="59195572-751a-3bd9-7771-6e5411b032c8" 
UUID_SUB="3acd1b2c-1c95-7c07-a8b2-8aa1b2a0a169" LABEL="sysresccd:0" 
TYPE="linux_raid_member" 
/dev/sdb: UUID="59195572-751a-3bd9-7771-6e5411b032c8" UUID_SUB="c63e97ba-42cb-
c4f8-550d-f1effae33d3f" LABEL="sysresccd:0" TYPE="linux_raid_member" 
/dev/md0p1: UUID="d9dbe2bc-0453-46e4-a5b0-779e55246004" TYPE="ext2" 
/dev/md0p2: UUID="f1a41bba-d519-42d5-8b9d-19292da899bd" TYPE="swap" 
/dev/md0p3: UUID="63d67a30-b4e9-4792-a081-cf1caae281ae" TYPE="ext4" 
/dev/md0p4: UUID="d6dc0b67-cbd3-47ae-a886-34299f491279" TYPE="ext4"
======================


======================
~$ sudo mdadm -Db /dev/md0
 
ARRAY /dev/md0 metadata=1.2 name=sysresccd:0 
UUID=59195572:751a3bd9:77716e54:11b032c8
======================


======================
~$ sudo mdadm --detail /dev/md0
/dev/md0:
        Version : 1.2
  Creation Time : Sat Oct 19 14:17:46 2013
     Raid Level : raid1
     Array Size : 10274744 (9.80 GiB 10.52 GB)
  Used Dev Size : 10274744 (9.80 GiB 10.52 GB)
   Raid Devices : 2
  Total Devices : 2
    Persistence : Superblock is persistent

    Update Time : Sun Oct 20 10:26:56 2013
          State : clean 
 Active Devices : 2
Working Devices : 2
 Failed Devices : 0
  Spare Devices : 0

           Name : sysresccd:0
           UUID : 59195572:751a3bd9:77716e54:11b032c8
         Events : 19

    Number   Major   Minor   RaidDevice State
       0       8        0        0      active sync   /dev/sda
       1       8       16        1      active sync   /dev/sdb
======================


This is my /etc/mdadm/mdadm.conf:
======================
~$ cat /etc/mdadm/mdadm.conf 
# mdadm.conf
#
# Please refer to mdadm.conf(5) for information about this file.
#

# by default (built-in), scan all partitions (/proc/partitions) and all
# containers for MD superblocks. alternatively, specify devices to scan, using
# wildcards if desired.
#DEVICE partitions containers

# auto-create devices with Debian standard permissions
CREATE owner=root group=disk mode=0660 auto=yes

# automatically tag new arrays as belonging to the local system
HOMEHOST <system>

# instruct the monitoring daemon where to send mail alerts
MAILADDR root

# definitions of existing MD arrays
ARRAY /dev/md0 metadata=1.2 UUID=59195572:751a3bd9:77716e54:11b032c8

# This file was auto-generated on Sat, 19 Oct 2013 15:23:12 +0100
# by mkconf $Id$
======================

Any ideas why the Ubuntu installation won't boot?

PS.  In case you ask:  I'm trying with Ubuntu because the user would struggle 
to look after a Gentoo system for this implementation.

-- 
Regards,
Mick

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

  parent reply	other threads:[~2013-10-20  9:55 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-15  7:34 [gentoo-user] RAID help Mick
2013-10-15 19:28 ` Paul Hartman
2013-10-15 21:42   ` Mick
2013-10-16 18:10     ` [gentoo-user] " Nicolas Sebrecht
2013-10-16 20:14       ` Nicolas Sebrecht
2013-10-17  5:33         ` Mick
2013-10-20  9:54         ` Mick [this message]
2013-10-20 12:57           ` [gentoo-user] Re: [O/T] RAID help - now won't boot Michael Hampicke
2013-10-20 13:13             ` Mick
2013-10-20 13:31               ` Michael Hampicke
2013-10-20 14:31                 ` joost
2013-10-21  5:33                   ` Mick
2013-10-21  5:59                     ` J. Roeleveld
2013-10-21  8:24                       ` Nicolas Sebrecht
2013-10-21  8:55                         ` J. Roeleveld
2013-10-21 21:42                           ` Mick
2013-10-22  7:10                             ` Nicolas Sebrecht
2013-10-24 18:53                               ` Mick

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201310201054.45575.michaelkintzios@gmail.com \
    --to=michaelkintzios@gmail.com \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox