AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题

问题[preseed](server)

Martin Hope
proxyd43
Asked: 2021-09-19 05:11:43 +0800 CST

预置 debian 11 完全无人值守(摆脱问题)

  • 7

我正在尝试完全自动化地预置 debian 11 netinstall。我在这里阅读了许多文档:

这是我的引导行(来自 grub.cfg)

set default="autoinstall"
set timeout=3

menuentry "Debian 11 Fully Automated UEFI LVM LUKS BTRFS Remote Decrypt DEBUG TTY4" --id autoinstall {
        set background_color=black
        linux    /debian-installer/amd64/linux auto=true url=tftp://192.168.1.100/preseed/debseed11_crypt.cfg net.ifnames=0 biosdevname=0 ipv6.disable=1 language=en locale=en_US.UTF-8 keymap=fr vga=788 noprompt DEBCONF_DEBUG=5 --- quiet
        initrd   /debian-installer/amd64/initrd.gz
}

这是我的预置文件:

#### Preseed preconfiguration file (for Debian buster)
### Partman early command
### Kernal parameter
#d-i debian-installer/add-kernel-opts string net.ifnames=0 biosdevname=0 hostname=unassigned-hostname domain=unassigned-domain
#d-i debconf/priority critical

#d-i debian-installer/add-kernel-opts string net.ifnames=0 biosdevname=0 console=ttyS0,19200n8
### Localization
d-i debian-installer/locale string en_US
d-i debian-installer/language string en
d-i debian-installer/country string US
#d-i debian-installer/locale string en_US.UTF-8 fr_FR.UTF-8
d-i localechooser/supported-locales multiselect en_US.UTF-8, fr_FR.UTF-8

### Keyboard selection
d-i keyboard-configuration/xkb-keymap select fr

###  Network configuration

# Netcfg choisira une interface connectée si possible. Cela empêchera
# # d'afficher une liste s'il y a plusieurs interfaces.
d-i netcfg/choose_interface select auto

#d-i netcfg/choose_interface select eth0
d-i netcfg/use_dhcp string true
d-i netcfg/link_wait_timeout string 10
d-i netcfg/dhcp_timeout string 60

#d-i netcfg/disable_autoconfig boolean true

d-i netcfg/dhcp_failed note
#d-i netcfg/dhcp_options select auto

#Configure network manually
# IPv4 Static network configuration
#d-i netcfg/get_ipaddress string 192.168.1.120
#d-i netcfg/get_netmask string 255.255.255.0
#d-i netcfg/get_gateway string 192.168.1.1
#d-i netcfg/get_nameservers string 192.168.1.1
#d-i netcfg/confirm_static boolean true

# Set a hostname
#d-i netcfg/get_hostname string zhurong
#d-i netcfg/get_domain string planet.mars
# Force a hostname
#d-i netcfg/hostname string zhurong.planet.mars
# Disable that annoying WEP key dialog
d-i netcfg/wireless_wep string


d-i netcfg/get_hostname unassigned-hostname 
d-i netcfg/get_domain unassigned-domain
d-i netcfg/get_hostname seen true
d-i netcfg/get_domain seen true

### Mirror settings
d-i mirror/country string manual
d-i mirror/http/hostname string httpredir.debian.org
d-i mirror/http/directory string /debian
d-i mirror/http/proxy string

### Account setup
# Skip creation of a normal user account
d-i passwd/make-user boolean false
# Set root password
# or encrypted using a crypt(3)  hash.
d-i passwd/root-password-crypted password $6$47Cx5oMpkh66eYNI$LV76xupgkvZ3rHJCq1NgXKzp3bBDv6g0FmMiSvmUp1jqaIkTEz5F6eA.SRhBzyPReVQEnzZWwFWSdKGBBn.tE1

### Clock and time zone setup
# Set hardware clock to UTC
d-i clock-setup/utc boolean true
# Set timezone
d-i time/zone string Europe/Paris
# Use NTP clock during installation
d-i clock-setup/ntp boolean true

### Partitioning
# LVM LUKS method

# Inhibit partman to fill the disk with random data 
d-i partman-auto-crypto/erase_disks boolean false

#d-i partman/early_command \
#       string dd if=/dev/zero of=/dev/sda bs=512 count=1
d-i partman-auto/method string crypto
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-lvm/guided_size string max
d-i partman-auto-lvm/new_vg_name string debian
d-i partman-auto/disk string /dev/vda
d-i partman-auto/choose_recipe select boot-crypto
d-i partman-crypto/passphrase       password  aaabbbccc
d-i partman-crypto/passphrase-again password  aaabbbccc
d-i partman-auto/expert_recipe string \
boot-crypto :: \
  1024 1024 1024 ext4 \
          $primary{ } $bootable{ } \
          method{ format } format{ } \
          use_filesystem{ } filesystem{ ext4 } \
          mountpoint{ /boot } \
  . \
  8192 8192 8192 linux-swap \
          $lvmok{ } lv_name{ swap } \
          in_vg { debian } \
          method{ swap } format{ } \
  . \
  80896 80896 1000000 btrfs \
          $lvmok{ } lv_name{ root } \
          in_vg { debian } \
          method{ format } format{ } \
          use_filesystem{ } filesystem{ btrfs } \
          mountpoint{ / } \
   . \

#d-i partman-basicfilesystems/no_mount_point boolean false
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true

d-i partman-md/confirm boolean true
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true

### Apt setup
d-i apt-setup/cdrom/set-first boolean false
d-i apt-setup/cdrom/set-next boolean false
d-i apt-setup/cdrom/set-failed boolean false
d-i apt-setup/services-select multiselect security, updates
d-i apt-setup/security_host string security.debian.org
### Package selection
tasksel tasksel/first multiselect standard
# Individual additional packages to install
d-i pkgsel/include string openssh-server vim tmux tcpdump dropbear-initramfs cryptsetup-initramfs python3.9
d-i pkgsel/upgrade select full-upgrade
d-i pkgsel/update-policy select none
d-i pkgsel/updatedb boolean true
popularity-contest popularity-contest/participate boolean false


### GRUB STUFF
d-i grub-installer/only_debian boolean true
d-i grub-installer/bootdev  string default

# Note: options passed to the installer will be added automatically. 
#d-i debian-installer/add-kernel-opts string nousb

# Optional password for grub, either in clear text
# #d-i grub-installer/password password r00tme
# #d-i grub-installer/password-again password r00tme
# # or encrypted using an MD5 hash, see grub-md5-crypt(8).
# #d-i grub-installer/password-crypted password [MD5 hash]
#
# # Use the following option to add additional boot parameters for the
# # installed system (if supported by the bootloader installer).
# # Note: options passed to the installer will be added automatically.
# #d-i debian-installer/add-kernel-opts string nousb
#
# ### Finishing up the installation
# # Avoid that last message about the install being complete.
d-i finish-install/reboot_in_progress note


d-i preseed/late_command string \
  mkdir -p -m 700 /target/root/.ssh; \
  echo "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJEe3gF//znGIzq30frI6O9qDn5eM6uqEZZlx7mR5SiS" > /target/root/.ssh/authorized_keys; \
  in-target chown --recursive root:root /root/.ssh; \
  in-target chmod 0644 /root/.ssh/authorized_keys; \
  in-target update-alternatives --set editor /usr/bin/vim.basic; \
  in-target passwd --expire root; \
  in-target echo 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJEe3gF//znGIzq30frI6O9qDn5eM6uqEZZlx7mR5SiS' > /etc/dropbear-initramfs/authorized_keys; \
  in-target sed -i '/*PasswordAuthentication*/c\PasswordAuthentication no' /etc/ssh/sshd_config; \
  in-target sed -i '/*PasswordAuthentication*/c\PasswordAuthentication no' /etc/ssh/sshd_config; \
  in-target systemctl enable --now sshd; \
  in-target sed -i '/*DROPBEAR_OPTIONS=*/c\DROPBEAR_OPTIONS="-I 300 -j -k -p 22 -s -c /bin/cryptroot-unlock "' /etc/dropbear-initramfs/config; \
  in-target sed -i '/*IP=*/c\IP="dhcp"' /etc/initramfs-tools/initramfs.conf; \
  in-target update-initramfs -u;
#

目前我得到 debien 安装程序要求我:

  • 主机名
  • 域名

我只是想摆脱这些问题。这是我尝试过的:

  • 我尝试在 pxe 服务器上的命令行内核选项中使用 priority=critical。
  • 我将我的 dhcpd 服务器配置为管理此特定主机的主机名域名。
