Easy way to free up Jetson Nano SD card disk space by 40%

The NVIDIA® Jetson Nano Developer Kit is a great way to get started with AI. It is a small, powerful computer that lets you run multiple neural networks in parallel for applications like image classification, object detection, segmentation, and speech processing. All in an easy-to-use platform that runs in as little as 5 watts.

Last week, I wanted to run NVIDIA DeepStream software in a Docker container on top of Jetson Nano. To my surprise, I found that the only SD card available was 16GB in size. Then I realized that I hardly got 291 MB space left on my device.

 df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/mmcblk0p1   15G   14G  291M  98% /
none            947M     0  947M   0% /dev
tmpfs           986M   40K  986M   1% /dev/shm
tmpfs           986M   44M  943M   5% /run
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           986M     0  986M   0% /sys/fs/cgroup
tmpfs           198M   20K  198M   1% /run/user/1000
 

Luckily, I was able to solve this problem. Here’s what I followed to free up some disk space in NVIDIA Jetson Nano.

Step 1. Update the existing repo

sudo apt update
 

Step 2. Remove unnecessary packages

sudo apt autoremove -y
 

Step 3. Clean up your repo

sudo apt clean
 

Step 4. Remove Libreoffice related packages

sudo apt remove thunderbird libreoffice-* -y
 

Step 5. Remove samples

 

sudo rm -rf /usr/local/cuda/samples \
/usr/src/cudnn_samples_* \
/usr/src/tensorrt/data \
/usr/src/tensorrt/samples \
/usr/share/visionworks* ~/VisionWorks-SFM*Samples \
/opt/nvidia/deepstream/deepstream*/samples

Step 6. Remove local repos

sudo apt purge cuda-repo-l4t-local libvisionworks-repo -y
sudo rm /etc/apt/sources.list.d/cuda*local
 /etc/apt/sources.list.d/visionworks*repo*
sudo rm -rf /usr/src/linux-headers-*

Step 7. Remove GUI

sudo apt-get purge gnome-shell ubuntu-wallpapers-bionic light-themes chromium-browser* libvisionworks libvisionworks-sfm-dev -y
sudo apt-get autoremove -y
sudo apt clean -y

Step 8. Remove static libs

sudo rm -rf /usr/local/cuda/targets/aarch64-linux/lib/.a \
/usr/lib/aarch64-linux-gnu/libcudnn
.a \
/usr/lib/aarch64-linux-gnu/libnvcaffe_parser*.a \
/usr/lib/aarch64-linux-gnu/libnvinfer*.a \
/usr/lib/aarch64-linux-gnu/libnvonnxparser*.a \
/usr/lib/aarch64-linux-gnu/libnvparsers*.a

Woah! I was able to install NVIDIA DeepStream 6.0 on my 16GB SD card.

3

Leave a Reply to Anonymous Cancel reply

Your email address will not be published. Required fields are marked *