Skip to content

Instantly share code, notes, and snippets.

@SayantanRC
Last active July 5, 2024 10:08
Show Gist options
  • Save SayantanRC/9096b79bb083c587dae9066810782024 to your computer and use it in GitHub Desktop.
Save SayantanRC/9096b79bb083c587dae9066810782024 to your computer and use it in GitHub Desktop.
Chrome OS - Brunch - Resize image

Chrome OS - Brunch - Resize image

WARNING: This can completely destroy your Chrome OS installation. Please take a backup.
Also note, after successful resize, brunch will rebuild the rootfs on first boot.

Needed

  1. Linux environment (installed / live USB)
  2. Some knowledge on using the dd command. Optional, but good to have.
  3. The program GParted.

Steps

  1. Install GParted. In Arch linux it can be installed by sudo pacman -S gparted in the terminal. Ubuntu live USB come preinstalled with Gparted. Check the instructions for your distro.

  2. Open Terminal. Navigate to the location of your brunch chromeos.img file.

  3. Here we will expand be 9 GB. Hence use the below command:

    sudo dd if=/dev/zero bs=1k count=$((1024*1024*9)) status=progress >> chromeos.img
    

    Change the value in the bracket in bold to your liking. Here it is 9 for 9 GB.

  4. Wait for it to finish.

  5. Next type the below command:

    sudo losetup --partscan /dev/loop99 chromeos.img
    

    This should mount all the partitions as loop devices.
    Type lsblk should show something like this:

    NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
    loop99        7:99   0    29G  0 loop 
    ├─loop99p1  259:0    0  10.8G  0 part 
    ├─loop99p2  259:1    0    32M  0 part 
    ├─loop99p3  259:2    0     4G  0 part 
    ├─loop99p4  259:3    0    32M  0 part 
    ├─loop99p5  259:4    0     4G  0 part 
    ├─loop99p6  259:5    0   512B  0 part 
    ├─loop99p7  259:6    0     1G  0 part 
    ├─loop99p8  259:7    0    16M  0 part 
    ├─loop99p9  259:8    0   512B  0 part 
    ├─loop99p10 259:9    0   512B  0 part 
    ├─loop99p11 259:10   0     8M  0 part 
    └─loop99p12 259:11   0    32M  0 part 
    
  6. Next run GParted from the terminal on the loop device /dev/loop99.

    gparted /dev/loop99
    
  7. You will get a warning as below:

    Not all of the space available to /dev/loop99 appears to be used, you can fix the GPT to use all of the space (an extra 18874368 blocks) or continue with the current setting?

    Click Fix.

  8. You should be able to see a large "unallocated" area at the end.

  9. Right click on the "STATE" partition (it should be the last partition) -> Resize/Move -> Drag the end to fill the whole "unallocated" space -> Click "Resize/Move".

  10. Hit Apply Button and wait for it to finish. Then close the program.

  11. Unmount the loop device by:

    sudo losetup -d /dev/loop99
    
  12. Finally Reboot and enjoy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment