[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
File systems
From: |
Ludovic Courtès |
Subject: |
File systems |
Date: |
Sat, 10 May 2014 23:39:10 +0200 |
User-agent: |
Gnus/5.130009 (Ma Gnus v0.9) Emacs/24.3 (gnu/linux) |
Hello,
It’s now possible to declare file systems to be mounted in
‘operating-system’ declarations, like this:
(operating-system
(file-systems (list (file-system
(device "/dev/sda1")
(mount-point "/")
(type "ext3")
(needed-for-boot? #t))
(file-system
(device "/dev/sda2")
(mount-point "/home")
(type "ext4")
(needed-for-boot? #f)))
;; ...
)
File systems marked as “needed for boot” are checked and mounted by the
initrd. This is always the case for /. The initrd is meant to be
provisioned with the necessary kernel modules and fsck programs (see the
misnamed ‘qemu-initrd’ in (guix system linux-initrd).)
For each file system not “needed for boot”, a dmd service is created so
that it is mounted at a later point during the boot process.
To support clean unmounting of file systems upon shutdown, special dmd
services are added to the graph (see (gnu services base)):
• ‘root-file-system’, whose stop action is to remount / read-only;
this is the last service that is stopped when shutting down.
• For each file system not needed for boot, there’s a
‘file-system-XYZ’ service depending only on ‘root-file-system’, with
a stop action to unmount XYZ.
• ‘user-processes’, which depends on all the ‘file-system-XYZ’ and on
‘root-file-system’. Its stop action is to kill all the processes
still running. All the services that spawn processes must depend on
it. The goal is to make sure the file systems can actually be
unmounted.
That seems to work well and is rather pleasant to work with. Currently
the best way to test it is to build a freestanding VM image:
./pre-inst-env guix system vm-image --image-size=1.5GiB \
build-aux/hydra/demo-os.scm
demo-os.scm doesn’t specify any file system, but that gets automatically
added by ‘system-qemu-image’ in (gnu system vm).
Next will come handling of swap devices and the device mapper (for
LUKS.)
Comments welcome!
Ludo’.
- File systems,
Ludovic Courtès <=