Friday, February 25, 2022

How to download and resize Chrome OS Flex Image for USB boot Install

While you can live boot Chrome OS Flex from the USB installer, Google recommends that you fully install it on devices. When you live-boot Chrome OS Flex, limited storage (4GB) is available because of the layout of Chrome OS Flex's partition table. To overcome this limitation, we have to resize the partition to fully utilise your USB storage space.

How to download and resize Chrome OS Flex Image to 20GB, which is suitable to be use on a 32GB USB drive.
# use a linux machine, or Windows WSL Ubuntu 20.04 # see here https://github.com/sebanc/brunch/blob/master/install-with-windows.md

shell script    Select all
sudo apt update sudo apt -y install pv cgpt tar unzip curl cloud-guest-utils mkdir -p ~/Downloads cd ~/Downloads # download ChromeOS Flex image based on this conf file https://dl.google.com/dl/edgedl/chromeos/recovery/cloudready_recovery.conf # curl -OL https://dl.google.com/dl/edgedl/chromeos/recovery/chromeos_14516.0.0_reven_recovery_dev-channel_mp-v2.bin.zip curl -OL https://dl.google.com/dl/edgedl/chromeos/recovery/chromeos_14574.0.0_reven_recovery_dev-channel_mp-v2.bin.zip unzip chromeos_14574.0.0_reven_recovery_dev-channel_mp-v2.bin.zip ls -lh chromeos_14574.0.0_reven_recovery_dev-channel_mp-v2.bin # 20G is seek=20971520 # 28G is seek=29360128 (there is only 28G for 32G USB stick) # 58G is seek=60817408 (there is only 58G for 64G USB stick) # don't do method 1 on removable HD # grow image method 1 dd if=/dev/zero of=chromeos_14516.0.0_reven_recovery_dev-channel_mp-v2.bin seek=20971520 obs=1024 count=0 # grow image method 2, slower but works on removeable HD # 58G is count=52452 (there is only 58G for 64G USB stick) expr 20 \* 1024 - 6940 # calculate 20G = 13540 expr 28 \* 1024 - 6940 # calculate 28G = 21732 expr 58 \* 1024 - 6940 # calculate 58G = 52452 dd if=/dev/zero bs=1M count=13540 >> ./chromeos_14574.0.0_reven_recovery_dev-channel_mp-v2.bin # rename the file mv chromeos_14574.0.0_reven_recovery_dev-channel_mp-v2.bin chromeosflex20g.bin # grow partition 1, growpart is part of cloud-guest-utils package growpart chromeosflex20g.bin 1 # show new data partition 1, start is 5152768 , size is now 36790239 (17G) cgpt show chromeosflex20g.bin | grep -B 5 STATE cgpt repair chromeosflex20g.bin



Then use ChromeOS Recovery Utility to flash the images, Use local image in Settings and select the chromeosflex20g.bin image.
See here



IMPORTANT
The final step is to put the USB drive to linux system and check the drive using
sudo fdisk -l
# e.g. the USB drive partition 1 is sda1

# first check
sudo e2fsck -f /dev/sda1
# then resize it
sudo resize2fs /dev/sda1


However, one of the limitations of live-boot USB is that the ChromeOS cannot be updated live. So your work has to be able to backup to Google Drive, Dropbox (using File System for Dropbox), OneDrive (using File System for OneDrive) or your LAN network share drive.

No comments: