0

I have ubuntu 5.10.65-tegra on Jetson Xavier where I am running out of space in the root / folder. The output of df -h is

Filesystem      Size  Used Avail Use% Mounted on
/dev/mmcblk0p1   28G   26G  339M  99% /
none             16G     0   16G   0% /dev
tmpfs            16G   36K   16G   1% /dev/shm
tmpfs           3.1G   19M  3.1G   1% /run
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs            16G     0   16G   0% /sys/fs/cgroup
tmpfs           3.1G   20K  3.1G   1% /run/user/124
tmpfs           3.1G   64K  3.1G   1% /run/user/1000

Therefore, for some installations, I started using the /dev folder

Two questions -

  1. I understand that the 'none' Filesystem mounted on /dev is some sort of virtual space and not mapped to any space on the hard disk. Therefore, on reboot or shutdown, this will be wiped clean. But could it also be possible that it can be erased when the system runs out of RAM or swap space? It seems to be the case, since even without the system rebooting, the space was wiped clean when compiling something heavy and I had to re-install a lot of stuff

  2. To install something in /dev, I have to constantly use sudo. Is it possible to mount the 'none' to some folder in the /home directory as -

mkdir /home/install
sudo mount none /home/install

Will the size of this now be 16 gb as well?

1
  • There is nothing like a none filesystem. This is just to explain that /dev has no file system. It's reserved for device drivers like your (e)MMC driver (which creates the /dev/mmcblk0 "file". You can access is with the same tools like you would access a file. But /dev is not a secret place to store something. Doesn't the board have some MicroSD card socket or free USB host for plugging a USB stick? This you could indeed mount and use it for your purpose.
    – Philippos
    Commented Jul 7, 2022 at 11:21

1 Answer 1

1

/dev is a special directory with files that represent block and character devices in your system and some other special files. These are created either by kernel or by special system demons like udev. Normally you don't want to write anything to it and it's definitely not a good idea to use it as "extra storage". /dev and the other tmpfs filesystems you see in the df output are all mapped to RAM and they share it so you don't really have 16 GB space in /dev.

If you can't make more space in your / by removing something and don't have an option to connect a bigger or second SD card and somehow have a lot of free RAM, I'd recommend moving your /tmp to tmpfs and use that (that can be configured in fstab if you don't have systemd) but you can also simply mount any directory as tmpfs and make a temporary RAM disk that way:

sudo mount -t tmpfs -o size=2g tmpfs /mnt/tmp

If you use this you get a temporary 2 GiB device in /mnt/tmp that will use RAM.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .