32GB SD on Ubuntu Mate shows only 3.8 GB


22 posts
by mikelo » Sun May 17, 2015 9:10 pm
I install Ubuntu MATE on my Pi. I When I was trying install other app on it. it shows me not have enought storage, I clikc exam the disk button. It shows me that I only have 3.8 GB. Does any one know how to fix this issue?
Posts: 4
Joined: Sun May 17, 2015 9:04 pm
by fruitoftheloom » Sun May 17, 2015 9:27 pm
mikelo wrote:I install Ubuntu MATE on my Pi. I When I was trying install other app on it. it shows me not have enought storage, I clikc exam the disk button. It shows me that I only have 3.8 GB. Does any one know how to fix this issue?

You need to resize file system, instructions are on the MATE web page

https://ubuntu-mate.org/raspberry-pi
.
Ex Computer Repair & Service Technician.
RPi 3B, HP Envy 4500 Wireless Printer, Google Chromecast, Android Smart Phone, HD 1080p TV and 3/4G Mobile Internet make ideal companions.
Posts: 13310
Joined: Tue Mar 25, 2014 12:40 pm
Location: Bognor Regis UK
by mikelo » Mon May 18, 2015 12:43 am
so, should I start with build or re-size system?
Posts: 4
Joined: Sun May 17, 2015 9:04 pm
by ktb » Mon May 18, 2015 3:05 am
mikelo wrote:so, should I start with build or re-size system?

"Re-size file system"

You would only use the build script if you wanted to create your own Ubuntu MATE image.
Posts: 1262
Joined: Fri Dec 26, 2014 7:53 pm
by fruitoftheloom » Mon May 18, 2015 5:52 am
mikelo wrote:so, should I start with build or re-size system?

What, read the web page :roll:

Re-size file system
There are no utilities included for automatic file system re-sizing. However, it's not hard to do manually. Once booted:

sudo fdisk /dev/mmcblk0
Delete the second partition (d, 2), then re-create it using the defaults (n, p, 2, enter, enter), then write and exit (w). Reboot the system, then:

sudo resize2fs /dev/mmcblk0p2
.
Ex Computer Repair & Service Technician.
RPi 3B, HP Envy 4500 Wireless Printer, Google Chromecast, Android Smart Phone, HD 1080p TV and 3/4G Mobile Internet make ideal companions.
Posts: 13310
Joined: Tue Mar 25, 2014 12:40 pm
Location: Bognor Regis UK
by 1775 » Wed May 20, 2015 10:20 pm
Get Ubuntu Mate fully installed - which you already have done. Now follow the instructions on the link given in the response above to Resize File System using fdisk. Do it from the Ubuntu terminal and you will now have all of the available space on your 32 gb SD card. Look in the Caja file manager and you will see available space at the bottom of the Caja window. The process is simple as long as you follow it step by step.
Posts: 51
Joined: Sat Apr 18, 2015 4:16 am
by davidmonten » Thu Aug 13, 2015 8:55 pm
I've done the resize step-by-step and at the end it correctly says that the new size of the filesystem would be 14Gb (I'm using a 16Gb SD).
Than I reboot but the Disk Usage Analizer still measure 3.8Gb... :shock:

what should I double-check?
Posts: 5
Joined: Thu Aug 13, 2015 8:24 pm
by davidmonten » Thu Aug 13, 2015 10:10 pm
I followed the steps but when the fdisk try to write it shows on the terminal this message in red:

The partition table has been altered.
Calling ioctl() to re-read partition table.
Re-reading the partition table failed.: Device or resource busy

The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8).


It sounds important, but i ignore it and go on following the next instruction
Code: Select all
sudo resize2fs /dev/mmcblk0p2

and here is the terminal answer

resize2fs 1.42.12 (29-Aug-2014)
Filesystem at /dev/mmcblk0p2 is mounted on /; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 1
The filesystem on /dev/mmcblk0p2 is now 3872896 (4k) blocks long.


what should I doublecheck?
why it fails to read the partition table?
Posts: 5
Joined: Thu Aug 13, 2015 8:24 pm
by kusti8 » Fri Aug 14, 2015 12:59 am
That's normal.

Did you reboot after resize2fs? That is needed.
There are 10 types of people: those who understand binary and those who don't.
User avatar
Posts: 3311
Joined: Sat Dec 21, 2013 5:29 pm
Location: USA
by rpdom » Fri Aug 14, 2015 5:56 am
The warning message is saying that the kernel is still using the old version of the partition table and doesn't realise the partition size has changed.

