Moode Forum

Full Version: Increasing root partition size
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
If you want, for some reasons, increase the root partition size (for example, depending on moOde version, you could not have enought space to proceding an in-place update) without expanding the whole system, here is how to do it:

Code:
sudo fdisk /dev/mmcblk0

Type p to list the partition table
Code:
Welcome to fdisk (util-linux 2.33.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): p
Disk /dev/mmcblk0: 183.4 GiB, 196865949696 bytes, 384503808 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x2fed7fee

Device         Boot  Start     End Sectors  Size Id Type
/dev/mmcblk0p1        8192  532479  524288  256M  c W95 FAT32 (LBA)
/dev/mmcblk0p2      532480 7700479 7168000  3.4G 83 Linux
Take note to the start number from /dev/mmcbl0p2 line, in this case, it's 532480

Type d to delete a partition
Type 2 to choosing partition number 2
Type n to create a new partition
Type p to create a primary partition
Type 2 for setting the partition number
Enter the value you took note for the first sector, in my case it's 532480
Enter the value you want for the last sector, it will be the size of your new partition, in my case i will use 10485760 (more or less 5go)
Type N to not removing the signature
Type w to save the changes you made

Now you can reboot:
Code:
sudo reboot

And to finish, resize the partition:
Code:
sudo resize2fs /dev/mmcblk0p2

You can check the new partition size with df -h command:
Code:
Filesystem      Size  Used Avail Use% Mounted on
/dev/root       4.7G  2.6G  1.9G  58% /
devtmpfs        424M     0  424M   0% /dev
tmpfs           457M     0  457M   0% /dev/shm
tmpfs           457M  7.1M  450M   2% /run
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           457M     0  457M   0% /sys/fs/cgroup
/dev/mmcblk0p1  253M   56M  197M  22% /boot
/dev/sda1       115G   53G   63G  46% /media/A5E4-9FA5
tmpfs            92M     0   92M   0% /run/user/1000