Tiny Core Linux
Tiny Core Base => TCB Talk => Topic started by: code on October 05, 2017, 03:57:49 PM
-
This isn't exactly a Tinycore problem but I can't figure out how to expand the drive size.
# Create drive to VM
qemu-img create -f qcow2 test.qcow2 3G
# Download Live-CD
wget http://tinycorelinux.net/6.x/x86/release/Core-6.4.1.iso
# Start the VM with Live-CD and drive
qemu-system-x86_64 -cdrom Core-6.4.1.iso -m 512 -hda test.qcow2 --boot d
# If you don't have qemu-system-x86_64 use qemu-system
# Frugal Install
tce-load -wi tc-install
sudo tc-install.sh
c -> f -> 1 -> 2 (sda) - > y -> 3 (ext4) -> enter -> y -> enter
# Shutdown to restart without the disc
exitcheck.sh
# Run without Live-CD
qemu-system-x86_64 -m 512 -hda test.qcow2
# Currently system has 3 GB available
df
# shutdown to expand drive (.qcow2 file)
exitcheck.sh
# Increase drive size
qemu-img resize test.qcow2 +5G
# If you start is now `df` output will look the same
# Run with Live-CD to umount and expand available drive
qemu-system-x86_64 -cdrom Core-6.4.1.iso -m 512 -hda test.qcow2 --boot d
# Enter the following boot codes
mc base norestore
# Expand the partition
sudo fdisk /dev/sda
p -> d -> n -> p -> 1 -> enter -> +8GB -> w
sudo reboot
# Enter the following boot codes
mc base norestore
# Expand the file system
tce-load -wi e2fsprogs.tcz
sudo e2fsck -f /dev/sda1
sudo resize2fs /dev/sda1
# shutdown
exitcheck.sh
# Run without Live-CD and it won't boot
qemu-system-x86_64 -m 512 -hda test.qcow2
# No bootable device.
https://gist.github.com/Siecje/42233192cabd6703fb208000b7e11a8e#file-shell-sh-L37
It all seems to work but on reboot the system is broken.
-
Because you deleted the partition, you lost the "active/bootable" flag, at least. It's also not necessary to reboot between fdisk and resize2fs.
-
What is the correct way to expand without deleting and making a new one?
-
Did you search the forum using “re-size partition”?
-
I searched but I can't find anything that explains how to do it. There were 2 threads found.
-
You can use gparted if you prefer a gui or use the readme for the piCore installation, which gives the general idea for a cli.
-
And also like that @curaga says.
Don't forget to set the bootflag of the new partition.
Because when in picore.. the first partition is not used for root, just fat formatted firmware and kernel partition.
-------------------------
Because you deleted the partition, you lost the "active/bootable" flag, at least. It's also not necessary to reboot between fdisk and resize2fs.
--------------------------
-
Thanks my problem was not setting the bootflag on the new partition. Oddly the piCore README doesn't include this step either.
http://tinycorelinux.net/9.x/armv6/releases/RPi/README
In case it is helpful to someone in the future, here is how I am expanding the drive size.
https://gist.github.com/Siecje/42233192cabd6703fb208000b7e11a8e
-
It's not there, because is not the boot active first partition (1) you have to expand.
It's root partition (2), you have to expand.