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

Disk size update. #45

Open
oznfc opened this issue Mar 19, 2023 · 1 comment
Open

Disk size update. #45

oznfc opened this issue Mar 19, 2023 · 1 comment

Comments

@oznfc
Copy link

oznfc commented Mar 19, 2023

How can ı update my disk size. when ı creare mydisk.hdd it's creating 15GB outomaticaly. ı want to add more size.

@JamiKettunen
Copy link
Contributor

From https://t.me/ubports_devel/70273 (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

Perhaps it makes sense to keep this issue open until an integrated way to increase the partition size is included.

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

2 participants