1
Distribuce / Re:Debian 13: automatická instalace s LVM
« Poslední příspěvek od petrmu kdy Dnes v 12:49:29 »Tohle je funkční konfigurace disku pro preseed, kterou používám já. Je to pro systém s UEFI boot:
Vyrobí to nainstalovaný systém, která vypadá takhle:
Pro BIOS boot stačí odebrat efi oddíl z konfigurace. To jsou tyhle řádky:
Recept jde upravit tak aby to vytvřilo další oddíly. Tohle je varianta se samostatným /home a /var (tohle potřebuje 24 GB disk):
Kód: [Vybrat]
# necessary for manual LVM:
# actually not sure what this does, removing for now
#d-i partman-auto/init_automatically_partition select Manual
# this selects the disk partman will use, it's required
d-i partman-auto/disk string /dev/sda
# this selects the method partman will use, it's required
d-i partman-auto/method string lvm
#d-i partman-auto/init_automatically_partition select custom
# You can define the amount of space that will be used for the LVM volume
# group. It can either be a size with its unit (eg. 20 GB), a percentage of
# free space or the 'max' keyword.
# not sure if this has to be present
d-i partman-auto-lvm/guided_size string max
# remove any existing LVM
d-i partman-lvm/device_remove_lvm boolean true
# remove any existing RAID
d-i partman-md/device_remove_md boolean true
# this defines the VG name, not sure if it has to be present, removing for now
# multime names can't be present here
# the following definition of vg_main can be uncommented, uncommenting will not change the result
# this is because the vg defined manually is used
#d-i partman-auto-lvm/new_vg_name string vg_main
# the following is probably not necessary
d-i partman-auto/purge_lvm_from_device boolean true
# there used to be a $defaultignore{ } in the definition of the PV/VG partition, but it still works the same after removing it
# you can define extened partition using extended{ }
# a useful trick:
# put the physical partition that will be deleted later to free up space on an extended volume
# partman uses DIFFERENT units !!!
# conversion guide: multiply by 1.048576 and add 1 (MB) + round down
d-i partman-auto/choose_recipe select myrecipe
d-i partman-auto/expert_recipe string myrecipe :: \
630 10 630 fat32 \
method{ efi } format{ } \
mountpoint{ /boot/efi } \
.\
1074 10 1074 ext4 \
$primary{ } $bootable{ } \
method{ format } format{ } \
use_filesystem{ } filesystem{ ext4 } \
mountpoint{ /boot } \
. \
1 99999 -1 ext4 \
$primary{ } \
method{ lvm } \
vg_name{ vg_main } \
. \
12885 10 12885 ext4 \
$lvmok{ } in_vg{ vg_main } \
lv_name{ root } \
method{ format } format{ } \
use_filesystem{ } filesystem{ ext4 } \
mountpoint{ / } \
. \
2148 10 2148 linux-swap \
$lvmok{ } in_vg{ vg_main } \
lv_name{ swap } \
method{ swap } format{ } \
. \
1 99999 -1 ext4 \
$lvmok{ } in_vg{ vg_main } \
lv_name{ deleteme } \
method{ format } format{ } \
use_filesystem{ } filesystem{ ext4 } \
mountpoint{ /mnt/deleteme } \
.
# This makes partman automatically partition without confirmation, provided
# that you told it what to do using one of the methods above.
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman-lvm/confirm boolean true
d-i partman-lvm/confirm_nooverwrite boolean true
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
# for RAID
#d-i partman-md/confirm_nooverwrite boolean true
Vyrobí to nainstalovaný systém, která vypadá takhle:
Kód: [Vybrat]
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 16G 0 disk
├─sda1 8:1 0 600M 0 part /boot/efi
├─sda2 8:2 0 1G 0 part /boot
└─sda3 8:3 0 14.4G 0 part
├─vg_main-root 254:0 0 12G 0 lvm /
└─vg_main-swap 254:1 0 2G 0 lvm [SWAP]
Vše v LVM není, ale snad to pomůže. Minimální velikost disku pro to aby to fungovalo je 16 GB.Pro BIOS boot stačí odebrat efi oddíl z konfigurace. To jsou tyhle řádky:
Kód: [Vybrat]
630 10 630 fat32 \
method{ efi } format{ } \
mountpoint{ /boot/efi } \
.\
Recept jde upravit tak aby to vytvřilo další oddíly. Tohle je varianta se samostatným /home a /var (tohle potřebuje 24 GB disk):
Kód: [Vybrat]
d-i partman-auto/expert_recipe string myrecipe :: \
630 10 630 fat32 \
method{ efi } format{ } \
mountpoint{ /boot/efi } \
.\
1074 10 1074 ext4 \
$primary{ } $bootable{ } \
method{ format } format{ } \
use_filesystem{ } filesystem{ ext4 } \
mountpoint{ /boot } \
. \
1 99999 -1 ext4 \
$primary{ } \
method{ lvm } \
vg_name{ vg_main } \
. \
8590 10 8590 ext4 \
$lvmok{ } in_vg{ vg_main } \
lv_name{ root } \
method{ format } format{ } \
use_filesystem{ } filesystem{ ext4 } \
mountpoint{ / } \
. \
2148 10 2148 linux-swap \
$lvmok{ } in_vg{ vg_main } \
lv_name{ swap } \
method{ swap } format{ } \
. \
8590 10 8590 ext4 \
$lvmok{ } in_vg{ vg_main } \
lv_name{ var } \
method{ format } format{ } \
use_filesystem{ } filesystem{ ext4 } \
mountpoint{ /var } \
. \
2148 10 2148 ext4 \
$lvmok{ } in_vg{ vg_main } \
lv_name{ home } \
method{ format } format{ } \
use_filesystem{ } filesystem{ ext4 } \
mountpoint{ /home } \
. \
1 99999 -1 ext4 \
$lvmok{ } in_vg{ vg_main } \
lv_name{ deleteme } \
method{ format } format{ } \
use_filesystem{ } filesystem{ ext4 } \
mountpoint{ /mnt/deleteme } \
.
Poslední příspěvky