lvm changes

This commit is contained in:
2026-04-30 10:04:00 -05:00
parent 27b5bf9aa5
commit 91f41fbfba
2 changed files with 20 additions and 12 deletions
+18 -10
View File
@@ -16,16 +16,16 @@ IMG_FILE="PBX-root.img.lz4"
MOUNT_PATH="/mnt/debian" MOUNT_PATH="/mnt/debian"
MOUNT_POINTS=("/dev" "/dev/pts" "/proc" "/sys" "/sys/firmware/efi/efivars" "/run") MOUNT_POINTS=("/dev" "/dev/pts" "/proc" "/sys" "/sys/firmware/efi/efivars" "/run")
BOOT_PART="null" BOOT_PART="NULL"
EFI_PART="null" EFI_PART="NULL"
ROOT_PART="null" ROOT_PART="NULL"
VGROUP="PBX-vg" VGROUP="SangomaPBX-vg"
ROOT_LV="root" ROOT_LV="root"
SWAP_LV="swap_1" SWAP_LV="swap_1"
VG_PATH="/dev/mapper/PBX--vg-" VG_PATH="/dev/mapper/SangomaPBX--vg-"
GRUB_CMD="export PATH=/usr/sbin:$PATH && update-initramfs -u -k all && grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=debian && update-grub" GRUB_CMD="export PATH=/usr/sbin:$PATH && update-initramfs -c -k all && grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=debian && update-grub"
for arg in "$@"; do for arg in "$@"; do
case $arg in case $arg in
@@ -62,16 +62,15 @@ main() {
dialogue dialogue
trap 'echo "Status Code: $?"; cleanup;' EXIT assign_part_var
EFI_PART=$(get_partition $disk_name "1") trap 'echo "Status Code: $?"; cleanup;' EXIT
BOOT_PART=$(get_partition $disk_name "2")
ROOT_PART=$(get_partition $disk_name "3")
if [[ $NO_RETABLE == true ]]; then if [[ $NO_RETABLE == true ]]; then
echo -e "${YELLOW}Option --noretable is specified. Tables will not be erased and no partitions will be created${RESET}" echo -e "${YELLOW}Option --noretable is specified. Tables will not be erased and no partitions will be created${RESET}"
else else
rewrite_gpt_table rewrite_gpt_table
assign_part_var
lvm_init lvm_init
make_filesystem make_filesystem
fi fi
@@ -117,9 +116,18 @@ rewrite_gpt_table() {
sgdisk -n 3:0:0 -t 3:8e00 -c 3:"Linux LVM" $disk_name sgdisk -n 3:0:0 -t 3:8e00 -c 3:"Linux LVM" $disk_name
partprobe || true partprobe || true
lsblk $disk_name
echo -e "${GREEN}GPT table created. ${RESET}" echo -e "${GREEN}GPT table created. ${RESET}"
} }
assign_part_var() {
EFI_PART=$(get_partition $disk_name "1")
BOOT_PART=$(get_partition $disk_name "2")
ROOT_PART=$(get_partition $disk_name "3")
}
lvm_init() { lvm_init() {
pvcreate $ROOT_PART -ff pvcreate $ROOT_PART -ff
+2 -2
View File
@@ -8,7 +8,7 @@
# Please run 'systemctl daemon-reload' after making changes here. # Please run 'systemctl daemon-reload' after making changes here.
# <file system> <mount point> <type> <options> <dump> <pass> # <file system> <mount point> <type> <options> <dump> <pass>
/dev/mapper/PBX--vg-root / ext4 errors=remount-ro 0 1 /dev/mapper/SangomaPBX--vg-root / ext4 errors=remount-ro 0 1
# /boot was on /dev/vda2 during installation # /boot was on /dev/vda2 during installation
UUID=BOOT_UUID /boot ext2 defaults 0 2 UUID=BOOT_UUID /boot ext2 defaults 0 2
@@ -16,4 +16,4 @@ UUID=BOOT_UUID /boot ext2 defaults 0 2
# /boot/efi was on /dev/vda1 during installation # /boot/efi was on /dev/vda1 during installation
UUID=EFI_UUID /boot/efi vfat umask=0077 0 1 UUID=EFI_UUID /boot/efi vfat umask=0077 0 1
/dev/mapper/PBX--vg-swap_1 none swap sw 0 0 /dev/mapper/SangomaPBX--vg-swap_1 none swap sw 0 0