Expand Drive size with Tinycore Linux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 -> enter -> a -> 1 -> w | |
# p shows partition table | |
# d deletes a partition (it automatically deletes the only one) | |
# n creates a new partition (then p for primary) | |
# Then enter twice for the start to the end | |
# a to set the bootable flag | |
# 1 to specify the first partition should be bootable | |
# w to save and exit | |
# 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 | |
qemu-system-x86_64 -m 512 -hda test.qcow2 | |
# Currently system has 8 GB available | |
df |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment