Additional Disk partition and Mount by cloud-init

nbanik

New Member
Apr 22, 2024
24
2
3
Hello Experts,
I was trying to additional disk setup in vm using cloud-init config:
I've 2nd disk vdb and want to make two (vdb1 & vdb2) parition each will be having 50% of space and should mount
vdb1 to /data1 and
vdb2 to /data2.

Here is my config:


YAML:
resize_rootfs: false
disk_setup:
    /dev/vdb:
        table_type: 'mbr'
        layout:
        - 50
        - 50
        overwrite: true

fs_setup:
    - label: DATA1
      filesystem: 'xfs'
      device: '/dev/vdb'
      partition: vdb1
      overwrite: true
    - label: DATA2
      filesystem: 'xfs'
      device: '/dev/vdb'
      partition: vdb2
      overwrite: true

runcmd:
  - [ partx, --update, /dev/vdb ]
  - [ mkfs.xfs, /dev/vdb1 ]
  - [ mkfs.xfs, /dev/vdb2 ]
  - [ partprobe ]

mounts:
    - [vdb1, /data1, auto, "defaults,discard", "0", "0"]
    - [vdb2, /data2, auto, "defaults,discard", "0", "0"]

But OS booting is stuck.
1716210147521.png

Whats wrong in my config?
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!