如果安装了以前的操作系统,Debian 预置安装将会失败

如果安装了以前的操作系统,Debian 预置安装将会失败

我正在尝试自动安装 Debian 12。当我使用 live CD 擦除磁盘时,它工作正常,但我希望预置 iso 擦除磁盘并继续安装。当磁盘上已安装操作系统(如 debian 9)时,我收到错误"Failed to create a file system, the ext4 file system creation in partition #1 of SCSI1 (0,0,0) (sda) failed

如果我看一下伪终端: partman: /dev/sda1 is mounted; will not make a filesystem here.

这是我正在使用的预置文件:

### Partitioning
## Partitioning example
# If the system has free space you can choose to only partition that space.
# This is only honoured if partman-auto/method (below) is not set.
#d-i partman-auto/init_automatically_partition select biggest_free

# Alternatively, you may specify a disk to partition. If the system has only
# one disk the installer will default to using that, but otherwise the device
# name must be given in traditional, non-devfs format (so e.g. /dev/sda
# and not e.g. /dev/discs/disc0/disc).
# For example, to use the first SCSI/SATA hard disk:
d-i partman-auto/disk string /dev/sda
# In addition, you'll need to specify the method to use.
# The presently available methods are:
# - regular: use the usual partition types for your architecture
# - lvm:     use LVM to partition the disk
# - crypto:  use LVM within an encrypted partition
d-i partman-auto/method string regular

# 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.
#d-i partman-auto-lvm/guided_size string max

# If one of the disks that are going to be automatically partitioned
# contains an old LVM configuration, the user will normally receive a
# warning. This can be preseeded away...
d-i partman-lvm/device_remove_lvm boolean true
# The same applies to pre-existing software RAID array:
d-i partman-md/device_remove_md boolean true
# And the same goes for the confirmation to write the lvm partitions.
d-i partman-lvm/confirm boolean true
d-i partman-lvm/confirm_nooverwrite boolean true

# You can choose one of the three predefined partitioning recipes:
# - atomic: all files in one partition
# - home:   separate /home partition
# - multi:  separate /home, /var, and /tmp partitions
d-i partman-auto/choose_recipe select atomic

# 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/confirm boolean true
d-i partman/confirm_nooverwrite boolean true

## Controlling how partitions are mounted
# The default is to mount by UUID, but you can also choose "traditional" to
# use traditional device names, or "label" to try filesystem labels before
# falling back to UUIDs.
d-i partman/mount_style select uuid

答案1

/dev/sda1自动安装的预置过程中存在错误/media。添加早期命令umount /media可修复先前安装操作系统的服务器上的问题。在尚未安装操作系统的服务器上,该命令将失败,因为没有 /media 可供卸载。我们可以继续,安装就会继续。

在预置文件中添加了这个早期命令: d-i preseed/early_command string umount /media

相关内容