host curiosity {
hardware ethernet 12:34:45:12:34:56;
fixed-address 192.168.1.90;
option host-name "curiosity";
option domain-name "planet.mars";
}

我知道我可以设置主机名/域变量,一切都会好起来的,但我想制作一个非常通用的预置来部署在多个服务器上。

一些帮助或线索将不胜感激。

提前谢谢你。

编辑:已解决:

顺便说一句,第一个 preseed 并不完美。如果有人对此感兴趣,那就更好了。

它通过 ssh DEBUG TTY4 实现全自动 Debian 11 UEFI LUKS BTRFS 远程解密

#### Preseed preconfiguration file (for Debian bullseye)

# Debian 11 Fully Automated UEFI LVM LUKS BTRFS Remote Decrypt via ssh DEBUG # TTY4


### Partman early command
### Kernel parameter
#d-i debian-installer/add-kernel-opts string net.ifnames=0 biosdevname=0 hostname=unassigned-hostname domain=unassigned-domain
#d-i debconf/priority critical

#d-i debian-installer/add-kernel-opts string net.ifnames=0 biosdevname=0 console=ttyS0,19200n8
### Localization
d-i debian-installer/locale string en_US
d-i debian-installer/language string en
d-i debian-installer/country string US
#d-i debian-installer/locale string en_US.UTF-8 fr_FR.UTF-8
d-i localechooser/supported-locales multiselect en_US.UTF-8, fr_FR.UTF-8

### Keyboard selection
d-i keyboard-configuration/xkb-keymap select fr

###  Network configuration

# Netcfg choisira une interface connectée si possible. Cela empêchera
# # d'afficher une liste s'il y a plusieurs interfaces.
d-i netcfg/choose_interface select auto

#d-i netcfg/choose_interface select eth0
d-i netcfg/use_dhcp string true
d-i netcfg/link_wait_timeout string 10
d-i netcfg/dhcp_timeout string 60

#d-i netcfg/disable_autoconfig boolean true

d-i netcfg/dhcp_failed note
#d-i netcfg/dhcp_options select auto

#Configure network manually
# IPv4 Static network configuration
#d-i netcfg/get_ipaddress string 192.168.1.120
#d-i netcfg/get_netmask string 255.255.255.0
#d-i netcfg/get_gateway string 192.168.1.1
#d-i netcfg/get_nameservers string 192.168.1.1
#d-i netcfg/confirm_static boolean true

# Set a hostname
#d-i netcfg/get_hostname string zhurong
#d-i netcfg/get_domain string planet.mars
# Force a hostname
#d-i netcfg/hostname string zhurong.planet.mars
# Disable that annoying WEP key dialog
d-i netcfg/wireless_wep string

#d-i netcfg/get_hostname=install
d-i netcfg/get_hostname unassigned-hostname 
d-i netcfg/get_domain unassigned-domain
d-i netcfg/get_hostname seen true
d-i netcfg/get_domain seen true

### Mirror settings
d-i mirror/country string manual
d-i mirror/http/hostname string httpredir.debian.org
d-i mirror/http/directory string /debian
d-i mirror/http/proxy string

### Account setup
# Skip creation of a normal user account
d-i passwd/make-user boolean false
# Set root password
# or encrypted using a crypt(3)  hash.
d-i passwd/root-password-crypted password $6$47Cx5oMpkh999YNI$XG76xupgkvZ3rHJCq1NgXKzp3bBfIuj0FmMiSvmUp1jqaIkTEz5F6eA.SRhBzyPReVQEnzZWwFWSdYGCBn.tE1

### Clock and time zone setup
# Set hardware clock to UTC
d-i clock-setup/utc boolean true
# Set timezone
d-i time/zone string Europe/Paris
# Use NTP clock during installation
d-i clock-setup/ntp boolean true

### Partitioning
# LVM LUKS method

# Inhibit partman to fill the disk with random data 
d-i partman-auto-crypto/erase_disks boolean false

#d-i partman/early_command \
#       string dd if=/dev/zero of=/dev/sda bs=512 count=1

# Force UEFI booting ('BIOS compatibility' will be lost). Default: false.
d-i partman-efi/non_efi_system boolean false
# Ensure the partition table is GPT - this is required for EFI
d-i partman-partitioning/choose_label string gpt
d-i partman-partitioning/default_label string gpt

