Hello Experts,
I'm using cloud-init config to partition the disk like below:
But it is not reflecting on my OS.
OS version Debian GNU/Linux 12.
In OS I see different partition:
/etc/fstab entry:
I want to partition my disk to root fs (/) to 25%, /home to 50% and /var to 25%.
How can I achieve this by cloud-init?
Regards.
I'm using cloud-init config to partition the disk like below:
YAML:
resize_rootfs: false
disk_setup:
/dev/vda:
table_type: 'mbr'
layout:
- 25
- 50
- 25
overwrite: true
fs_setup:
- label: root_fs
filesystem: 'ext4'
device: /dev/vda
partition: vda1
overwrite: true
- label: home_disk
filesystem: 'xfs'
device: /dev/vda
partition: vda2
overwrite: true
- label: var_disk
filesystem: 'xfs'
device: /dev/vda
partition: vda3
overwrite: true
runcmd:
- [ partx, --update, /dev/vda ]
- [ mkfs.xfs, /dev/vda2 ]
- [ mkfs.xfs, /dev/vda3 ]
- [ partprobe ]
- parted /dev/vda set 1 boot on p
mounts:
- ["/dev/vda1", "/"]
- ["/dev/vda2", "/home"]
- ["/dev/vda3", "/var"]
But it is not reflecting on my OS.
OS version Debian GNU/Linux 12.
In OS I see different partition:
Code:
root@testdebian:~# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sr0 11:0 1 4M 0 rom
vda 254:0 0 10G 0 disk
├─vda1 254:1 0 9.9G 0 part /
├─vda14 254:14 0 3M 0 part
└─vda15 254:15 0 124M 0 part /boot/efi
vdb 254:16 0 2G 0 disk
root@testdebian:~# df -h
Filesystem Size Used Avail Use% Mounted on
udev 965M 0 965M 0% /dev
tmpfs 197M 3.0M 194M 2% /run
/dev/vda1 9.7G 1.2G 8.1G 13% /
tmpfs 984M 0 984M 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
/dev/vda15 124M 12M 113M 10% /boot/efi
/etc/fstab entry:
Code:
root@testdebian:~# cat /etc/fstab
PARTUUID=5da14e57-2f23-4358-b0a5-02975f3ef3c6 / ext4 rw,discard,errors=remount-ro,x-systemd.growfs 0 1
PARTUUID=4966f7ee-71c6-422f-b710-7eb411ef6087 /boot/efi vfat defaults 0 0
/dev/vda1 / auto defaults,nofail,x-systemd.requires=cloud-init.service,_netdev,comment=cloudconfig 0 2
/dev/vda2 /home auto defaults,nofail,x-systemd.requires=cloud-init.service,_netdev,comment=cloudconfig 0 2
/dev/vda3 /var auto defaults,nofail,x-systemd.requires=cloud-init.service,_netdev,comment=cloudconfig 0 2
I want to partition my disk to root fs (/) to 25%, /home to 50% and /var to 25%.
How can I achieve this by cloud-init?
Regards.
Last edited: