Resize only root partition
-
Hi,
Been having great success using Fog to deploy Windows images by using sysprep beforehand. Resizing the disk seems to work without much issue.
However when I capture a linux image (Centos or Ubuntu), I’m finding that the /boot and swap partitions are also being resized (expanded). We deploy this image to many different hardware configurations so we need to find a way to standardize /boot and swap to 500 MB and 4096 MB respectively, regardless of the size of the disk. Can this be done? Any suggestions?
-
@docorange6 Easy way on deploy is to edit
d1.fixed_size_partitions
file in the/images/<IMAGENAME>
directory on your FOG server. Put in the partitions that you want to have fixed in size (and sector start position) separated by colon, e.g.1:2
Don’t think we ought to expand SWAP partitions but maybe there is an issue in the scripts. Can you please post the contents of
d1.partitions
,d1.minimum.partitions
andd1.fixed_size_partitions
of your Linux images. -
I’m gonna capture a fresh image now and see what I get. I think I was last trying fixed partitions (been a while since I’ve messed with it.) Currently only have d1.partitions in the directory, is as follows:
root@FogProject:/images/CentOS6# cat d1.partitions
label: dos
label-id: 0x0002bc90
device: /dev/sda
unit: sectors/dev/sda1 : start= 2048, size= 819200, type=83, bootable
/dev/sda2 : start= 821248, size= 8388608, type=82
/dev/sda3 : start= 9209856, size= 24344576, type=83Will capture fresh image and update with results.
-
Captured a fresh image set to resizable:
root@FogProject:/images/CentOS6# cat d1.fixed_size_partitions
:2
root@FogProject:/images/CentOS6# cat d1.minimum.partitions
label: dos
label-id: 0x00026917
device: /dev/sda
unit: sectors/dev/sda1 : start= 2048, size= 241815, type=83, bootable
/dev/sda2 : start= 1026048, size= 8388608, type=82
/dev/sda3 : start= 9414656, size= 3383175, type=83
root@FogProject:/images/CentOS6# cat d1.fixed_size_partitions
:2
root@FogProject:/images/CentOS6# cat d1.partitions
label: dos
label-id: 0x00026917
device: /dev/sda
unit: sectors/dev/sda1 : start= 2048, size= 1024000, type=83, bootable
/dev/sda2 : start= 1026048, size= 8388608, type=82
/dev/sda3 : start= 9414656, size= 74471424, type=83
root@FogProject:/images/CentOS6# -
@docorange6 Sorry for the late answer.
Looking at the information you posted we see that it handles sda2 (SWAP as we see from type=82) as fixed partition. And because of that I am fairly sure it will resize the boot partition (sda1) back to it’s original size as well.
I can understand that you would prefer it to not touch sda1 at all and I think we have fixed this in the latest scripts already. Please download the latest init files (32 bit and 64 bit) and put those into
/var/www/html/fog/service/ipxe/
(best to rename the original ones instead of directly overwriting those.