guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH} Add RAID devices.


From: myglc2
Subject: Re: [PATCH} Add RAID devices.
Date: Sat, 30 Jul 2016 19:05:25 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Andreas Enge <address@hidden> writes:

> the attached patch adds RAID support to our mapped device mechanism.
>
> To give more explanation:
> Like for LUKS devices or file systems, the RAID itself needs to be created
> during installation, after booting from the USB key:
>    mdadm --create /dev/md0 --level=raid10 --layout=f2 \
>       --raid-devices=2 /dev/sda2 /dev/sdb2
>    (wait 12 hours or so for 4 TB disks)
>    mkfs.ext4 /dev/md0
>
> Then one adds a mapped-device of type raid-device-mapping, adds the
> raid10 kernel module to the initrd and can boot from the RAID device.
> The mapped-device mechanism calls "mdadm --assemble" and "mdadm --stop".
>
> I might write a more detailed blog post about this; there is a little
> subtlety with the non-automatic determination of dependencies between
> devices, so one needs to make sure that the partitions to be assembled
> are present before the mdadm command is executed.

Thanks. Starting with baby steps, I am running GuixSD system from a
separate drive and adding raid1 array with 2 new disks. I created an
array that will assemble like so...

address@hidden ~$ sudo mdadm --assemble /dev/md0 /dev/sdb1 /dev/sdc1
mdadm: /dev/md0 has been started with 2 drives.

address@hidden ~$ cat /proc/mdstat
Personalities : [raid1] 
md0 : active raid1 sdc1[0] sdb1[1]
      239809536 blocks super 1.2 [2/2] [UU]
      bitmap: 0/2 pages [0KB], 65536KB chunk

I added this to my config (system25.scm attached) ...

(operating-system
[...]
  (initrd (lambda (fs . args)
            (apply base-initrd fs
                   #:extra-modules '("raid1")
                   #:mapped-devices '((mapped-device
                                       (source (list "/dev/sdb1" "/dev/sdc1"))
                                       (target "/dev/md0")
                                       (type raid-device-mapping)))             
                      
                   args)))
[...]

I rebooted and the array is not assembled ;-(

address@hidden ~$ cat /proc/mdstat
Personalities : [raid1] 
unused devices: <none>

/var/log/messages contains ...
[...]
Jul 30 18:09:59 localhost vmunix: [    1.872801] md: raid1 personality 
registered for level 1
[...]

Any suggestions, corrections or a sample working config would be most welcome.

TIA - George

Attachment: system25.scm
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]