Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to increase partition size #46

Closed
JamiKettunen opened this issue Mar 22, 2023 · 1 comment
Closed

Ability to increase partition size #46

JamiKettunen opened this issue Mar 22, 2023 · 1 comment

Comments

@JamiKettunen
Copy link
Contributor

From https://t.me/ubports_devel/70273 when someone asked about getting a bigger rootfs (assumes linux env and not using the snap):

disk_img=~/.config/UbuntuTouchPdk/data/pdk-image-cache/default/hdd.raw
root_par_start_sector=976563
root_par_offset=$(($root_par_start_sector * 512))

dd if=/dev/zero bs=1G count=15 >> $disk_img
fdisk $disk_img <<EOF
p
d
3
n
p
3
$root_par_start_sector

n
p
w
EOF

loop_dev=$(sudo losetup --offset=$root_par_offset --find --show $disk_img)
sudo e2fsck -fy $loop_dev
sudo resize2fs $loop_dev
sudo losetup --detach $loop_dev

about the "magic numbers" 976563 is the Start sector of the 13.5G ext4 root partition as shown by fdisk -l <path to hdd.raw>, and 500000256 (root_par_offset) is the start sector * sector size (512 bytes), so the partition start offset in bytes

Not sure if this is super useful since not many (if any) people have needed it so far, but gonna leave this here just in case it might be.

@JamiKettunen
Copy link
Contributor Author

Closing as #45 already existed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant