Debian プリセットは lvm を生成しませんが、専門家のレシピで作成します。

Debian プリセットは lvm を生成しませんが、専門家のレシピで作成します。

私は次の助けを借りて事前設定されたスクリプトを作成しました。このブログ私はそれに論理ボリュームを作成するように変更しました。

スクリプトの結果は次のとおりです。

d-i     debian-installer/locale string en_US.UTF-8
d-i     debian-installer/splash boolean false
d-i     debian-installer/language string en
d-i     debain-installer/country string US
d-i     console-setup/ask_detect        boolean false
d-i     console-setup/layoutcode        string us
d-i     netcfg/choose_interface select auto
#d-i     netcfg/choose_interface select eth0
d-i     netcfg/get_nameservers  string 
d-i     netcfg/get_ipaddress    string 
d-i     netcfg/get_netmask      string 255.255.255.0
d-i     netcfg/get_gateway      string 
d-i     netcfg/confirm_static   boolean true
d-i     netcfg/get_hostname string myhost
d-i     mirror/country string manual
d-i     mirror/http/hostname string http.nl.debian.org
d-i     mirror/http/directory string /debian
d-i     mirror/http/proxy string
d-i     partman-auto/disk string /dev/sda /dev/sdb
d-i     partman-auto/method string raid
d-i     partman-lvm/device_remove_lvm boolean true
d-i     partman-md/device_remove_md boolean true
d-i     partman-lvm/confirm boolean true
d-i     partman-auto/choose_recipe select recipe_sps
d-i     partman-auto-lvm/new_vg_name string vg_sps
#d-i     partman-auto-lvm/guided_size string 30GB
d-i     partman-auto/expert_recipe string        \
           recipe_sps ::                         \
             512 30 512 raid                     \
                $lvmignore{ }                    \
                $primary{ } method{ raid }       \
             .                                   \
             1000 35 250000000 raid              \
                $lvmignore{ }                    \
                $primary{ } method{ raid }       \
             .                                   \
             5500 50 6000 ext4                   \
                $defaultignore{ }                \
                $lvmok{ }                        \
                lv_name{ root }                  \
                method{ format }                 \
                format{ }                        \
                use_filesystem{ }                \
                filesystem{ ext4 }               \
                mountpoint{ / }                  \
             .                                   \
             4000 50 4100 ext4                   \
                $defaultignore{ }                \
                $lvmok{ }                        \
                lv_name{ home }                  \
                method{ format }                 \
                format{ }                        \
                use_filesystem{ }                \
                filesystem{ ext4 }               \
                mountpoint{ /home }              \
             .                                   \
             4000 50 4100 ext4                   \
                $defaultignore{ }                \
                $lvmok{ }                        \
                lv_name{ varlog }                \
                method{ format }                 \
                format{ }                        \
                use_filesystem{ }                \
                filesystem{ ext4 }               \
                mountpoint{ /var/log }           \
             .                                   \
             60000000 50 250000000 ext4          \
                $defaultignore{ }                \
                $lvmok{ }                        \
                lv_name{ varvirtualbox }         \
                method{ format }                 \
                format{ }                        \
                use_filesystem{ }                \
                filesystem{ ext4 }               \
                mountpoint{ /var/virtualbox }    \
             .                                   

# Last you need to specify how the previously defined partitions will be
# used in the RAID setup. Remember to use the correct partition numbers
# for logical partitions. RAID levels 0, 1, 5, 6 and 10 are supported;
# devices are separated using "#".
# Parameters are:
# <raidtype> <devcount> <sparecount> <fstype> <mountpoint> \
#          <devices> <sparedevices>

d-i partman-auto-raid/recipe string \
    1 2 0 ext2 /boot                \
          /dev/sda1#/dev/sdb1       \
    .                               \
    1 2 0 lvm -                     \
          /dev/sda2#/dev/sdb2       \
.                               
d-i     mdadm/boot_degraded boolean false
d-i     partman-md/confirm boolean true
d-i     partman-partitioning/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
d-i     partman-md/confirm_nooverwrite  boolean true
d-i     partman/confirm_nooverwrite boolean true
d-i     clock-setup/utc boolean true
d-i     clock-setup/ntp boolean true
d-i     time/zone string Europe/Amsterdam
d-i     base-installer/kernel/image     string linux-server
d-i     passwd/root-login       boolean true
d-i     passwd/root-password password r00tme
d-i     passwd/root-password-again password r00tme
d-i     passwd/make-user boolean false
d-i     user-setup/allow-password-weak  boolean false
d-i     user-setup/encrypt-home boolean false
d-i     passwd/user-default-groups      string adm cdrom dialout lpadmin plugdev sambashare
d-i     apt-setup/services-select       multiselect security, updates
d-i     apt-setup/security_host string security.debian.org
d-i     apt-setup/non-free boolean true
d-i     apt-setup/contrib boolean true
d-i     debian-installer/allow_unauthenticated  string false
d-i     pkgsel/upgrade  select safe-upgrade
d-i     pkgsel/language-packs   multiselect 
d-i     pkgsel/update-policy    select none
d-i     pkgsel/updatedb boolean true
tasksel tasksel/first multiselect standard, openssh-server


d-i grub-installer/grub2_instead_of_grub_legacy boolean true 
d-i grub-installer/only_debian boolean false 
d-i grub-installer/bootdev string /dev/sda /dev/sdb

d-i     finish-install/keep-consoles    boolean false
d-i     finish-install/reboot_in_progress       note 
d-i     cdrom-detect/eject      boolean true
d-i     debian-installer/exit/halt      boolean false
d-i     debian-installer/exit/poweroff  boolean false
d-i     pkgsel/include string vim openssh-server openvpn
popularity-contest popularity-contest/participate boolean false

これでこのスクリプトを使用しますが、完了すると(エラーなし)、ブート、ルート、およびスワップパーティションのみが残ります。

root@debian:~# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/dm-0       112G  854M  106G   1% /
udev             10M     0   10M   0% /dev
tmpfs           3.2G  8.6M  3.2G   1% /run
tmpfs           7.9G     0  7.9G   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           7.9G     0  7.9G   0% /sys/fs/cgroup
/dev/md0        472M   34M  414M   8% /boot

root@debian:~# lvs
  LV     VG     Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  root   vg_sps -wi-ao---- 113.85g                                                    
  swap_1 vg_sps -wi-ao----   4.85g  

しかし、私のプロのレシピでは、/home /var/logおよび/var/virtualboxボリュームも作成します。

ベストアンサー1

最初に変更したいのは、「string」と「recipe_sps」の間のスペースの数です。

~によるとこれ12.3.2.2:「4番目と最後のフィールドには答えの値が含まれています。このフィールドは3番目のフィールドとスペースで区切る必要があります。複数のスペースがある場合、次のスペース文字は値の一部と見なされます。

幸いなことに、この段階でシステムを起動できるようになったら(レシピが失敗した場合)、/var/log/installer/cdebconf/questions.datにレシピが含まれていること、および選択されていることを確認してください(そうでない場合もあります)あります)。 。

追加済み:/var/log/installer/syslogでpartmanメッセージを確認してください。私のメッセージはとても明確でした。 「partman-auto:使用可能なディスク容量(8589)がエキスパートレシピ(67595)に比べて小さすぎます。スキップ」

おすすめ記事