-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot build image with custom partition. #2572
Comments
Hi, yeah two issues here:
# create altroot mount point for reason XYZ
mkdir -p /altroot This will at least fix the mountpoint issue |
@schaefi : Thanks I will check and redo this.
|
ok, not sure if I got it all right. From the above you can specify a type like this <type image="oem" filesystem="ext4" firmware="efi" ... >
<systemdisk name="vgsystem">
<volume name="@root=rootfs" size="10G"/>
<volume name="var" size="5G"/>
</systemdisk>
<partitions>
<partition name="images" size="48G" mountpoint="/images" filesystem="ext4"/>
</partitions>
</type>
I think this is not completely matching what you want, as it seems you want /var and /images to live on another partition and in another volume group. To do this you need a bit more because kiwi doesn't support multiple volume groups in the declarative description. So to get there you can do the following <type image="oem" filesystem="ext4" firmware="efi" editbootconfig="custom_vg_create.sh" editbootinstall="custom_vg_setup.sh" ... >
<systemdisk>
<volume name="@root=rootfs" size="10G"/>
</systemdisk>
<partitions>
<partition name="extensions" size="60G">
</partitions>
</type> This produces the rootfs in one LVM as you want it and creates an empty partition (60G) for the other layout. The other layout needs to be created by your own code though via the
As you can see this is a bit more effort and personally I think it's not a good idea to move a system partition (/var) outside of the main OS volumegroup and/or partition. If you are using LVM you can add physical extends to the volume group as you like, also from different partitions or new block devices. I assume you have good reasons for this layout and I hope this information helps to move you forward |
I've had to implement something similar, in order to get "CIS Hardened Images" out of the box using KiwiNG. Here is my xml config: <preferences>
<type image="oem" filesystem="ext4" kernelcmdline="console=ttyS0 console=tty1" firmware="uefi" format="vmdk" bootpartition="true" bootpartsize="3000">
<bootloader name="grub2" console="console" timeout="5"/>
<systemdisk name="vgr">
<volume name="var_vol" size="120G" mountpoint="var"/>
<volume name="var_tmp_vol" size="4G" mountpoint="/var/tmp/"/>
<volume name="var_log_vol" size="6G" mountpoint="/var/log/"/>
<volume name="var_log_audit_vol" size="4G" mountpoint="/var/log/audit"/>
<volume name="home_vol" size="120G" mountpoint="home"/>
<volume name="tmp_vol" size="4G" mountpoint="tmp"/>
<volume name="@root=root_vol" freespace="40G"/>
</systemdisk>
<oemconfig>
<oem-resize>false</oem-resize>
<!-- <oem-swap>true</oem-swap> -->
<!-- <oem-swapsize>2048</oem-swapsize> -->
<!-- <oem-swapname>swap_vol</oem-swapname> -->
</oemconfig>
</type>
</preferences> So I've given I also use |
Thanks much for you help. I am sorry I could not check this quick, since I was occupied with something else. I did check this as suggested by : @schaefi by creating custom_vg_create.sh and custom_vg_setup.sh . But I get the error as below , not sure what is the issue : Log snippet here:
custom_vg_create.sh and custom_vg_setup.sh are exactly same as you suggested earlier. |
Hi,
We are trying to build ubuntu image and have specific requirements for creating custom disk partitions.
Problem description
While trying to build the image (oem) with custom partition , I get the error KiwiFileSystemSyncError ( see the snippet below)
config.xml snippet:
Error snippet:
2024-06-13T18:19:55.4343398Z [ INFO ]: 18:19:55 | Syncing system to image
2024-06-13T18:19:55.4344151Z [ INFO ]: 18:19:55 | --> Syncing custom partition(s) data
2024-06-13T18:19:55.4346280Z [ ERROR ]: 18:19:55 | KiwiFileSystemSyncError: given root directory /tmp/output/build/image-root/altroot/ does not exist
Expected behaviour
We should be able to build image with custom partitions.
Steps to reproduce the behavior
Build image with custom partition.
OS and Software information
The text was updated successfully, but these errors were encountered: