gpt4 book ai didi

linux - Ubuntu 14.04 预置 LVM 磁盘配置

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:35:28 25 4
gpt4 key购买 nike

我在将我的分区设为主要类型而非逻辑/扩展类型时遇到了一些问题。

这是我的预置中的相关代码:

d-i partman-auto/disk string /dev/sda
d-i partman-auto/method string lvm

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/choose_recipe select boot-root
d-i partman-auto-lvm/new_vg_name string vg00
d-i partman-auto/expert_recipe string \
boot-root :: \
512 512 512 ext3 \
$primary{ } $bootable{ } \
method{ format } format{ } \
use_filesystem{ } filesystem{ ext3 } \
mountpoint{ /boot } \
. \
2048 2048 2048 swap \
$primary{ } $lvmok{ } lv_name{ lv_swap } $defaultignore{} \
method{ swap } format{ } \
. \
1024 10000 -1 ext4 \
$primary{ } $lvmok{ } lv_name{ lv_root } $defaultignore{}\
method{ format } format{ } \
use_filesystem{ } filesystem{ ext4 } \
mountpoint{ / } \
.

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-lvm/confirm_nooverwrite boolean true

问题是,这会创建以下分区方案:

root@ubuntu-server-1404-devit:~# fdisk /dev/sda

Command (m for help): p

Disk /dev/sda: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders, total 20971520 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0009ac4d

Device Boot Start End Blocks Id System
/dev/sda1 * 2048 2000895 999424 83 Linux
/dev/sda2 2002942 20969471 9483265 5 Extended
/dev/sda5 2002944 20969471 9483264 8e Linux LVM

我想删除这个不必要的扩展/逻辑分区,让 Linux LVM 分区位于 sda2(主分区)上。像这样:

Device Boot      Start         End      Blocks   Id  System
/dev/sda1 * 2048 2000895 999424 83 Linux
/dev/sda2 2002942 20969471 9483265 8e Linux LVM

最佳答案

好吧,这方面的文档非常少,但我已经弄清楚了(出于某种原因需要定义卷组名称和方法类型 lvm):

d-i partman-auto/disk string /dev/sda
d-i partman-auto/method string lvm

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/choose_recipe select boot-root
d-i partman-auto-lvm/new_vg_name string vg00
d-i partman-auto/expert_recipe string \
boot-root :: \
1024 1024 1024 ext4 \
$primary{ } $bootable{ } \
method{ format } format{ } \
use_filesystem{ } filesystem{ ext4 } \
mountpoint{ /boot } \
. \
100 1000 1000000000 ext4 \
$defaultignore{ } \
$primary{ } \
method{ lvm } \
device{ /dev/sda } \
vg_name{ vg00 } \
. \
2048 2048 2048 swap \
$lvmok{ } lv_name{ lv_swap } in_vg{ vg00 } \
method{ swap } format{ } \
. \
1024 3072 -1 ext4 \
$lvmok{} lv_name{ lv_root } in_vg{ vg00 } \
method{ format } format{ } \
use_filesystem{ } filesystem{ ext4 } \
mountpoint{ / } \
.
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-lvm/confirm_nooverwrite boolean true

关于linux - Ubuntu 14.04 预置 LVM 磁盘配置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33923952/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com