WHAT'S NEW?
Loading...

Low Disk Space - The volume “filesystem root” has only X bytes disk space remaining

Sometimes when you write a small IMG file on the SD card and you are using an SD card with a great capacity, upon writing the image to the SD card, not all space on the SD card will be used. If this is the case, then to gain more free space, the partitions must be resized. In this guide you will learn how you can allocate more space and use the full capacity of your SD card.



First make a backup of your SD Card using the instructions found here in case something goes wrong.
From the command line or a terminal window enter the following
sudo fdisk /dev/mmcblk0
then type p to list the partition table
you should see two or more partitions.

Device         Boot  Start      End  Sectors  Size Id Type
/dev/mmcblk0p1 *      2048   133119   131072   64M  c W95 FAT32 (LBA)
/dev/mmcblk0p2      133120 31116287 30983168 14,8G 83 Linux
make a note of the start number for partiton 2, you will need this later.

Next type d to delete a partition.
You will then be prompted for the number of the partition you want to delete. Delete both the Linux and (Linux swap partitions if exists)
So type 2
then type d again and then type 3 to delete the swap partition if exists.
Now you can resize the main partition.
type n to create a new partition.
This new partition needs to be a primary partition so type p.
Next enter 2 when prompted for a partition number.
You will now be prompted for the first sector for the new partition. Enter the start number from the earlier step (the Linux partition) or hit enter to accept the default.
Next you will be prompted for the last sector you can just hit enter to accept the default which will utilize the remaining disk space.
Type w to save the changes you have made.
Next reboot the system with the following command:
sudo reboot
once the system has reboot and you are back at the commandline enter the following command:
sudo resize2fs /dev/mmcblk0p2
Note: be patient and let it finish
Once it is done reboot the system with the following command:
sudo reboot
You can now verify that the system is using the full capacity of the SD Card by entering the following command:
df -h

0 comments:

Post a Comment