d-i partman-auto/method string crypto
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-lvm/guided_size string max
d-i partman-auto-lvm/new_vg_name string debian
d-i partman-auto/disk string /dev/sda
d-i partman-auto/choose_recipe select boot-crypto
d-i partman-crypto/passphrase       password  aabbcc
d-i partman-crypto/passphrase-again password  aabbcc
d-i partman-auto/expert_recipe string \
boot-crypto :: \
  512 50 512 fat32 \
          $primary{ } $bootable{ } \
          method{ efi } format{ } \
          mountpoint{ /boot/efi } \
  . \
  1024 1024 1024 ext4 \
          $primary{ } $bootable{ } \
          method{ format } format{ } \
          use_filesystem{ } filesystem{ ext4 } \
          mountpoint{ /boot } \
  . \
  8192 8192 8192 linux-swap \
          $lvmok{ } lv_name{ swap } \
          in_vg { debian } \
          method{ swap } format{ } \
  . \
  80896 80896 1000000 btrfs \
          $lvmok{ } lv_name{ root } \
          in_vg { debian } \
          method{ format } format{ } \
          use_filesystem{ } filesystem{ btrfs } \
          mountpoint{ / } \
  . \

#d-i partman-basicfilesystems/no_mount_point boolean false
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true

d-i partman-md/confirm boolean true
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true

### Apt setup
d-i apt-setup/cdrom/set-first boolean false
d-i apt-setup/cdrom/set-next boolean false
d-i apt-setup/cdrom/set-failed boolean false
d-i apt-setup/services-select multiselect security, updates
d-i apt-setup/security_host string security.debian.org
### Package selection
tasksel tasksel/first multiselect standard
# Individual additional packages to install
d-i pkgsel/include string openssh-server vim tmux tcpdump dropbear-initramfs cryptsetup-initramfs python3.9
d-i pkgsel/upgrade select full-upgrade
d-i pkgsel/update-policy select none
d-i pkgsel/updatedb boolean true
popularity-contest popularity-contest/participate boolean false


### GRUB STUFF
d-i grub-installer/only_debian boolean true
d-i grub-installer/bootdev  string default

# Note: options passed to the installer will be added automatically. 
#d-i debian-installer/add-kernel-opts string nousb

# Optional password for grub, either in clear text
# #d-i grub-installer/password password r00tme
# #d-i grub-installer/password-again password r00tme
# # or encrypted using an MD5 hash, see grub-md5-crypt(8).
# #d-i grub-installer/password-crypted password [MD5 hash]
#
# # Use the following option to add additional boot parameters for the
# # installed system (if supported by the bootloader installer).
# # Note: options passed to the installer will be added automatically.
# #d-i debian-installer/add-kernel-opts string nousb
#
# ### Finishing up the installation
# # Avoid that last message about the install being complete.
d-i finish-install/reboot_in_progress note


d-i preseed/late_command string \
  mkdir -p -m 700 /target/root/.ssh; \
  echo "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJEe3gF//znGIzq30frI6O9qDn5eM6uqEZZlx7mR5SiS" > /target/root/.ssh/authorized_keys; \
  in-target chown --recursive root:root /root/.ssh; \
  in-target chmod 0644 /root/.ssh/authorized_keys; \
  in-target update-alternatives --set editor /usr/bin/vim.basic; \
  

d-i preseed/late_command string \
  mkdir -p -m 700 /target/root/.ssh; \
  echo "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJEe3gF//znGIzq30frI6O9qDn5eM6uqEZZlx7mR5SiS" > /target/root/.ssh/authorized_keys; \
  in-target chown --recursive root:root /root/.ssh; \
  in-target chmod 0644 /root/.ssh/authorized_keys; \
  in-target update-alternatives --set editor /usr/bin/vim.basic; \
  echo 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJEe3gF//znGIzq30frI6O9qDn5eM6uqEZZlx7mR5SiS' > /target/etc/dropbear-initramfs/authorized_keys; \
  echo 'PasswordAuthentication no' >> /target/etc/ssh/sshd_config.d/setup; \
  echo 'PermitRootLogin prohibit-password' >> /etc/ssh/sshd_config.d/setup; \
  echo 'auto eno1' >> /target/etc/network/interfaces; \
  sed -i 's/eth0/eno1/g' /target/etc/network/interfaces; \
  in-target systemctl enable --now sshd; \
  echo 'DROPBEAR_OPTIONS="-I 300 -j -k -p 22 -s -c /bin/cryptroot-unlock"' >> /target/etc/dropbear-initramfs/config; \
  echo 'IP="dhcp"' >> /target/etc/initramfs-tools/initramfs.conf; \
  in-target update-initramfs -u;