You need to reboot so it will read the new table before doing the resize operation.
User avatar
Posts: 10567
Joined: Sun May 06, 2012 5:17 am
Location: Essex, UK
by davidmonten » Fri Aug 14, 2015 6:43 am
I've done two operations:
- reboot
- partprobe command without options or partitions.

So now I should have 14gb of space in filesystem, right?
I'll check asap (writing from mobile)
Posts: 5
Joined: Thu Aug 13, 2015 8:24 pm
by rpdom » Fri Aug 14, 2015 7:23 am
Yes, as long as you have run the sudo resize2fs command after the reboot. The partprobe is not needed.

Basically the sequence to resize the root partition is

1. fdisk (or equivalent) to change the partition size.
2. Reboot so the kernel will see the new size.
3. resize2fs to resize the filesystem to fill the new partition size.
User avatar
Posts: 10567
Joined: Sun May 06, 2012 5:17 am
Location: Essex, UK
by davidmonten » Fri Aug 14, 2015 1:16 pm
after the reboot
Code: Select all
auser@auser-desktop:~$ sudo resize2fs /dev/mmcblk0p2
[sudo] password for auser:
resize2fs 1.42.12 (29-Aug-2014)
The filesystem is already 3872896 (4k) blocks long.  Nothing to do!


So now I'll restart all the procedure from the beginning following this http://ubuntu-mate.org/raspberry-pi/

1. fdisk: cancel and rewrite the partition 2; write at the end.
2. reboot
3. resize2fs

I'll go straight forward. I'll keep you updated.

EDIT

1. fdisk (rewrite the table)

Code: Select all
root@auser-desktop:~# sudo fdisk /dev/mmcblk0

Welcome to fdisk (util-linux 2.25.2).
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: 14,9 GiB, 15931539456 bytes, 31116288 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: 0x00000000

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

Command (m for help): d       
Partition number (1,2, default 2): 2

Partition 2 has been deleted.

Command (m for help): n
Partition type
   p   primary (1 primary, 0 extended, 3 free)
   e   extended (container for logical partitions)
Select (default p): p
Partition number (2-4, default 2): 2
First sector (133120-31116287, default 133120):
Last sector, +sectors or +size{K,M,G,T,P} (133120-31116287, default 31116287):

Created a new partition 2 of type 'Linux' and of size 14,8 GiB.

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Re-reading the partition table failed.: Device or resource busy

The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8).

root@auser-desktop:~#


2. reboot
Posts: 5
Joined: Thu Aug 13, 2015 8:24 pm
by davidmonten » Fri Aug 14, 2015 1:42 pm
3. resize2f

Code: Select all
auser@auser-desktop:~$ sudo resize2fs /dev/mmcblk0p2
[sudo] password for auser:
resize2fs 1.42.12 (29-Aug-2014)
The filesystem is already 3872896 (4k) blocks long.  Nothing to do!

auser@auser-desktop:~$


And now... :o

15.6Gb of space in filesystem, 3.7 used.

Thanks :D :mrgreen:
Posts: 5
Joined: Thu Aug 13, 2015 8:24 pm
by duroby » Sun Aug 16, 2015 7:26 am
OR... If you have a fully-featured Linux machine available with a SD card reader.

As a different, simpler, approach, you can put the Raspberry Pi SD card into the Linux computer and use gparted to resize the partition.

To resize, all that is needed is to unmount the /ROOT partition, drag the right hand edge of the partition size graphic for that partition, and "apply" the result.

I then re-mounted the partition to confirm that all was well, and it was. Gparted makes the whole process as easy as anyone could wish for.

enjoy.
Posts: 4
Joined: Thu Aug 06, 2015 3:27 am
by jdtech » Sun Aug 23, 2015 5:43 pm
I have this problem as well, I got too excited :P and forgot to run those commands :!: . Now I have important data on my R.Pi, does the resizing delete my data?
Posts: 2
Joined: Sun Aug 23, 2015 5:39 pm
by kusti8 » Sun Aug 23, 2015 6:03 pm
jdtech wrote:I have this problem as well, I got too excited :P and forgot to run those commands :!: . Now I have important data on my R.Pi, does the resizing delete my data?


