Chrome Os Flex Download And Install Using Iso Image

1 view
Skip to first unread message

Вячеслав Бахтыгозин

unread,
Jun 30, 2024, 11:18:19 AM6/30/24
to giasaconse

As noted by our friends at Neowin, until recently Google only made it possible to create a bootable Chrome OS Flex USB using the Chromebook Recovery Utility, an app that only officially supports Windows, macOS, and ChromeOS.

Google now provide a direct download of the ChromeOS Flex installer image. This image can be written/flashed/burned to a USB flash drive on Linux using a GUI app like Balena Etcher or, for those more comfortable at the command line, the trusty dd tool.

Once done, use the USB to boot Chrome OS Flex on any PC or laptop with at least 4GB of RAM and a not-too-ancient CPU. The steps to boot from a USB vary by device, manufacturer, model, etc. See the Google Support page for pointers.

I work on Chrome OS Flex ,
a version of Google's Chrome OS that is designed to be installable on any
x86 device. We've had a number of requests from customers and partners to
produce a Clonezilla disk image of Flex, for easy mass deployment of the OS
to large groups of machines. I've been trying to successfully create and
restore an image using Clonezilla Live 2.8.1-12, but am having issues due
to the unusually complex partition layout of Chrome OS
+/HEAD/disk_format.md,
which Clonezilla seems to be having trouble interpreting.

I am able to successfully capture a disk image by using the -scpt "skip
checking the partition table" flag, but no combination of expert-mode flags
that I can find results in a successful restore of the image back to disk,
even on the same machine with the same internal storage that the image was
captured from. Every combination results in a variation of an "unknown
partition table format" error. I have verified that the storage device is
not corrupted, and the OS itself on the source storage works fine.

Has anyone had experience with getting Clonezilla to operate more akin to
dd - aka, not attempt to read and understand a disk at the partition level,
and just create a "dumb" bit-perfect image of the data on the disk? Are
there any other tools that could create a "dumb" image that Clonezilla can
make use of?

Command: ocs-sr -q1 -c -j2 -scpt -z1p -i 0 -sfsck -scs -senc
Error: same as with beginner mode, but continuing past the partition table errors will allow an image file to be captured successfully.

Next steps: Could definitely use some guidance on what combination of expert mode commands might allow a successful restore here. It seems like Clonezilla keeps getting tripped up by the unusual partition scheme of Chrome OS, which includes a number of zero-size partitions and other unusual features, Is there a way to force it to use dd for both capture and restore, so that it does not attempt to understand the partition structure and just reads and writes the raw data?

Have you tried to use "-j0" or --create-part-by-dd?
j0, --create-part-by-dd Use dd to dump the partition table from saved image instead of sfdisk. ///Note/// This does NOT work when logical drives exist.

Unfortunately the image capture process fails with the same error using both the --create-part-by-dd and -j0 arguments. The error is "can't have overlapping partitions" by parted, and "unknown partition table format" error from the overall process.

We've discovered something interesting - an older version of our OS can be captured and restored just fine by Clonezilla, in beginner mode with default settings. The newer version, with a tweaked partition layout, is what is failing repeatedly. Is there anything about the 2 partition layouts attached, that jumps out as potentially causing the issue?

Very interesting, so it seems like the problem lies with parted. Attached is the result when I manually run the requested commands. It seems like the errors in the overall process are being generated by parted.

If I launch parted manually from the command line, type "print all" and then manually press "I" to ignore the resulting "can't have overlapping partitions" error, I see what looks like normal output with the details of partitions on the disk.

Apparently when using script (-s) in parted, there is no any option we can assign to ignore the error/warning message. Therefore I suggest you manually create a file sda-pt.parted in the image dir, and its output is what you have got from the interactive mode of parted.
Remember to issue "unit s" before you run "print" command.
A complete sda-pt.parted is like:

I'm wondering if I can get a confirmation on the command that should work for generating the sda-pt.parted file to be generated separately, then placed with the OS Flex image backup. I have tried with the following combinations while in a clonezilla shell

Unfortunately, step 4 fails, and it appears that parted overwrites my new, correct files with the empty files. Is there a way to have the process skip running parted, so that it parses my corrected sda-pt.parted and sda-pt.parted.compact files?

