First of all, thanks a lot for the clonezilla project and all developers, the product helped me a lot during last few years.
Today i faced a problem if i try to restore a FreeBSD 11.1-RELEASE-p4 installation.
FreeBSD was installed on a 60GB SSD Disk.
The installation should be restored to a 120GB SSD Disk
Those filesystems are present on the source disk:
/dev/sda1 ' Boot-Partition
/dev/sda2 ufs ' Root-Partition
/dev/sda3 ' Swap-Partition
The filesystems have those original source sizes:
Number Start (sector) End (sector) Size Code Name
1 40 1063 512.0 KiB A501
2 1064 111149095 53.0 GiB A503
3 111149096 117010471 2.8 GiB A502
I would like to take profit from intelligent image creation (so i use -q2 for the image creation)
I would like to take profit from the partition and filesystem resize of CloneZilla (so i use -r and -k1 parameter for the restore).
I'm able to successfully restore the source disk image to the new destination disk and i can see that the Root-Partition is not extended to the additional space. The only partitions that was extended are the partitions that was saved rawly with dd instead of partclone. That means the Boot-Partition and the Swap-Partition was extended only. Okay, no problem so far, if i would become able to use the resize feature, i would store the whole disk by using dd with -q1.
Btw: With the older clonezilla version 2.4.5-23 against FreeBSD 10.3 i was able to resize a UFS Root-Partition when it was created with -q2 (partclone instead of dd). Any ideas why this is not possible anymore?
After the restore completed i tried to boot the OS from the larger disk, i immediately get following error: "Boot partition too large". I've verfied, the boot-partition is 1MB in size. 1MB is too large for the Boot-Partition and so therefore the error "Boot partition too large" appears. As i can see within this post, the maximum size of a FreeBSD Boot-Partition is 512K.
So i tried to restore the image without using -r and -k1 parameter, and it's successfull. I can boot the installation but the partitions do not use the whole space available on the target disk. Whatever i try, i'm not able to take profit from the resize feature.
The only options i found:
Waste space on the larger disk, by using a partition layout that does not use the full space available (not to use -r and -k1).
Resizing the boot partition by using gparted after the image was restored.
Creating partition layout manually before restoring the image, and then use the partition restore option instead disk restore option (additionally using -k).
None of those options fit my need.
I tried to find out if i can control clonezilla only to resize the Root-Paritition and the Swap-Partition but not the Boot-Partition. I was not successfull to find any informations about this.
Btw: I did not face this problem with FreeBSD 10.3-RELEASE-p19, i expect with FreeBSD 10.3 there was no GPT and everything was in the MBR.
Btw: The CloneZilla Versions i tried around was: clonezilla-live-2.4.5-23-amd64 & clonezilla-live-2.5.2-31-amd64.
My questions are:
I, maybe others and FreeBSD would need a functionality to exclude partitions from resizing. Is there a possiblity to blacklist a partition from resizing and/or is such a functionalty sheduled if it's not possibly nowadays?
Does someone having an idea how a can make it work without using any third party software and/or additional commands that has to be used before and/or after the restore?
Best regards
Tom
Last edit: Tom 2017-12-03
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
"Btw: With the older clonezilla version 2.4.5-23 against FreeBSD 10.3 i was able to resize a UFS Root-Partition when it was created with -q2 (partclone instead of dd). Any ideas why this is not possible anymore?" -> Not sure. Personally I have very limited experience with FreeBSD, and why Clonezilla could resize UFS root-partition actually suprises me. :)
"I, maybe others and FreeBSD would need a functionality to exclude partitions from resizing. Is there a possiblity to blacklist a partition from resizing and/or is such a functionalty sheduled if it's not possibly nowadays?" -> Yes, I believe so. Give me enough information and we can try to implement that in the future release.
Steven
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Btw: With the older clonezilla version 2.4.5-23 against FreeBSD 10.3 i was able to resize a UFS Root-Partition when it was created with -q2 (partclone instead of dd). Any ideas why this is not possible anymore?"
More details about that: Correct is, FreeBSD changed since a specific version (can't recall what version anymore) from MBR to GPT. This is the reason why it has worked in the past. The MBR was not proportionally expanded, but the GPT partition is proportionally expanded and that causes the 'Boot loader too large' error while the BIOS tries to call the boot loader after the restore.
Additionally i found out, if i restore the image including resizing it proportionally (e2 -r -j2 -k1) , it will also resize the GPT partition. This causes that FreeBSD will not boot anymore. I can run this commands below as a post restore task (manually), then the OS will boot normally again including(!) the additional space proportionaly allocated (for the root- and swap parition)(!):
In fact, i let Clonezill expand the partions proportionally by using e2 -r -j2 -k1 when restoring the image to a larger disk than the source was, and at the end, i will reduce the GPT partition back to 512K. This seems to work, because there is no real data present after the 512K.
A possible workaround: I tried to find out, how i can include a post-restore script within the ZIP and/or ISO image created with Clonezilla. I found a lot of documentation about post-restore scripts with the live-medium, but not for the ISO/ZIP created with Clonezilla.
My questions are:
Is there a possibility to include a script within the unattended ZIP/ISO installer files created?
If that is possible then i can run the manuipulation from above with parted after the image was restored.
Additionally: It is probably an option, if Clonezilla can automatically restore the GPT to it's original size, or does skip the resize of a GPT partition if one is detected. Please let me know, what type of information you would need on that.
Best regards
Tom
Last edit: Tom 2018-06-01
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
" It is probably an option, if Clonezilla can automatically restore the GPT to it's original size, or does skip the resize of a GPT partition if one is detected." -> restore the GPT to its original size? By default it's done, right?
"skip the resize of a GPT partition if one is detected." -> Yes, we can modify /usr/sbin/ocs-expand-mbr-pt to make it. Now actually it skips MS Windows' "system reserved partition". Hence definitely we can do the same way for FreeBSD.
Steven
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi all
First of all, thanks a lot for the clonezilla project and all developers, the product helped me a lot during last few years.
Today i faced a problem if i try to restore a FreeBSD 11.1-RELEASE-p4 installation.
/dev/sda1 ' Boot-Partition
/dev/sda2 ufs ' Root-Partition
/dev/sda3 ' Swap-Partition
Number Start (sector) End (sector) Size Code Name
1 40 1063 512.0 KiB A501
2 1064 111149095 53.0 GiB A503
3 111149096 117010471 2.8 GiB A502
I'm able to successfully restore the source disk image to the new destination disk and i can see that the Root-Partition is not extended to the additional space. The only partitions that was extended are the partitions that was saved rawly with dd instead of partclone. That means the Boot-Partition and the Swap-Partition was extended only. Okay, no problem so far, if i would become able to use the resize feature, i would store the whole disk by using dd with -q1.
Btw: With the older clonezilla version 2.4.5-23 against FreeBSD 10.3 i was able to resize a UFS Root-Partition when it was created with -q2 (partclone instead of dd). Any ideas why this is not possible anymore?
After the restore completed i tried to boot the OS from the larger disk, i immediately get following error: "Boot partition too large". I've verfied, the boot-partition is 1MB in size. 1MB is too large for the Boot-Partition and so therefore the error "Boot partition too large" appears. As i can see within this post, the maximum size of a FreeBSD Boot-Partition is 512K.
So i tried to restore the image without using -r and -k1 parameter, and it's successfull. I can boot the installation but the partitions do not use the whole space available on the target disk. Whatever i try, i'm not able to take profit from the resize feature.
The only options i found:
None of those options fit my need.
I tried to find out if i can control clonezilla only to resize the Root-Paritition and the Swap-Partition but not the Boot-Partition. I was not successfull to find any informations about this.
Btw: I did not face this problem with FreeBSD 10.3-RELEASE-p19, i expect with FreeBSD 10.3 there was no GPT and everything was in the MBR.
Btw: The CloneZilla Versions i tried around was: clonezilla-live-2.4.5-23-amd64 & clonezilla-live-2.5.2-31-amd64.
My questions are:
Best regards
Tom
Last edit: Tom 2017-12-03
"Btw: With the older clonezilla version 2.4.5-23 against FreeBSD 10.3 i was able to resize a UFS Root-Partition when it was created with -q2 (partclone instead of dd). Any ideas why this is not possible anymore?" -> Not sure. Personally I have very limited experience with FreeBSD, and why Clonezilla could resize UFS root-partition actually suprises me. :)
"I, maybe others and FreeBSD would need a functionality to exclude partitions from resizing. Is there a possiblity to blacklist a partition from resizing and/or is such a functionalty sheduled if it's not possibly nowadays?" -> Yes, I believe so. Give me enough information and we can try to implement that in the future release.
Steven
Hi Steven
My statement was:
More details about that: Correct is, FreeBSD changed since a specific version (can't recall what version anymore) from MBR to GPT. This is the reason why it has worked in the past. The MBR was not proportionally expanded, but the GPT partition is proportionally expanded and that causes the 'Boot loader too large' error while the BIOS tries to call the boot loader after the restore.
Additionally i found out, if i restore the image including resizing it proportionally (e2 -r -j2 -k1) , it will also resize the GPT partition. This causes that FreeBSD will not boot anymore. I can run this commands below as a post restore task (manually), then the OS will boot normally again including(!) the additional space proportionaly allocated (for the root- and swap parition)(!):
In fact, i let Clonezill expand the partions proportionally by using e2 -r -j2 -k1 when restoring the image to a larger disk than the source was, and at the end, i will reduce the GPT partition back to 512K. This seems to work, because there is no real data present after the 512K.
A possible workaround: I tried to find out, how i can include a post-restore script within the ZIP and/or ISO image created with Clonezilla. I found a lot of documentation about post-restore scripts with the live-medium, but not for the ISO/ZIP created with Clonezilla.
My questions are:
If that is possible then i can run the manuipulation from above with parted after the image was restored.
Best regards
Tom
Last edit: Tom 2018-06-01
"- Is there a possibility to include a script within the unattended ZIP/ISO installer files created?" -> Yes, there are some boot parameters you can use. E.g., ocs_prerun:
https://clonezilla.org/fine-print-live-doc.php?path=./clonezilla-live/doc/99_Misc/00_live-boot-parameters.doc#00_live-boot-parameters.doc
" It is probably an option, if Clonezilla can automatically restore the GPT to it's original size, or does skip the resize of a GPT partition if one is detected." -> restore the GPT to its original size? By default it's done, right?
"skip the resize of a GPT partition if one is detected." -> Yes, we can modify /usr/sbin/ocs-expand-mbr-pt to make it. Now actually it skips MS Windows' "system reserved partition". Hence definitely we can do the same way for FreeBSD.
Steven