No, all data is kept, as long as you follow the instructions in the link exactly.
There are 10 types of people: those who understand binary and those who don't.
User avatar
Posts: 3311
Joined: Sat Dec 21, 2013 5:29 pm
Location: USA
by jdtech » Sun Aug 23, 2015 6:11 pm
kusti8 wrote:
jdtech wrote:I have this problem as well, I got too excited :P and forgot to run those commands :!: . Now I have important data on my R.Pi, does the resizing delete my data?


No, all data is kept, as long as you follow the instructions in the link exactly.


Thanks! Such a quick reply :D
Posts: 2
Joined: Sun Aug 23, 2015 5:39 pm
by darkrisingx » Fri Oct 09, 2015 12:36 am
I did it just as the guide says as other have said above but I did do it correctly. Run the commands as it says. Then rebooted then run the other command it says and works without issue I go to see if the system is reading the GB right and it does. But after any system restart after this the system refuses to boot.

At this point i'm looking to just boot my desktop into ubuntu and use gparted to re-size it.

EDIT
Used my ubuntu 14.04 disk I had laying around to boot into a live cd for gparted. Used gparted to resize the drive and then put back in raspberry worked without issues and full disk space is showing. I have run the commands in the past on other systems without issues but this is the first time i have tired it on this sd card might be related to some sd cards? unsure but gparted worked as expected so guess it's a work around.
Posts: 3
Joined: Thu Oct 08, 2015 4:01 pm
by pranita » Fri Nov 20, 2015 6:33 am
davidmonten wrote:after the reboot
Code: Select all
auser@auser-desktop:~$ sudo resize2fs /dev/mmcblk0p2
[sudo] password for auser:
resize2fs 1.42.12 (29-Aug-2014)
The filesystem is already 3872896 (4k) blocks long.  Nothing to do!


So now I'll restart all the procedure from the beginning following this http://ubuntu-mate.org/raspberry-pi/

1. fdisk: cancel and rewrite the partition 2; write at the end.
2. reboot
3. resize2fs

I'll go straight forward. I'll keep you updated.

EDIT

1. fdisk (rewrite the table)

Code: Select all
root@auser-desktop:~# sudo fdisk /dev/mmcblk0

Welcome to fdisk (util-linux 2.25.2).
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: 14,9 GiB, 15931539456 bytes, 31116288 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: 0x00000000

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

Command (m for help): d       
Partition number (1,2, default 2): 2

Partition 2 has been deleted.

Command (m for help): n
Partition type
   p   primary (1 primary, 0 extended, 3 free)
   e   extended (container for logical partitions)
Select (default p): p
Partition number (2-4, default 2): 2
First sector (133120-31116287, default 133120):
Last sector, +sectors or +size{K,M,G,T,P} (133120-31116287, default 31116287):

Created a new partition 2 of type 'Linux' and of size 14,8 GiB.

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Re-reading the partition table failed.: Device or resource busy

The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8).

root@auser-desktop:~#


2. reboot



Hi David,

This works for me without fail, thanks for gathering all the commands at one place :)
But, I want to ask one thing that will that be possible to resize the boot partition on Raspberry PI device?
I want to make some more space in /dev/mmcblk0p1 partition,so will it be same like re-sizing the /dev/mmcblk0p2 partition like you mentioned in your reply?

I am new to these tools, so sorry if asking anything wrong or impossible stuff.

Thanks.
Posts: 11
Joined: Mon Aug 11, 2014 1:03 pm
by rpdom » Fri Nov 20, 2015 6:41 am
It is possible to expand the /dev/mmcblk0p2 partition because there was only unallocated space after it. /dev/mmcblk0p1 can't be expanded (easily) because there is no unallocated space between it and partition 2.

It is possible, but not easy. The simplest way would be to get another card, create two partitions the sizes you want, format them and copy the contents of the old partitions across using something like rsync.

There shouldn't really be any need to resize partition 1, it's big enough for the files that should be in there. However, if you were thinking about using it to transfer files between your Pi and a Windows PC (for example), then consider either a USB stick or using a network share instead.
User avatar
Posts: 10567
Joined: Sun May 06, 2012 5:17 am
Location: Essex, UK
by Jeffmodell » Wed Jan 13, 2016 8:22 am
this is what I get when I run the last command after rebooting:
Code: Select all
jeff@RasPiBuntu:~$ sudo resize2fs /dev/mmcblk0p2
[sudo] password for jeff:
resize2fs 1.42.12 (29-Aug-2014)
Filesystem at /dev/mmcblk0p2 is mounted on /; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 2
resize2fs: Permission denied to resize filesystem
Posts: 1
Joined: Tue Sep 22, 2015 8:00 pm