Jetson Nano sd card partitions can not extend

jetson nano using jetpack 4.2 flash images and AI packages
sd size : 32G
after flask image,I can only locate 16G on the system,the other 16G became unallocated.
gparted info:

I tried to use gparted to extend /dev/mmcblk0p1 but the maximum space is 14G
gparted info:

Is there any way to allocate 16G(unallocated space)

sudo fdisk -l

Disk /dev/mmcblk0: 29.7 GiB, 31914983424 bytes, 62333952 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: gpt
Disk identifier: 00000000-0000-0000-0000-000000000000

Device             Start      End  Sectors  Size Type
/dev/mmcblk0p1        34 29360161 29360128   14G Microsoft basic data
/dev/mmcblk0p2  29360162 29360417      256  128K Microsoft basic data
/dev/mmcblk0p3  29360418 29361313      896  448K Microsoft basic data
/dev/mmcblk0p4  29361314 29362465     1152  576K Microsoft basic data
/dev/mmcblk0p5  29362466 29362593      128   64K Microsoft basic data
/dev/mmcblk0p6  29362594 29362977      384  192K Microsoft basic data
/dev/mmcblk0p7  29362978 29363745      768  384K Microsoft basic data
/dev/mmcblk0p8  29363746 29363873      128   64K Microsoft basic data
/dev/mmcblk0p9  29363874 29364769      896  448K Microsoft basic data
/dev/mmcblk0p10 29364770 29365665      896  448K Microsoft basic data
/dev/mmcblk0p11 29365666 29367201     1536  768K Microsoft basic data
/dev/mmcblk0p12 29367202 29367329      128   64K Microsoft basic data
/dev/mmcblk0p13 29367330 29367489      160   80K Microsoft basic data
/dev/mmcblk0p14 29367490 29367745      256  128K Microsoft basic data

FYI, since this is a GPT partition scheme (and not an old style BIOS), the use of “fdisk” is deprecated. You’d want to use only “gdisk”. “gparted” is in fact using “gdisk” as the backend, so “gparted” is ok, but I’m not sure “fdisk” will give you correct information.

What do you see from both of the following commands:

sudo gdisk -l /dev/mmcblk0
lsblk -f /dev/mmcblk0

I’m not certain if a partition with other partitions beyond it can be extended, but in theory I’d think may be a solid state device could extend. If not, there may be a manual way to do that (but I won’t guarantee it).

Hi tom.huang,

This is known issue, we have added this issue in our release note.
Nano /dev/root device size is restricted to 14 GB when using flash.sh to write to an SD card. User cannot create additional partitions on the root device, so any excess space is unavailable.
Sorry for inconvenience.

R32.1 L4T release note: https://developer.nvidia.com/embedded/dlc/l4t-release-notes-32-1

this is fixed for me

Number Start (sector) End (sector) Size Code Name
1 24576 62521310 29.8 GiB 8300 APP
2 2048 2303 128.0 KiB 8300 TBC
3 4096 4991 448.0 KiB 8300 RP1
4 6144 7295 576.0 KiB 8300 EBT
5 8192 8319 64.0 KiB 8300 WB0
6 10240 10623 192.0 KiB 8300 BPF
7 12288 13439 576.0 KiB 8300 TOS
8 14336 14463 64.0 KiB 8300 EKS
9 16384 17663 640.0 KiB 8300 LNX
10 18432 19327 448.0 KiB 8300 DTB
11 20480 20735 128.0 KiB 8300 RP4
12 22528 22687 80.0 KiB 8300 BMP

The only problem is that when i use etcher in windows to flash jetpack to a 32 gig sd card, it wants to mount all these partitions and cannot read them. I’ve got to cancel a bunch of dialogs asking me to format an ‘unreadable’ volume.

Hello bwana, I am facing same problem. Cannot extend partitions because maximum number of partitions are 14. How did you solve the problem? Please help.

What is solved is that I have a 29 gig partition when using the most recent jet pack image.i still have 13 other small partitions as the map above shows.i don’t know why that is

All the specific partitions and their purposes are descibed in the documentation here. It’s necessary because of how l4t boots.

I opted for a 64GB sd card without knowing this limitation, but I was able to move the 14GB partition to the unused 45GB area.

