Bonjour,
J’ai crée un fichier preseed pour automatiser une installation.
Pour partitionner automatiquement mon disque comme suit: une partition / standard et /var et /data dans une partition lvm:
#fdisk -l
Périphérique Amorce Début Fin Blocs Id Système
/dev/sda1 * 1 31 248976 83 Linux
/dev/sda2 32 404 2996122+ 83 Linux
/dev/sda3 405 498 755055 82 Linux swap / Solaris
/dev/sda4 499 2610 16964640 5 Extended
/dev/sda5 499 2610 16964608+ 8e Linux LVM
# df -h
Sys. de fich. Tail. Occ. Disp. %Occ. Monté sur
/dev/sda2 2,9G 1,1G 1,7G 38% /
varrun 189M 500K 188M 1% /var/run
varlock 189M 0 189M 0% /var/lock
udev 189M 56K 189M 1% /dev
devshm 189M 0 189M 0% /dev/shm
/dev/sda1 236M 37M 188M 17% /boot
/dev/mapper/horus-data
8,1G 244M 7,4G 4% /data
/dev/mapper/horus-var
8,1G 247M 7,4G 4% /var
Ma recette:
#partitionement
d-i partman-auto/method string lvm
d-i partman-auto-lvm/new_vg_name string horus
## Clean all volume informations
d-i partman-auto/purge_lvm_from_device boolean true
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-lvm/confirm boolean true
d-i partman-auto/expert_recipe string atomic_scheme :: \
128 512 256 ext3 \
$primary{ } $bootable{ } \
method{ format } format{ } \
use_filesystem{ } filesystem{ ext3 } \
label{ /boot } mountpoint{ /boot } \
. \
3072 2000 4048 ext3 \
$primary{ } \
method{ format } format{ } \
use_filesystem{ } filesystem{ ext3 } \
label{ / } mountpoint{ / } \
. \
64 512 200% linux-swap \
$primary{ } \
method{ swap } format{ } \
. \
8500 2100 9500 ext3 \
$lvmok{ } \
method{ format } format{ } \
use_filesystem{ } filesystem{ ext3 } \
label{ /var } mountpoint{ /var } \
. \
2500 1000 1000000000 ext3 \
$lvmok{ } \
method{ format } format{ } \
use_filesystem{ } filesystem{ ext3 } \
options/usrquota{ usrquota } \
options/grpquota{ grpquota } \
label{ /data } mountpoint{ /data } \
.
d-i partman/confirm_write_new_label boolean true
d-i partman/choose_partition select \
Finish partitioning and write changes to disk
d-i partman/confirm boolean true
Maintenant je vousdrais une autre recette pour réinstaller mon système mais en CONSERVANT mes LVM (/var and /data)
(Pour éviter le bug de partman j’ai écrit la recette sur une seule ligne)
#partitionement
#d-i partman-auto/method string lvm
#d-i partman-auto-lvm/new_vg_name string horus
## Clean all volume informations
#d-i partman-auto/purge_lvm_from_device boolean true
#d-i partman-lvm/device_remove_lvm boolean true
#d-i partman-lvm/confirm boolean true
d-i partman-auto/expert_recipe string atomic_scheme :: \
128 512 256 ext3 \
$primary{ } $bootable{ } \
method{ format } format{ } \
use_filesystem{ } filesystem{ ext3 } \
label{ /boot } mountpoint{ /boot } \
. \
3072 2000 4048 ext3 \
$primary{ } \
method{ format } format{ } \
use_filesystem{ } filesystem{ ext3 } \
label{ / } mountpoint{ / } \
. \
64 512 200% linux-swap \
$primary{ } \
method{ swap } format{ } \
. \
8500 2100 9500 ext3 \
$lvmok{ } \
method{ keep } \
use_filesystem{ } filesystem{ ext3 } \
label{ /var } mountpoint{ /var } \
. \
2500 1000 1000000000 ext3 \
$lvmok{ } \
method{ keep } \
use_filesystem{ } filesystem{ ext3 } \
options/usrquota{ usrquota } \
options/grpquota{ grpquota } \
label{ /data } mountpoint{ /data } \
.
d-i partman/confirm_write_new_label boolean true
d-i partman/choose_partition select \
Finish partitioning and write changes to disk
d-i partman/confirm boolean true
J’ai désactiver les lignes de suppression de LVM et mis keep au lieu de format.
Évidemment ça ne fonctionne pas: l’installation s’arrête en me proposant les différents choix de repartitionnement (qui d’ailleurs ne fonctionne pas non plus)
Des idées?
Merci.