#  in-target passwd --expire root; \

解决 !

debian automated-install pxe-boot preseed
  • 1 个回答
  • 5702 Views
Martin Hope
Bil5
Asked: 2021-08-18 01:29:16 +0800 CST

预置安装后 Debian 安装程序不会退出

  • 0

我正在进行预置安装,其中涉及debconf在 debian 安装程序中显示 INFO 消息。在 late_command 结束时,我希望系统弹出安装 cdrom,并重新启动我的实例。问题是,它不是以这种方式运行,而是返回到 debian 安装程序菜单,为了完成安装过程,它只留下了手动关闭和从磁盘引导以弹出安装 cdrom 的选项。

重要的是要准确地说,这种意外行为仅在我开始使用debconf INFO消息时出现(它之前按预期工作,因此preseed.cfg通常正确配置),因此它与它直接相关。

以下是以下内容:我的,late_command part由其启动的脚本,安装完成的时间,以及我被引导回来的屏幕。late_commanddebconfsyslog

late_command:

d-i preseed/late_command string \
cp -rf /cdrom/build /target/home/device; \
/bin/sh /target/home/machine/build/deployment-preseed-track.sh; \
chmod +x /target/home/machine/build/deployment-preseed.sh; \
in-target --pass-stdout ./home/machine/build/deployment-preseed.sh > /target/var/log/installation.log; \
in-target rm -rf /home/machine/build;

deployment-preseed-track.sh(它基本上是通过扫描日志来检测部署进度)

#!/bin/sh

. /usr/share/debconf/confmodule
. "/home/machine/build/variables.sh"

logFile="/target${INSTALLATION_LOG_LOCATION}"
templatePath="/target/tmp/deployment_progress_tracker.templates"

cat > "${templatePath}" << 'EOF'
Template: deployment_progress_tracker/progress/fallback
Type: text
Description: ${STEP}...
EOF

debconf-loadtemplate deployment_progress_tracker "${templatePath}"
db_progress START 0 1 deployment_progress_tracker/progress

watchLogs () {
  deploymentDone=false
  while ! $deploymentDone
  do
    if [ -f "${logFile}" ]; then
      step=$(grep -E -o -a -h "Progress-step: .*" "${logFile}" | tail -1 | sed 's/Progress-step: //')
      if [ -z "${step##*$DEPLOYMENT_FINISHED*}" ]; then
        deploymentDone=true
      elif [ -n "${step}" ]; then
        db_subst deployment_progress_tracker/progress/fallback STEP "${step}"
        db_progress INFO deployment_progress_tracker/progress/fallback
      fi
    fi
    sleep 3
  done
}

系统日志

回到这个屏幕

debian preseed debconf
  • 1 个回答
  • 144 Views
Martin Hope
Bil5
Asked: 2021-08-06 02:30:17 +0800 CST

在 Debian 无人值守预置安装期间向用户显示消息

  • 2

在late_command无人值守安装的步骤中,我正在运行一个 shell 脚本:

d-i preseed/late_command string in-target /bin/sh -c './execute-script.sh'

当达到 late_command 步骤时,UI(蓝色背景,灰色窗口)显示“正在运行 preseed...”消息:

在此处输入图像描述

我想知道是否有任何方法可以根据execute-script.sh正在做的事情来生动地显示其他消息。

我天真地认为使用带有回声的常规 STDOUT 可以解决问题,但它似乎更复杂。

到目前为止,我的搜索引起了我的注意,debconf但我还没有找到任何方法。

我的脚本的当前版本根据@Andrew 的答案重新调整:

#!/bin/sh

. /usr/share/debconf/confmodule
. "./variables.sh"

logFile="/target${INSTALLATION_LOG_LOCATION}"
templatePath="/target/tmp/deployment_progress_tracker.templates"

cat > "${templatePath}" << 'EOF'
Template: deployment_progress_tracker/progress/fallback
Type: text
Description: ${STEP}...
EOF

debconf-loadtemplate deployment_progress_tracker "${templatePath}"
db_progress START 0 1 deployment_progress_tracker/progress

