From: myglc2 <myglc2@gmail.com>
To: guix-devel@gnu.org
Subject: Re: [PATCH} Add RAID devices.
Date: Sun, 31 Jul 2016 12:12:02 -0400 [thread overview]
Message-ID: <86lh0hlrcd.fsf@gmail.com> (raw)
In-Reply-To: 20160731085203.GA4857@solar
[-- Attachment #1: Type: text/plain, Size: 1612 bytes --]
Andreas Enge <andreas@enge.fr> writes:
> On Sat, Jul 30, 2016 at 07:05:25PM -0400, myglc2 wrote:
>> > 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.
>> I rebooted and the array is not assembled ;-(
>
> Strange! But I will also tell you the subtlety ;-) Here is a trick to use
> (thanks to Ludovic):
> (define md0
> (mapped-device
> (source (list "/dev/sda2" "/dev/sdb2"))
> (target "/dev/md0")
> (type raid-device-mapping)))
> (operating-system
> ...
> (mapped-devices (list md0))
> (file-systems (cons (file-system
> (title 'device)
> (device "/dev/md0")
> (dependencies (list md0))
> (mount-point "/")
> (type "ext4"))
> %base-file-systems))
>
> The "dependencies" field makes sure that the file system is only mounted
> after the array is assembled; I am not sure that this is your problem,
> but you might want to give it a try.
>
> In the long run, this should be reprogrammed: Devices and file systems
> should wait until all their "inputs" are present, or at least wait for
> a reasonable time.
Thanks, I tried that. the 'guix system reconfigure' succeeds and starts
the raid array (please see system35.scm & system35.log, attached).
But the reboot hangs at:
[...] clocksource: Switched to clocksource tsc
[-- Attachment #2: system35.log --]
[-- Type: application/octet-stream, Size: 1418 bytes --]
root@g1 ~# cat /proc/mdstat
Personalities : [raid1]
unused devices: <none>
root@g1 ~# rm -fr /mnt/md0
root@g1 ~# ls /mnt
root@g1 ~# guix system reconfigure system35.scm
substitute: updating list of substitutes from 'https://mirror.hydra.gnu.org'... 100.0%
The following derivation will be built:
/gnu/store/rd6m57pga9ddf9lsvfja6jybb1vnrj7d-grub.cfg.drv
/gnu/store/l1mpwaxlf2nhm18vzxir9npdi2inis7j-system
/gnu/store/s6x0j9cy0vgfnzc6xybrgcx0k327brrf-grub.cfg
/gnu/store/7p3pc22s5ap4smm6habggjcgj83aaidv-grub-2.02beta3
activating system...
setting up setuid programs in '/run/setuid-programs'...
populating /etc from /gnu/store/7v9p4s8hkx8k58vsz6zk1q58hws9dmbz-etc...
usermod: no changes
usermod: no changes
usermod: no changes
making '/gnu/store/l1mpwaxlf2nhm18vzxir9npdi2inis7j-system' the current system...
guix system: loading new services: device-mapping-/dev/md0 file-system-/mnt/md0...
shepherd: Evaluating user expression (register-services (primitive-load "/gn...") #).
shepherd: Service device-mapping-/dev/md0 has been started.
shepherd: Service file-system-/mnt/md0 has been started.
Installing for i386-pc platform.
Installation finished. No error reported.
root@g1 ~# cat /proc/mdstat
Personalities : [raid1]
md0 : active raid1 sdc1[0] sdb1[1]
239809536 blocks super 1.2 [2/2] [UU]
bitmap: 1/2 pages [4KB], 65536KB chunk
unused devices: <none>
root@g1 ~# exit
exit
Process shell finished
[-- Attachment #3: system35.scm --]
[-- Type: application/octet-stream, Size: 2375 bytes --]
;;; g1 system config
(use-modules (gnu))
(use-service-modules networking ssh)
(use-package-modules
base
admin
disk
linux ; mdadm
package-management ; guix
screen
ghostscript ; gs-fonts
fonts ; font-dejavu font-gnu-freefont-ttf
curl ; lpaste
ssh
xorg certs
rsync
wget
version-control ; git
aspell
emacs
cups
graphviz
qemu
)
(define md0
(mapped-device
(source (list "/dev/sdb1" "/dev/sdc1"))
(target "/dev/md0")
(type raid-device-mapping)))
(operating-system
(host-name "g1")
(timezone "America/New_York")
(locale "en_US.utf8")
(bootloader (grub-configuration (device "/dev/sda")))
(mapped-devices (list md0))
(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)))
(file-systems (cons*
(file-system
(device "ssd-root")
(title 'label)
(mount-point "/")
(type "ext4"))
(file-system
(title 'device)
(device "/dev/md0")
(dependencies (list md0))
(mount-point "/mnt/md0")
(create-mount-point? #t)
(type "ext4"))
%base-file-systems))
(users (cons* (user-account
(name "glc")
(group "users")
(supplementary-groups '("wheel"))
(home-directory "/home/glc"))
(user-account
(name "g1")
(group "users")
(supplementary-groups '("wheel" "kvm"))
(home-directory "/home/g1"))
(user-account
(name "g1x")
(group "users")
(supplementary-groups '("wheel" "kvm"))
(home-directory "/home/g1x"))
(user-account
(name "gx")
(group "users")
(supplementary-groups '("wheel" "kvm"))
(home-directory "/home/gx"))
%base-user-accounts))
(packages
(cons*
glibc-utf8-locales
parted
mdadm
qemu
guix
screen
openssh nss-certs xauth
rsync wget
curl ;lpaste
git git-manpages
gs-fonts font-dejavu font-gnu-freefont-ttf
aspell
emacs
flycheck paredit magit
emacs-zenburn-theme emacs-markdown-mode emacs-web-mode
cups
graphviz
%base-packages))
(services (cons* (dhcp-client-service)
(lsh-service #:port-number 22)
%base-services)))
next prev parent reply other threads:[~2016-07-31 16:13 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-14 13:13 [PATCH] Add mdadm to the installation image Andreas Enge
2016-07-14 14:53 ` Mathieu Lirzin
2016-07-14 19:21 ` Efraim Flashner
2016-07-14 21:42 ` Andreas Enge
2016-07-15 13:27 ` Ludovic Courtès
2016-07-15 17:10 ` Andreas Enge
2016-07-16 10:50 ` Ludovic Courtès
2016-07-16 12:44 ` Andreas Enge
2016-07-15 14:25 ` myglc2
2016-07-23 14:07 ` [PATCH} Add RAID devices Andreas Enge
2016-07-24 5:43 ` Chris Marusich
2016-07-25 20:59 ` Ludovic Courtès
2016-07-25 21:17 ` Andreas Enge
2016-07-26 7:43 ` Chris Marusich
2016-07-30 23:05 ` myglc2
2016-07-31 8:52 ` Andreas Enge
2016-07-31 16:12 ` myglc2 [this message]
2016-07-31 16:25 ` Andreas Enge
2016-08-02 1:05 ` myglc2
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=86lh0hlrcd.fsf@gmail.com \
--to=myglc2@gmail.com \
--cc=guix-devel@gnu.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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.