Failure to expand shrunken resizeable image from Linux machines
-
Great you all have been heavily working on this. Looks like we are getting there although the initially posted disk layout (sda1=root, sda2=extended, sda5=swap) has changed. From the latest pictures posted it looks as if the expansion is still not working for this kind of layout (SWAP being on sda1).
I was just able to replicate this issue. But I didn’t have the time to find what’s causing the issue in our script:
$ cat in1.txt label: dos label-id: 0x77265efa device: /dev/sda unit: sectors /dev/sda1 : start= 2048, size= 3940352, type=82, bootable /dev/sda2 : start= 3942400, size= 69457920, type=5 /dev/sda5 : start= 3944448, size= 3940352, type=83 /dev/sda6 : start= 7886848, size= 65513472, type=83 $ ./procsfdisk.awk -v SECTOR_SIZE=512 -v CHUNK_SIZE=512 -v MIN_START=2048 -v action=filldisk -v target=/dev/sda -v sizePos=146800640 -v diskSize=146800640 -v fixedList=1:5 in1.txt ERROR: New start and size (150960130) on (/dev/sda1) is larger than the disk (146800640). # ERROR in new partition table, quitting. # ERROR: /dev/sda5 has an overlap. label: dos label-id: 0x77265efa device: /dev/sda unit: sectors /dev/sda1 : start= 2048, size= 3940352, type=82, bootable /dev/sda2 : start= 3944448, size= 142856192, type=5 /dev/sda5 : start= 142856194, size= 8103936, type=83 /dev/sda6 : start= 142856194, size= 134747648, type=83
From my point of view the output of
sfdisk -d /dev/sda
is much more helpful thandf -h
. -
@sebastian-roth said in Failure to expand shrunken resizeable image from Linux machines:
./procsfdisk.awk -v SECTOR_SIZE=512 -v CHUNK_SIZE=512 -v MIN_START=2048 -v action=filldisk -v target=/dev/sda -v sizePos=146800640 -v diskSize=146800640 -v fixedList=1:5 in1.txt
Based on the most current this is what I see:
./procsfdisk.awk -v SECTOR_SIZE=512 -v CHUNK_SIZE=512 -v MIN_START=2048 -v action=filldisk -v target=/dev/sda -v sizePos=146800640 -v diskSize=146800640 -v fixedList=1:5 in1.txt # Partition table is consistent. label: dos label-id: 0x77265efa device: /dev/sda unit: sectors /dev/sda1 : start= 2048, size= 3940352, type=82, bootable /dev/sda2 : start= 3944446, size= 71485442, type=5 /dev/sda5 : start= 3944448, size= 3940352, type=83 /dev/sda6 : start= 7884800, size= 67425792, type=83
-
@Tom-Elliott Sorry, didn’t see that you pushed a new version. Confirmed that my error posted does not apply anymore! Looks good to me now.
Still I think about creating a testcases suite for the procsfdisk.awk script. So we could always check a lot of different layouts against the most current script to see if everything still works.
-
@sebastian-roth I agree, but data is hard to come by, and I don’t think we can come up with every case potential.
-
@xipher said in Failure to expand shrunken resizeable image from Linux machines:
@george1421 Close to my findings wherein the first partition (sda1) will grow proportionally, but the rest… no go.
If you create the same layout but have the root partition where you currently have the boot partition, it will grow the root and ‘work’ as it seems it would be intended.
If you were to make a home partition in the same place, it would grow but not the boot or root… etc
IMO In the case of Mint with the lvm. I would consider the /boot and [swap] partitions to be fixed in size. This would equate the
System
partition of Windows. In my ignorance I would have expected the disk layout to match the source image and have 15GB ofair
left in the target disk. Since LVM partition is copied as raw and both the /boot and [swap] were fixed.My goal here was to see if I could come up with a way to extend the lvm disk.
-
@george1421 There’s already functions in place for the hopeful integration of LVM extending through fog (as well as imaging) though I’ve not made any major effort in actually getting this working. You’re more than welcome to have a go at it. The same resizing functions should work similarly. Would you be willing to re-update your init’s to the absolute latest using the same wget commands and seeing if things are a bit better for you?
-
@tom-elliott said in Failure to expand shrunken resizeable image from Linux machines:
I’ve tried for all I’m worth, but I’m only one man, sorry.
Tom, to be honest, as I posted before about 90% of the deployments are MS Windows, with about 8% Mac and the rest other bits (my feels like numbers). With MS doing its Win10 crap hopefully more will start to migrate to Linux based desktops. When issues arise you jump on them with both feet. The key is knowing about the issues to fix.
-
Just thinking about this. If it was me and I planned on deploying Linux client OS to target machines, I would not choose to use LVM (with expanding partitions or not). The issues is that FOG / partclone can only capture / deploy the image as raw. This is a slowest way of deploying the image. I would use native partitions on the disk.
Right now deploying that captured LM partition will take about 28 minutes to finish. The native partitions are much faster.
-
@george1421 For my needs, I’m totally dropping LVM and agree, LVM really doesn’t seem to have a place in images at the moment.
-
Thanks to @Tom-Elliott again for coming up with a fix so quickly! I am marking this solved then. But I still think having a testcase suite would be really good as we could make changes to the awk code, run the testcases and just be sure to not have it broken for other known cases. I think we could collect data from the community fairly easy as the information is already there (in
d1.partitions
that people have lying around on their FOG servers by the dozens)…