watchLogs () {
  deploymentDone=false
  while ! $deploymentDone
  do
    if [ -f "${logFile}" ]; then
      step=$(grep -E -o -a -h "Progress-step: .*" "${logFile}" | tail -1 | sed 's/Progress-step: //')
      if [ -z "${step##*$DEPLOYMENT_FINISHED*}" ]; then
        deploymentDone=true
      elif [ -n "${step}" ]; then
        db_subst deployment_progress_tracker/progress/fallback STEP "${step}"
        db_progress INFO deployment_progress_tracker/progress/fallback
      fi
    fi
    sleep 3
  done
}



(
  watchLogs;
  rm -f "${templatePath}";
  db_progress SET 1;
  sleep 1;
  db_progress STOP;
  db_unregister deployment_progress_tracker/progress;
) &

前面的脚本将产生以下结果:

在此处输入图像描述

并返回安装程序菜单(选择完成安装实际上将再次运行预置部分并失败,选择中止不会卸载 ISO 并重新启动,无论如何,我正在尝试自动完成卸载和重新启动):

在此处输入图像描述

debian unattended stdout preseed debconf
  • 1 个回答
  • 413 Views
Martin Hope
dxt2
Asked: 2019-09-12 03:22:21 +0800 CST

Debian preseed.cfg 格式化

  • 0

我正在尝试从 preseed.cfg 自定义用户配置文件,有些命令正在运行,有些则没有。互联网上有很多相互矛盾的片段,所以谷歌搜索实际上弊大于利。

例如这些工作:

in-target apt install -y --no-install-recommends ...; \
in-target wget http://dx10.co.za/setup/dxt2.zip; \

而这些不会:

cd /target/home/$USER; \
sed -i 's/GRUB_TIMEOUT=5/GRUB_TIMEOUT=0/g' /target/etc/default/grub; \
touch /target/etc/apt/apt.conf; \
echo "vm.swappiness = 10" | tee -a /target/etc/sysctl.conf; \

我试过后者有/没有in-target,没有指定/target/位置等。

有人可以告诉我这些命令的正确格式吗,因为官方文档有 1 行作为示例,并且它不包含除 apt 之外的任何示例...

我的最终目标是:下载主题文件,复制到/etc/skel& /home/$USER(不是 root,设置新创建的用户),编辑 grub & apt 设置,为 sysctl.conf 添加优化设置,然后重新启动到新样式的桌面。

preseed
  • 1 个回答
  • 201 Views
Martin Hope
Karthik Nayak
Asked: 2016-10-06 06:00:16 +0800 CST

不带 LVM 的 RAID 1 的 Ubuntu Preseed 文件

  • -1

我正在尝试使用 Ubuntu 的 Preseed 文件安装带有 RAID 1 且没有 LVM 的 ubuntu。

基本上我希望/dev/sda和/dev/sdb在 RAID 中,不需要主分区和交换分区。

这是我尝试过的:

d-i partman-auto/method string raid
d-i partman-auto/disk string /dev/sda /dev/sdb

d-i partman-auto/expert_recipe string \
      multiraid ::                                   \
          1000 5000  raid                            \
                  $primary{ } method{ raid }  $bootable{ } format{ } \
          .                                          \

d-i partman-auto-raid/recipe string \
1 2 0 ext3 /                        \
      /dev/sda1#/dev/sdb1           \
.

d-i partman-md/confirm boolean true
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
d-i partman-basicfilesystems/no_swap boolean false

这失败了,系统日志是: http: //pastebin.com/XaTkiJSZ

ubuntu raid preseed
  • 1 个回答
  • 1651 Views
Martin Hope
Arseni Mourzenko
Asked: 2016-07-24 16:20:50 +0800 CST

我可以防止 Debian 在安装过程中两次访问 DHCP 服务器吗?

  • 3

我有一个 DHCP 服务器用于无人值守安装 Debian:从 PXE 引导,然后使用预种子安装操作系统。

DHCP 服务器(Debian 的isc-dhcp-server软件包)被配置为在分发新租约时执行操作(执行 HTTP POST):

subnet 192.168.0.0 netmask 255.255.252.0 {
    [...]
    filename "pxelinux.0";

    on commit {
        set client_ip = binary-to-ascii(10, 8, ".", leased-address);
        execute("curl", "-X", "POST", [...])
    }
}

[...]

