/usr/local mounted to SD card, but emmc memory shows that it is still full

This is a very odd specific problem. I tried installing CUDA but I ran out of memory, so I started looking at the folders that CUDA used the most, and then mounted 20GB each SD card partitions to those folders. The folders are /usr/local and /usr/lib. It would break the system if I did the whole /usr/ folder. The issue I’m having now is that CUDA was allowed to finish installing over ethernet, but the system still shows that it’s full, even though those folder now have 20Gb each on an SD Card. It’s almost as if the system thinks there is no more space because it’s including the used storage of the SD card in its calculation; which is preventing me from installing AI models and images.

Btw, it can be dangerous to move “/usr/lib” to SD card. From that point on, if the original content is missing, and the SD card id not plugged in, the system will fail.

Whenever you mount on a mount point that already has content the original content still remains. That content is merely hidden until umount. One example of doing this for /usr/local (which you cannot do with /usr/lib) is to temporarily mount somewhere like /mnt, and then actually move the “/usr/local/...whatever content is there...” to the /mnt location; from that point on, the /mnt will contain /mnt/local/...whatever content was there.... Then you can remount this from /mnt to instead go to /usr/local. The point is you have to remove old content if you want the partition to not have that content since mount only hides original content.

There are ways to use the SD card as the rootfs (“/”), but that would be a topic for another post.

Hi,
Since eMMC is insufficient for the packages, please have external storage and try to mount the paths:

// mount NVMe SSD storage
$ sudo mount /dev/nvme0n1p1 /mnt
// mount the paths
$ sudo ln -sf /mnt/usr/local/cuda-10.2 /usr/local/cuda-10.2
$ sudo ln -sf /usr/local/cuda-10.2 /usr/local/cuda
$ sudo ln -sf /mnt/usr/src/tensorrt /usr/src/tensorrt

And then install CUDA/TensorRT.

And not sure which Jetpack version you are using. The latest release for Tx2 is Jetpack 4.6.6:

Jetson Linux R32.7.6 | NVIDIA Developer

If you are using previous version, would suggest upgrade.

That’s very interesting… I’ll try that this week and let you know what happens.

Yeah for sure, that’s what I did. When I do a fresh install I have plenty of space left on the drive. The contents of those folders I leave there if there’s a malfucntion with the SD card, at least it will revert to a useable state; minus CUDA installation.

The problem I have though is that the folder I mounted to the SD card still seems like it’s still counting towards the used space on the emmc. I’m gonna try what DaneLLL said because there might be more stuff installing in those other folders I’m not recognizing.

A big danger of an SD card on “/usr/lib”, even if you keep the old content, is that this location gets a lot of updates. The database lives in “/var”, and you could end up with inconsistent package states and problems with library releases not being what is expected.

Yes, what @DaneLLL said is safe and is recommended. Note that anything on “/usr/local” is never used for boot, and is not normally a problem for the package database. It also happens to be that you can have multiple versions of CUDA, and the sym link from a versioned CUDA local directory to a generic “/usr/local/cuda” is the intended method of picking a default. If the content goes missing, then you can’t do things like compile new CUDA software, but it can be made whole just with those simple symbolic links.

If you are going to do this long term, then I might pick some new mount point other than /mnt, but /mnt is the normal location for temporary use. I might do something like:

sudo mkdir /cuda
sudo mount /dev/nvme0n1p1 /cuda
...continue on, but naming the /cuda prefix...

(and then mount there; but only if this is going to persist and not be temporary)