Sunday, February 27, 2022

How to install ChromeOS to your USB stick for your old PC

(1) Prepare an USB stick with at least 16G. I am using 64G for demo and you need this size to download and install Linux in ChromeOS. Your PC should x86_64 based computer with UEFI boot support and ave Intel gen 1 to 9 to download rammus recovery image. For detail requirements see here https://github.com/sebanc/brunch.

(2) For Windows OS, first install WSL2 and Ubuntu 20.04 and you must enable this in "Turn On Windows features on and off"

(3) Alternativey, you can use Linux machine with Ubuntu 20.04 to do this

(4) According to the Brunch USB guide The ChromeOS recovery image is based on your CPU of your PC.
For Intel
"rammus" is suggested for 1st gen -> 9th gen.
"volteer" is suggested for 10th & 11th gen.
11th gen (and some 10th gen) may need kernel 5.10
For AMD
"grunt" is suggested for Stoney Ridge & Bristol Ridge.
"zork" is suggested for Ryzen.
Ryzen 4xxx devices need kernel 5.10 when Brunch Framework boot up

(5) After setting up the Ubuntu user and password run these scripts to create the image file (e.g. rammus for USB 64G drive)
sudo apt update
sudo apt -y install pv cgpt tar unzip
mkdir rammus
cd rammus
wget https://github.com/sebanc/brunch/releases/download/r97-stable-20220121/brunch_r97_stable_20220121.tar.gz
tar xzvf brunch_r97_stable_20220121.tar.gz
wget https://dl.google.com/dl/edgedl/chromeos/recovery/chromeos_14388.61.0_rammus_recovery_stable-channel_mp-v2.bin.zip
unzip chromeos_14388.61.0_rammus_recovery_stable-channel_mp-v2.bin.zip
# 64G USB has only about 58G for actual usage, so the size parameter here is 58.
sudo bash chromeos-install.sh -src chromeos_14388.61.0_rammus_recovery_stable-channel_mp-v2.bin -dst /mnt/c/Users/Public/Downloads/chromeos_rammus_58g.bin -s 58


(6) Then use ChromeOS Recovery Utility to flash the images, Use local image in Settings and select the "C:/Users/Public/Downloads/chromeos_rammus_58g.bin" image. See here

(7) If you are lazy to create this image, you can use mine and download it from chromeos_rammus_58g.bin.zip (3.61GB). You don't need to unzip it for creation of USB flash drive in ChromeOS Recovery Utility or Rufus

(8) If your PC has secure boot enabled, either disable it (ig you have set the supervisor password) or import the key from USB. To enroll the key directly from a USB, select OK -> Enroll key from disk -> EFI-SYSTEM -> brunch.der -> Continue and reboot. Moreoover, enable of UEFI support and change the boot order to USB is needed in BIOS.

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.