大网数据广告活动
服务器运维问答

How to make custom partitioning of hdd via preseed?

· 52CE 我爱测

According to official debian manual ( https://www.debian.org/releases/stable/amd64/apbs04.html.en ), i saw: #d-i partman-auto/expert_recipe string \ # boot-root :: \ # 40 50 100 ext3 \ # $primary{ } $bootable{ } \ # method{ forma…

问题原文

原帖链接 · Piduna · CC BY-SA 3.0

According to official debian manual (https://www.debian.org/releases/stable/amd64/apbs04.html.en), i saw:

#d-i partman-auto/expert_recipe string                         \
#      boot-root ::                                            \
#              40 50 100 ext3                                  \
#                      $primary{ } $bootable{ }                \
#                      method{ format } format{ }              \
#                      use_filesystem{ } filesystem{ ext3 }    \
#                      mountpoint{ /boot }                     \
#              .                                               \
#              500 10000 1000000000 ext3                       \
#                      method{ format } format{ }              \
#                      use_filesystem{ } filesystem{ ext3 }    \
#                      mountpoint{ / }                         \
#              .                                               \
#              64 512 300% linux-swap                          \
#                      method{ swap } format{ }                \
#              .

But this variant for using all disk. But if i want to use 30 Gb for root / and 2 Gb for swap. Other space i don't want to use (unlocated space). How to do it ? Sorry, i tried to find, but i have not found ? Maybe you can help me ?

已采纳解答

原帖链接 · telcoM · CC BY-SA 4.0

Do you want /boot as a separate filesystem? The example in your question will create it with a minimum of 40 MB, maximum of 100 MB. If you want it to be 500 MB always, then set the three numbers for /boot like 500 500 500.

For root, if you want it to always be 30 GB (= 30000 MB), specify the three numbers as 30000 30000 30000. If you don't want to use a separate /boot filesystem, move the $primary{ } $bootable{ } line to this partition and then delete the /boot partition specification.

For always 2 GB of swap, set the swap values to 2048 2048 2048.

Note: Debian's installer user powers of 10, not powers of 2. For swap, you might want to increase the values some more to match the RAM sizes, which are always based on powers of 2.

Ref: partman-auto-recipe.txt, Debian bug report #235335

When you're specifying fixed sizes (minimum = maximum) then the priority value will be unimportant. But the documentation says the priority value should normally be between the min and max size values, so all three values should then be the same, and equal to the required size in MB.

So here's a recipe for just two partitions, 30 GB for root and 2 GB for swap, using the ext4 filesystem for root, uncommented and ready for use:

 d-i partman-auto/expert_recipe string                    \
      boot-root ::                                        \
          30000 30000 30000 ext4                          \
                  $primary{ } $bootable{ }                \
                  method{ format } format{ }              \
                  use_filesystem{ } filesystem{ ext4 }    \
                  mountpoint{ / }                         \
          .                                               \
          2048 2048 2048 linux-swap                       \
                  method{ swap } format{ }                \
          .
d-i partman-auto/choose_recipe select boot-root

A more complex example can be seen at this answer.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2018-01-21)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0 / CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。