host vmhost2 {
    hardware ethernet 00:19:66:60:c3:61;
    fixed-address 192.168.1.13;
}

我注意到在无人值守的安装过程中,HTTP POST 进行了两次:第一次是在机器启动几秒钟后(这是预期的),大约三十秒后 Debian 安装程序正在配置网络。

我没想到第二个请求。其实这是对应的preseed配置:

di netcfg/get_hostname 字符串 vmhost2
di netcfg/get_domain 字符串 pelicandd.com

di netcfg/choose_interface 选择自动
di netcfg/disable_autoconfig 布尔值 true
di netcfg/disable_dhcp 布尔值 true
di netcfg/dhcp_failed 说明
di netcfg/dhcp_options 选择手动配置网络

di netcfg/get_ipaddress 字符串 192.168.1.13
di netcfg/get_netmask 字符串 255.255.252.0
di netcfg/get_gateway 字符串 192.168.1.1
di netcfg/get_nameservers 字符串 192.168.1.3 192.168.1.4 8.8.8.8 8.8.4.4
di netcfg/confirm_static boolean true

我认为该netcfg/disable_dhcp选项表明安装程序不需要联系 DHCP 服务器,但它仍然需要。

问题:

  • 尽管有预置选项,为什么安装程序第二次联系 DHCP 服务器?

  • 有没有办法阻止它这样做,或者通过预置选项,或者通过修改 ISC DHCP 服务器的配置以忽略第二个租约?

dhcp isc-dhcp preseed
  • 1 个回答
  • 1679 Views
Martin Hope
eXe
Asked: 2016-07-13 01:15:49 +0800 CST

Preseed Ubuntu / Debian - 分区:防止“分区 1 不在物理扇区边界上启动”。

  • 5

Ubuntu / Debian 的预置工作正常 - 系统是可启动的。

但fdisk -l结果如下:

Disk /dev/sda: 50 GiB, 53687091200 bytes, 104857600 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x000e157a

Device     Boot    Start       End  Sectors   Size Id Type
/dev/sda1             63    192779   192717  94.1M 83 Linux
/dev/sda2  *      192780   1172744   979965 478.5M 83 Linux
/dev/sda3        1172745  96470324 95297580  45.5G 83 Linux
/dev/sda4       96470325 104856254  8385930     4G 82 Linux swap / Solaris

Partition 1 does not start on physical sector boundary.
Partition 2 does not start on physical sector boundary.
Partition 3 does not start on physical sector boundary.
Partition 4 does not start on physical sector boundary.

我当前在 preseed 中的分区参数是:

d-i partman-lvm/device_remove_lvm                   boolean true
d-i partman-auto/purge_lvm_from_device              boolean true
d-i partman-md/device_remove_md                     boolean true
d-i partman-lvm/confirm                             boolean true
d-i partman/alignment                               select cylinder
d-i partman/confirm                                 boolean true
d-i partman-basicfilesystems/no_swap                  boolean false
d-i partman-partitioning/confirm_write_new_label    boolean true
d-i partman/choose_partition                        select finish
d-i partman/confirm_nooverwrite                     boolean true
d-i grub-installer/only_debian                      boolean true
d-i grub-installer/bootdev                                      string /dev/sda
d-i partman-auto/disk                               string /dev/sda
d-i partman-auto/method                             string regular
d-i partman-auto/expert_recipe string                         \
      boot-root ::                                            \
              100 50 100 free                                 \
                          $gptonly{ }                         \
                          $primary{ }                         \
                          $bios_boot{ }                       \
                          method{ biosgrub }                  \
              .                                               \
              500 50 500 ext2                                 \
                      $primary{ } $bootable{ }                \
                      method{ format } format{ }              \
                      use_filesystem{ } filesystem{ ext2 }    \
                      mountpoint{ /boot }                     \
              .                                               \
              500 10000 1000000000 ext4                       \
                      $primary{ }                             \
                      method{ format } format{ }              \
                      use_filesystem{ } filesystem{ ext4 }    \
                      mountpoint{ / }                         \
              .                                               \
              200% 500 200% linux-swap                        \
                      $primary{ }                             \
                      method{ swap } format{ }                \
              .

如何避免Partition {n} does not start on physical sector boundary错误。预置时如何在partman中设置正确的起始扇区和扇区大小?

ubuntu debian partition preseed partition-alignment
  • 1 个回答
  • 1735 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve