Monday, April 29, 2024
 Popular · Latest · Hot · Upcoming
0
rated 0 times [  0] [ 0]  / answers: 1 / hits: 2381  / 2 Years ago, mon, june 6, 2022, 3:58:06

How can the root directory be at 100 percent disc usage while its subdirectories not be? Is space allocated on a per directory basis? In the below example, it shows that the root is 100 percent used. Does this mean if I try to add content to one of the nonroot directories, it should work but if I try to add to the root, it won't work? I was expecting that 100 percent usage would be the total of ALL the directories added up, but as the example below shows, that's not the case:



$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/eubuntu10x32-root
3.5G 3.3G 0 100% /
none 1.5G 180K 1.5G 1% /dev
none 1.5G 0 1.5G 0% /dev/shm
none 1.5G 40K 1.5G 1% /var/run
none 1.5G 0 1.5G 0% /var/lock
none 1.5G 0 1.5G 0% /lib/init/rw
none 3.5G 3.3G 0 100% /var/lib/ureadahead/debugfs
/dev/sdb 50G 27G 21G 57% /home
/dev/sda1 228M 35M 181M 17% /boot


Thanks for some explanation of disc usage on filesystem.


More From » filesystem

 Answers
1

File systems and mount points



You're missing out on a very important way Ubuntu/Linux handles file systems: all comes down to the same root (/) and other file systems ("volumes", "disks", "partitions") will be mounted on a location inside the root.



To explain two most interesting lines:




  • Your / is full:



    /dev/mapper/eubuntu10x32-root   3.5G  3.3G     0 100% /


    Here you see a "device mapper" meta-device being used for your root filesystem. I think you're using LVM here or encryption.



    3.5GiB for a / is a very low capacity for a desktop installation, unless you have directories like /usr, /var moved out of it. In your case it's clearly not sufficient.


  • Your second disk (sdb, without partitions) is mounted at /home and a partition of sda is mounted as /boot:



    /dev/sdb               50G   27G   21G  57% /home
    /dev/sda1 228M 35M 181M 17% /boot


    This separated /boot is common for a LVM/encrypted installation to allow the bootloader (Grub) to load the relevant software/drivers to be able to reach your other file systems to actually boot the operating system.




So, basically, your /home and /boot aren't just directories. They are directories on the / file system, but there's another file system mounted on top of it. This means that whenever you descend into it, you're looking into a different file system. Each file system has its own capacity, listed by df.



While you moved out /home and /boot, this wasn't enough to have sufficient space available on /. Solutions: grow the / file system, move out more like /usr or /var to another file system.



Are all directories under / mount points?



Directories not being a mount point are actual regular directories part of file system in mounted as /. There are also special ones, which don't actually represent data on disks, but in UNIX/Linux, everything is represented as files such as sockets, kernel interfaces (/proc, /sys), etc. and even directories itself are files.



How does this compare to Windows?



Windows tends to hide the difference between the devices/partitions and the actual file system being mounted. This means that a C: "drive" can also be mounted as such. In Ubuntu/Linux, you'll see that a partition, e.g. /dev/sda1 (first partition on sda) can be mounted (content being made available to the user) to any location. There's no second root for this like Windows makes the second drive a D:.


[#32814] Monday, June 6, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
terose

Total Points: 185
Total Questions: 125
Total Answers: 131

Location: Venezuela
Member since Mon, Dec 13, 2021
2 Years ago
terose questions
;