What did you mean by "Re-ran the capture command from the command line, pointing to the same directory" in step 4?
Did you mean you save the image using Clonezilla ocs-sr command again?
If so, no, you should not do that. What you need to is to overwrite an existing image with the steps 2&3. I.e., to hack the image dir. Do not use ocs-sr command to save the image again.
Once you have the hacked image, you can use ocs-sr command to "restore" the hacked image.

There is no previously successful image to "hack" - the ocs-sr capture command fails before any actual partition data is captured. See attached screenshot for what is created before the image capture/save process fails. What we are trying to do is find a way for the image to be successfully saved, we haven't even made it to the restore step yet.

OK, my bad. Since I do not have such a device here so that I can not try it before I gave you the hacking tips.
In that case, I suggest you try to edit the file /usr/share/drbl/sbin/ocs-functions before you capture the image. In the function "save_part_table_mbr_dm_info", around the lines 8788 and 8790, remove the option "-s". i.e., make them like:

Then when you capture the image, when parted is run, it should be in interactive mode. You will have to press "I" to ignore that. This might successfully create the required files.
I did not test this, but I think it should work.

If you can provide a machine that I can access that with ssh login (You can make it after booting Clonezilla live, configure the internet and start sshd service), please email me at
steven at clonezilla org
With that, it's easier for us to reproduce this issue and try to find a solution for that.

The issue seems to be that the version of parted included with clonezilla doesn't have an option to manually skip errors, or at least doesn't skip errors by default. I've tried this with clonezilla shell as well. Due to that, the advice to remove -s from the parted command doesn't change the result.

I might have a workaround for this. However, I need the environment to test it. If you have a virtual machine with Chrome OS Flex installed, please share the virtual disk so that I can try to implement this workaround and test it.

As the developer of a Flex Template, you need to build the template to make itavailable to users. Building involves uploading a template spec to aCloud Storage bucket and provisioning a Docker image with the code anddependencies needed to run the pipeline. To build a Flex Template, you need readand write access to Cloud Storage andArtifact Registry Writer accessto your Artifact Registry repository. You can grant these permissions by assigning thefollowing roles:

If you use the Apache Beam SDK version 2.49.0 or earlier,add the --sdk_location=container pipeline option in your pipeline launcher.This option tells your pipeline to use the SDK from your custom containerinstead of downloading the SDK.

If you structure your pipeline as a package,use the FLEX_TEMPLATE_PYTHON_SETUP_FILE option. For more informationabout structuring your pipeline as a package, seeMultiple file dependenciesin the Apache Beam documentation.

If you use this method and use a custom container image to preinstalldependencies in the runtime environment, we recommend that you install the pipeline packagein the custom container image when you build it. Don't specify theFLEX_TEMPLATE_PYTHON_SETUP_FILE option.

You can use a Google-providedbase image to package your templatecontainer images by using Docker. Choose the most recent tag from theFlex Templates base images.It's recommended to use a specific image tag instead of latest.

If your pipeline uses a custom container image, we recommend using the customimage as a base image for your Flex Template Docker image. To do so,copy the Flex Template launcher binary from the Google-providedtemplate base imageonto your custom image.

To use an image from a private registry, specify the path to the imageand a username and password for the registry. The username and password must bestored in Secret Manager. You can provide thesecret in one of the following formats:

You can also use any Apache Beam pipeline options indirectly. If you'reusing a metadata.json file for your Flex Template job, includethese pipeline options in the file. This metadata file must follow the format inTemplateMetadata.

When passing parameters of List or Map type, you might need to defineparameters in a YAML file and use the flags-file.For an example of this approach, view the "Create a file with parameters..." step in this solution.

When using Flex Templates, you can configure some pipeline options during pipelineinitialization, but other pipeline options can't be changed.If the command line arguments required by the Flex Template are overwritten,the job might ignore, override, or discard the pipeline optionspassed by the template launcher. The job might fail to launch, or a job thatdoesn't use the Flex Template might launch. For more information, seeFailed to read the job file.

You can prevent VMs from accepting SSH keys that are stored in project metadataby blocking project SSH keys from VMs. Use the additional-experiments flag withthe block_project_ssh_keys service option:

d3342ee215
Reply all
Reply to author
Forward
0 new messages