We have upgraded the community system as part of the upgrade a password reset is required for all users before login in.

lack of understanding, physical space vs logical space



  • I know very little about linux and I'm having a hard time understanding how the physical space and logical space map to each other. I was installing various node packages and ran out of disk space. I ran the df command and got:

    0_1577480847147_Screenshot 2019-12-27 13.06.49.png

    When investigating further, it seems that /rom is at least partially mapped to everything else. Which makes sense. However, what does not make sense to me is how this maps to my file system and how adding an SD card is going to help. Mounting the sd card at /mnt will give me lots of space under /mnt but I do not know how to make that give me enough space across the file system mapped to ..

    0_1577481031385_Screenshot 2019-12-27 13.10.01.png

    What is also confusing me is that, as I've been installing rpm modules under /root/...., and it seems (from what I can tell) that is not under /dev/root, why am I even running out of space?

    I tried reading this up on the web and simply got confused. Is there a guide someone can point me to that will explain how, once I've added my SD card I use it properly?



  • Hey @davidsi,

    From one novice to the next, My understanding is that the Filesystem column represents the physical storage location/partition/disk/etc. The "Mounted on" column represents the path for accessing it, i.e. what you would type into the change directory (cd) command.

    To expand a little further, The Onion has three areas of storage lets call them Read Only Memory (ROM), Random Access Memory (RAM) and Flash .

    ROM is fixed and is not changed during runtime. This is initially populated when you "flash/upgrade" to a built image. This contains your default filesystem, i.e. if you navigate to:

    root@Omega:# cd /rom/ 
    root@Omega:/rom# ls
    bin      dev      etc      lib      mnt      overlay  proc     rom      root     sbin     sys      tmp      usr      var      www
    

    you will see all the typical linux directories that make up your system. ROM being "read only" will always be 100% used.

    RAM is easily spotted by having Filesystem, tmpfs, as it is exactly this "temporary" this memory location is where applications load into before and during execution. You can even write your own temp files in here during your program lifecycle with the understanding that all this space WILL be cleared on restart. typically linux has RAM on either paths /tmp/ or /dev/shm/

    Lastly we have Flash (I think generally referred to as Non Volatile RAM or NVRAM) This storage area is where you can install programs, create files etc as normal and where you will still see the files after a power cycle/reboot etc. On the Onion this is classified as the overlayfs (fs standing for file system). as you can see it is for all directories Mounted on "/"

    To go a little more into "Mounted on", it should be read that all directories starting from "/" (root directory) are in Flash. EXCEPT if specified otherwise. i.e. "/dev/..." also technically falls under "/" but because it has its own definition we understand it is RAM. likewise for "/rom/...".

    From this you can understand that your users home directory which is "/root/..." is located on the "/" "Mounted on" because this is the one path that matches closest.

    When you add an SD card it will create a new Filesystem that you can mount somewhere. like typically "/mnt/SDcard/..." where you will now have access to all the space of the SD card. As you stated, this will not magically give you any more space on the /root/... directory.

    However... If you know the folder that the path where the node packages are being installed to like maybe it is /root/node/... then you can mount the full/portion of the SD to /root/node/ and thus all files stored in /root/node/... will be stored on the SD. it goes without saying that removing the SD will mean that the files disappear and /root/node will once again fall under the "/" filesystem.

    *I stand to be corrected, and welcome any deeper insights especially into the link between /dev/mtdblock and overlay.

    Cheers,
    UFD



  • @UFD thanks!



  • @UFD just realized, that still doesn't explain my lack of space. ROM is ROM and obviously at 100% but shouldn't mntblock and overlay still be usable? Or is it just overlay and that is nearly full?



  • @davidsi
    For all intent and purposes Filesystems "/dev/mtdblock6" and "overlayfs:/overlay" are the same.

    Your Onion main flash (NVRAM) storage is linked to this overlay filesystem. This is at 99% used according to your image and thus you are out of space.

    Im not exactly sure what is /dev/mtdblock7 but even though it is only 38% used it is also only 512KB big. So the system would only have access to 316KB on that Filesystem which is not really useful for anything.

    Hope that clears it up.



  • @UFD thank you



  • @davidsi said in lack of understanding, physical space vs logical space:

    Mounting the sd card at /mnt will give me lots of space under /mnt but I do not know how to make that give me enough space across the file system mapped to

    You need to setup extroot, so that you can install more software.
    Official guide here: https://openwrt.org/docs/guide-user/additional-software/extroot_configuration



  • @yoursunny AH!, the missing link :-). Thank you both. I bought the onion to learn and this is really helping


Log in to reply
 

Looks like your connection to Community was lost, please wait while we try to reconnect.