海运的博客

ubuntu自动安装preseed分区方法

发布时间:October 6, 2018 // 分类: // No Comments

使用自动分区,标准分区方式:

#d-i partman-auto/disk string /dev/sda
#选择第一个硬盘
d-i partman/early_command string debconf-set partman-auto/disk "$(list-devices disk | head -n1)"
d-i partman-auto/choose_recipe select atomic
d-i partman-auto/method string regular
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-md/device_remove_md 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/default_filesystem string ext4
d-i partman/mount_style select uuid

2018-10-06_091417.png

自动LVM分区:

d-i partman-auto/disk string /dev/sda
d-i partman-auto/choose_recipe select atomic
d-i partman-auto/method string lvm
d-i partman-auto-lvm/guided_size string 100%
d-i partman-lvm/confirm boolean true
d-i partman-lvm/confirm_nooverwrite boolean true
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-md/device_remove_md 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/default_filesystem string ext4
d-i partman/mount_style select uuid

2018-10-06_091702.png

使用自定义标准分区方案,第一个数字为最小分区大小(MB),第二个获取最大分区的优先级(越小优先级越高),第三个最大分区大小。

d-i partman-auto/disk string /dev/sda
d-i partman-auto/choose_recipe select boot-root
d-i partman-auto/method string regular
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-md/device_remove_md boolean true

d-i partman-auto/expert_recipe string                         \
      boot-root ::                                            \
              5120 1 5120 ext4                                \
                     $primary{ } $bootable{ }                 \
                     method{ format } format{ }               \
                     use_filesystem{ } filesystem{ ext4 }     \
                     mountpoint{ /}                           \
              .                                               \
              1 3 -1 ext4                                     \
                      $primary{ }                             \
                      method{ format } format{ }              \
                      use_filesystem{ } filesystem{ ext4 }    \
                      mountpoint{ /home}                      \
              .                                               \
              1024 2 1024 linux-swap                          \
                      $primary{ }                             \
                      method{ swap } format{ }                \
              .

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/default_filesystem string ext4
d-i partman/mount_style select uuid

2018-10-06_084106.png

使用自定义分区LVM:

d-i partman-auto/disk string /dev/sda
d-i partman-auto/choose_recipe select boot-lvm
d-i partman-auto/method string lvm
d-i partman-auto-lvm/guided_size string 100%
d-i partman-auto-lvm/new_vg_name string vg00
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-md/device_remove_md boolean true

d-i partman-auto/expert_recipe string                         \
      boot-lvm ::                                             \
              1024 1 1024 ext4                                \
                      $primary{ } $bootable{ }                \
                      method{ format } format{ }              \
                      use_filesystem{ } filesystem{ ext4 }    \
                      mountpoint{ /boot }                     \
              .                                               \
              1 2 -1 ext4                                     \
                      $primary{ }                             \
                      $defaultignore{ }                       \
                      method{ lvm }                           \
                      device{ /dev/sda }                      \
                      vg_name{ vg00 }                         \
              .                                               \
              1024 3 1024 swap                                \
                      $lvmok{ } lv_name{ lv_swap } in_vg{ vg00 } \
                      method{ swap } format{ }                   \
          .                                                      \
              1 4 -1 ext4                                        \
                      $lvmok{} lv_name{ lv_root } in_vg{ vg00 }  \
                      method{ format } format{ }                 \
                      use_filesystem{ } filesystem{ ext4 }       \
                      mountpoint{ / }                            \
          .                                                      

d-i partman-lvm/confirm boolean true
d-i partman-lvm/confirm_nooverwrite 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/default_filesystem string ext4
d-i partman/mount_style select uuid

2018-10-06_090807.png
通过preseed自动安装ubuntu系统详细配置文件见:https://www.haiyun.me/archives/1246.html
参考:
https://stackoverflow.com/questions/33923952/ubuntu-14-04-preseed-lvm-disk-config
https://cptyesterday.wordpress.com/2012/06/17/notes-on-using-expert_recipe-in-debianubuntu-preseed-files/

标签:none

评论已关闭

分类
最新文章
最近回复
  • opnfense: 谢谢博主!!!解决问题了!!!我之前一直以为内置的odhcp6就是唯一管理ipv6的方式
  • liyk: 这个方法获取的IPv6大概20分钟之后就会失效,默认路由先消失,然后Global IPV6再消失
  • 海运: 不好意思,没有。
  • zongboa: 您好,請問一下有immortalwrt設定guest Wi-Fi的GUI教學嗎?感謝您。
  • 海运: 恩山有很多。
  • swsend: 大佬可以分享一下固件吗,谢谢。
  • Jimmy: 方法一 nghtp3步骤需要改成如下才能编译成功: git clone https://git...
  • 海运: 地址格式和udpxy一样,udpxy和msd_lite能用这个就能用。
  • 1: 怎么用 编译后的程序在家里路由器内任意一台设备上运行就可以吗?比如笔记本电脑 m参数是笔记本的...
  • 孤狼: ups_status_set: seems that UPS [BK650M2-CH] is ...