首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >服务器自动安装:如何自定义存储部分?

服务器自动安装:如何自定义存储部分?
EN

Ask Ubuntu用户
提问于 2020-05-05 07:16:54
回答 1查看 9.7K关注 0票数 7

当我使用https://wiki.ubuntu.com/FoundationsTeam/AutomatedServerInstalls#Running_一个_真正的_自动_自动安装存储时,请遵循这里的指示:

代码语言:javascript
复制
storage:
  layout:
    name: lvm

它用4GB创建根分区,而不创建交换。当我使用直接布局时

代码语言:javascript
复制
storage:
  layout:
    name: direct

它创建具有磁盘上可用空间的根分区,并创建交换空间。是否有任何方法可以查看如何直接配置布局并修改配置以调整我的需求?我的意思是在这里记录了基于动作的配置类:https://wiki.ubuntu.com/FoundationsTeam/AutomatedServerInstalls/ConfigReference#storage

我的意思是如下所示:

代码语言:javascript
复制
storage:
  grub:
    install_devices:
      - esp-partition   
  swap:
    filename: swap.img
    size: 4GB
  config:
    - type: disk
      id: disk0
      ptable: gpt
      wipe: superblock
      grub_device: true
      match:
        size: largest

    - id: esp-partition # create partitions on disk (like sda1)
      type: partition
      device: disk0
      size: 512MB
      flag: boot # EFI system partition needs boot flag
    - type: partition
      id: boot-partition
      device: disk0
      size: 1GB
    - type: partition
      device: disk0
      id: root-partition
      size: -1

    - id: esp-partition-fs # format partitions on disk
      type: format
      volume: esp-partition
      fstype: fat32
      label: ESP
    - id: boot-partition-fs
      type: format
      fstype: ext4
      volume: boot-partition
    - id: root-partition-fs
      type: format
      fstype: ext4
      volume: root-partition

    - id: esp-partition-fs-mount # mount partitions
      type: mount
      device: esp-partition-fs
      path: /boot/efi
    - id: root-partition-fs-mount
      type: mount
      path: /
      device: root-partition-fs
    - id: boot-partition-fs-mount
      type: mount
      path: /boot
      device: boot-partition-fs

上面的配置成功通过了FileSystem步骤,但是在云init配置的initramfs步骤上失败了.就像在截图上

我想知道直接布局的存储配置,这样我就可以在上面调整我的配置,或者如果有人知道如何修复上面的配置,那么step initramfs通过吗?

EN

回答 1

Ask Ubuntu用户

回答已采纳

发布于 2020-06-30 07:52:23

我第一次通过手动安装。然后,您会发现/var/log/installer有yaml文件,可以用作所需的实际autoinstall.yaml的模板。这就是我后来构建的用aoutinstall替换Debian安装程序的方式。

代码语言:javascript
复制
  storage:
    config:
    - grub_device: true
      id: disk-sda
      path: /dev/sda
      ptable: gpt
      type: disk
      wipe: superblock-recursive
    - device: disk-sda
      flag: bios_grub
      id: partition-0
      number: 1
      size: 1048576
      type: partition
    - device: disk-sda
      id: partition-1
      number: 2
      size: -1
      type: partition
      wipe: superblock
    - fstype: ext4
      id: format-0
      type: format
      volume: partition-1
    - device: format-0
      id: mount-0
      path: /
      type: mount
票数 13
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/1235529

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档