I installed only the OS image using sdkmanager and then I ‘dd’ (copy) the 14GB partition to my linux box. I took the UUID #, name (APP) and flag (msftdata) of that partition and then I erased it from the sd card. I created a new 45GB partition using the only partition number available (14) --ext4-- and ‘dd’ again the 14GB original partition back to the sd card. Then I ran a check with gparted and changed the UUID, name, flag to the original one.

System booted up with the new 45GB partition. I finally use sdkmanager again to install the remaining tools (CUDA, TensorRT, etc).

Now I have plenty of space and already installed Tensorflow, PyTorch, Keras, OpenCV in the same partition.

Just one suggestion to Nvidia… there is a lot of code out there that is not compatible with Nano, or it is really hard to know which one it is, and which one is not. Perhaps there should be a list of tested code somewhere instead of using sticky posts.

1 Like

I tried to flask image using Etcher instead of using sdk manager and somehow i the root partition was placed besides the unallocated partition.

So I just extended root and got full usage of the sd card.

Here is the guild for flask image to sd card:

However, I tried this method three times, the first two times I was not able to boot up the system.
Maybe just time few times and it can work.

Hope this would help.

hello, is a plan to fix the partition problem?

When using this image, the root partition automatically expands to the entire SD card (tested with 64GB SanDisk). It is easier to install the necessary tools into this ready-made system.
Or then pack the “.tar.gz” all the contents of the desired image (media) and unpack into this ready-made partion.

http://developer.nvidia.com/embedded/dlc/jetson-nano-dev-kit-sd-card-image

1 Like

The exact script that does it is in /etc/systemd/nvresizefs.sh on the root partition. It runs resizefs on first boot to extend the / partition to the full extents of the drive. It then self-deletes.
For convenience I am pasting a copy here.

# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#  * Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
#  * Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in the
#    documentation and/or other materials provided with the distribution.
#  * Neither the name of NVIDIA CORPORATION nor the names of its
#    contributors may be used to endorse or promote products derived
#    from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

# This is a script to resize partition and filesystem on the root partition
# This will consume all un-allocated sapce on SD card after boot.

set -e

function cleanup()
{
        # Delete nvresizefs.sh, nvresizefs.service and its symlink
        rm "/etc/systemd/nvresizefs.sh"
        rm "/etc/systemd/system/nvresizefs.service"
        rm "/etc/systemd/system/multi-user.target.wants/nvresizefs.service"
}

if [ -e "/proc/device-tree/model" ]; then
        model="$(tr -d '

Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.

Redistribution and use in source and binary forms, with or without

modification, are permitted provided that the following conditions

are met:

* Redistributions of source code must retain the above copyright

notice, this list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright

notice, this list of conditions and the following disclaimer in the

documentation and/or other materials provided with the distribution.

* Neither the name of NVIDIA CORPORATION nor the names of its

contributors may be used to endorse or promote products derived

from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS’’ AND ANY

EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE

IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR

PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR

CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,

EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,

PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR

PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY

OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT

(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE

OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

This is a script to resize partition and filesystem on the root partition

This will consume all un-allocated sapce on SD card after boot.

set -e

function cleanup()
{
# Delete nvresizefs.sh, nvresizefs.service and its symlink
rm “/etc/systemd/nvresizefs.sh”
rm “/etc/systemd/system/nvresizefs.service”
rm “/etc/systemd/system/multi-user.target.wants/nvresizefs.service”
}

if [ -e “/proc/device-tree/model” ]; then
model=“$(tr -d ‘\0’ < /proc/device-tree/model)”
fi

if [ “${model}” != “jetson-nano” ]; then
cleanup
exit 0
fi

Move backup GPT header to end of disk

sgdisk --move-second-header /dev/mmcblk0

Get root partition name i.e partition No. 1

partition_name=“$(sgdisk -i 1 /dev/mmcblk0 |
grep “Partition name” | cut -d' -f2)”

partition_type=“$(sgdisk -i 1 /dev/mmcblk0 |
grep “Partition GUID code:” | cut -d’ ’ -f4)”

partition_uuid=“$(sgdisk -i 1 /dev/mmcblk0 |
grep “Partition unique GUID:” | cut -d’ ’ -f4)”

Get start sector of the root partition

start_sector=“$(cat /sys/block/mmcblk0/mmcblk0p1/start)”

Delete and re-create the root partition

This will resize the root partition.

sgdisk -d 1 -n 1:“${start_sector}”:0 -c 1:“${partition_name}”
-t 1:“${partition_type}” -u 1:“${partition_uuid}” /dev/mmcblk0

Inform kernel and OS about change in partitin table and root

partition size

partprobe /dev/mmcblk0

Resize filesystem on root partition to consume all un-allocated

space on disk

resize2fs /dev/mmcblk0p1

Clean up

cleanup

' < /proc/device-tree/model)"
fi

if [ "${model}" != "jetson-nano" ]; then
        cleanup
        exit 0
fi

# Move backup GPT header to end of disk
sgdisk --move-second-header /dev/mmcblk0

# Get root partition name i.e partition No. 1
partition_name="$(sgdisk -i 1 /dev/mmcblk0 | \
        grep "Partition name" | cut -d -f2)"

partition_type="$(sgdisk -i 1 /dev/mmcblk0 | \
        grep "Partition GUID code:" | cut -d' ' -f4)"

partition_uuid="$(sgdisk -i 1 /dev/mmcblk0 | \
        grep "Partition unique GUID:" | cut -d' ' -f4)"

# Get start sector of the root partition
start_sector="$(cat /sys/block/mmcblk0/mmcblk0p1/start)"

# Delete and re-create the root partition
# This will resize the root partition.
sgdisk -d 1 -n 1:"${start_sector}":0 -c 1:"${partition_name}" \
        -t 1:"${partition_type}" -u 1:"${partition_uuid}" /dev/mmcblk0

# Inform kernel and OS about change in partitin table and root
# partition size
partprobe /dev/mmcblk0

# Resize filesystem on root partition to consume all un-allocated
# space on disk
resize2fs /dev/mmcblk0p1

# Clean up
cleanup

If you have installed JetPack, you can use create-jetson-nano-sd-card-image.sh found in the install path (same as flash.sh) to create a custom image that does the same thing. You make the customizations you want to rootfs, kernel etc, an then run that script to make an .img file. It runs flash.sh with the parameters to write the kernel, rootfs, etc to an image rather than a real device. I found no documentation for it other than the built in help, but the script works as expected. The steps I followed are outlined in this thread.

Hi carolyuu,

is a plan to fix the partition problem? Thanks!

Hi southcamel.

We will fix this issue at the coming release, please stay tuned.

If you follow the instruction to use Etcher tools to flash image on SD card, there should be no issue to utilize the entire SD card size, see https://developer.nvidia.com/embedded/learn/get-started-jetson-nano-devkit#write

If you have used SDK manager to flash image on Jetson Nano, you could run “create-jetson-nano-sd-card-image.sh” script to create image, then using Etcher tool to flash image on SD Card.

sudo ./create-jetson-nano-sd-card-image.sh -o sd-blob.img -s 16G -r 100
Using Etcher tool and select “sd-blob.img” image -> select SDcard -> Flash
After completed flash, plug-in SD Card to Jetson-Nano

Thanks

i gave it a try and removed the BMP partition and created my own partition instead of that with the remaining space and it booted up again.
The BMP partition is “(Optional) Contains BMP images (if any) for display during boot.” according to the documentation [url]https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%2520Linux%2520Driver%2520Package%2520Development%2520Guide%2Fpart_config.html%23wwpID0EIHA[/url]

Knödeltier,

Thanks for posting - I was trying to find out which partitions were needed, and just needed to know one optional one that I could delete and then create a new partition. Works, but not optimal solution as the main partitions are separated, so can’t extend the main partition into the new one. I bought a E-Consystems CAM30 for the Jetson Nano, but could get OpenCV on the small partition. Hopefully Nvidia will fix this in the future.

Hi Carolyuu/Kayccc,

I am also facing same problem while using the Jetpack image, the root partition automatically expands to the entire SD card (tested with 64GB SanDisk). It creates 13-14 small partitions alongwith large size(up to 45GB) as an unallocated partition.

Please help, How to use this unallocated memory by extending root?

The root partition expands on first boot to fit the whole disk (like on pi). Please do not modify the partition table manually before then. It’s not necessary to do anything to use the full disk.

The root partition does not extend. It failed 3 times in a row. This is with a 128 GB SD card.