NanoPi 2 Debian disk partition question

ghost
Hi,

I have got the new NanoPi 2, and followed the guide from
http://wiki.friendlyarm.com/wiki/index.php/NanoPi_2 to write Debian system
with DiskImager into a 16GB TF card. The system successfully booted but by
using command "df" to check the disk partition, I found only approximately
3G space is allocated to the system and around 12 GB is not used. This
results in "not enough space" error when I was trying to install some
software.

I tried re-image the card, but same result I got.

Please guide what I can do.

jjm
Get Started

Essentials You Need

Before play with your NanoPi2 please get the following items ready 
 1、NanoPi 2 
 2、microSD Card/TFCard: Class 10 or Above, minimum 8GB SDHC
 3、microUSB power. A 5V/2A power is a must
 4、HDMI monitor or LCD 

Make an Installation MicroSD Card

Under Windows

Please get the following files from here:download link to download image
files: 

Please uncompress these files. Insert an SD card(at least 4G) to a Windows
PC, run the win32diskimager utility as administrator,On the
utility's main window select your SD card's drive and the image files and
click on "write" to start flashing the SD card.
 Please insert this card to your NanoPi2 and power on (with a 5V/2A power
source). If the blue LED and green LED are blinking this indicates your
NanoPi2 is successfully booted.

ghost
Hi jjm,

I did follow the steps you mentioned. My TF card is 16 GB, but after
burning only less than 3GB used and I cannot install essential packages due
to limited space in root.

jjm
Extend NanoPi 2's TF Card Section

For Debian

Please run the following commands on a PC host's terminal:

sudo umount /dev/sdx
sudo parted /dev/sdx unit % resizepart 2 100 unit MB print
sudo resize2fs -f /dev/sdx2


For Android

Please run the following commands on a PC host's terminal:

sudo umount /dev/sdx
sudo parted /dev/sdx unit % resizepart 4 100 resizepart 7 100 unit MB print
sudo resize2fs -f /dev/sdx7


(Note: you need to replace "/dev/sdx" with the device name in your system)

Henry
Hi

I met the same problem. My SD card capacity is 8GB, here is the console
print out when I run df command:

root@nanopi2:~# df -kh
Filesystem      Size  Used Avail Use% Mounted on
/dev/root       2.0G  1.6G  376M  81% /
devtmpfs        405M     0  405M   0% /dev
tmpfs           406M     0  406M   0% /dev/shm
tmpfs           406M  6.1M  399M   2% /run
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           406M     0  406M   0% /sys/fs/cgroup
tmpfs            82M  4.0K   82M   1% /run/user/1000
tmpfs            82M     0   82M   0% /run/user/0
/dev/mmcblk0p1   63M   16M   48M  26% /media/fa/boot1

Only 2GB for root, I've also checked available partition :

root@nanopi2:~# ls /dev/ | grep mmc
mmcblk0
mmcblk0p1
mmcblk0p2

Try to mount /dev/mmcblk0p2 but I get the same folder as Debian root file
system

root@nanopi2:~# mount /dev/mmcblk0p2 mount_point/
root@nanopi2:~# ls mount_point/
bin   dev  home  lost+found  mnt  proc  run   srv  tmp  var
boot  etc  lib   media       opt  root  sbin  sys  usr

Not easy to understand. I've use win32diskimager.exe to creat bootable
microSD card, somethings are wrong here.

paul
Im having the same problem...  
Could it be the format of the original SD card ?  I may have formatted as
FAT32... and not extFat before copying the image on...  that could explain
why its just under 4Gb, and not the whole SD card capacity...  I'm going to
try... will report back...

Serge
Work only this command

>sudo resize2fs -f /dev/mmcblk0p2

increase free size up to 47%

pi@nanopi2:~$ sudo df -kh

Filesystem      Size  Used Avail Use% Mounted on
/dev/root       3.1G  1.7G  1.5G  53% /
devtmpfs        405M     0  405M   0% /dev
tmpfs           406M     0  406M   0% /dev/shm
tmpfs           406M   12M  394M   3% /run
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           406M     0  406M   0% /sys/fs/cgroup
tmpfs            82M  4.0K   82M   1% /run/user/1000
/dev/mmcblk0p1   63M   16M   48M  26% /media/fa/boot1
tmpfs            82M  4.0K   82M   1% /run/user/1001
pi@nanopi2:~$

Serge
I knew how to make as simple as possible. 2 pertition (/dev/mmcblk0p2) 
cannot be changed - because it was loaded and can't be unmounted / So it is
necessary to boot from another SD card (!!!)
 
1) I Made a second SD card - as a clone bootable SD ( by win2image.exe )
and put it in the primary slot. Original SD card - put into secondary slot
2) Reboot 
2) Set the tool gparted. (sudo apt-get install gparted)
3) Run gparted
3) Chose the 2nd drive and 2nd partition, then success unmount
/dev/mmcblk0p2
4) Check /dev/mmcblk0p2  of the error and resize to nessesary size
5) Exit gparted
6) Shutdown
7) Put a original card from the 2nd slot back to first slot
8) Starting without any error's and warning's
Bingo !

Best regards, Serge

Peter Scargill
I have the NanoPi M1 and this has exactly the same issue. It has only 2GB
of available space when the SD is 8GB.  I followed your installation
instructions.

You should note that in the case of the Raspberry Pi, they automatically
resize the partition on first use of the card. It would make sense for you
to do the same and save customers this problem.

The instructions above do not work and I don't have a second "slot" to put
the card into.

So - for Debian and the M1 - how do I resize the partition to fill the
available Space - I cannot even do apt-get upgrade as there is no room?

Pete.

Peter Scargill
On the NanoPC T2 you gave similar advice for Android to that above. It
simply does not work. I checked that SDA exists - it does. I have a 64GB
SD.

1. sudo unount /dev/sda
This reports that /dev/sda is not mounted

2. sudo parted /dev/sda unit % resizepart 4 100 resizepart 7 100 unit MB
print

Parted objects to invalid token:100
then says Yes/No. I select Y.
If then says End? [6.111$]?  I put in 100%

It then says "Information: You may need to update /etc/fstab

3. sudo resize2fs -f /dev/sda7

The unit says the filesystem is already 62448 (4k) blocks long. Nothing to
do.

And that's it - I put the SD back into the PCT3 and absolutely nothing has
changed!!!!

This is starting to get tedious - Android with only 4Gig is utterly
useless.

What is the correct procedure to expand to make use of the rest of my 64GB
SD please?

jjm
Hello all,
     Now you can use the latest image which has added resize SD card
directly when you boot the board first time,you donot need resize by
yourself.