Score:0

Question about the home and root directory relationship

yt flag

I keep seeing this graph showing up in the Ubuntu community enter image description here

which leads to my question: From the graph, it seems that /home $\subset$ /, meaning /home is stored under /. However, when I did partition during the installation, I set separate partitions for / and /home. How does the storage system work in this case? Does the /home folder have its own storage place, which is the partition /home, while the rest of the folders in the / are stored in the / partition?

Score:1
cn flag

The /home-directory resides in the /-partition. It's the content of the /home-directory which is stored on a separate partition. This partition is then mounted at /home, the /home-directory is used as mountpoint.

All the folders which are light blue coloured in your picture reside in the /-partition, although there contents may reside on a separate partition. A popular example is a boot-partition, a partition mounted at /boot, but the /boot-directory resides in the /-partition.

William Lin avatar
yt flag
So the /home-directory is only a "place holder" that resides in the /-partition and points to another partition, is that it? Does /home-partition store all the content of the ~(the ~ appears in the command line)? Are all the contents other than the ones in the /home-directory stored in the /-partition? It seems to me the partition and the file system are not the same ideas, but if we name the partition as "/" and "home", they will be automatically referred to the /-directory and /home-directory, is it correct?
mook765 avatar
cn flag
In a way, `/home` is a placeholder, like you wrote, but in fact it is a real directory. Take a look at `/etc/fstab`, in this file we define which partition to mount where. If you use a separate home-partition all it's content is stored in this partition. `~` is not `/home`, it is `/home/user`. Indeed partitions are not the same as filesystems. A partition is just defined diskspace. A partition acts as a container for a filesystem. The filesystem is what gets mounted, but in dayly life we also say the partition gets mounted.
Score:0
cn flag

Does the /home folder have its own storage place, which is the partition /home, while the rest of the folders in the / are stored in the / partition?

Yes, exactly. You can get a confirmation with the terminal command:

df -H

You might see something like:

Filesystem      Size  Used Avail Use% Mounted on
tmpfs           802M  3.8M  798M   1% /run
/dev/sda1       108G   23G   80G  22% /
tmpfs           4.1G   24M  4.0G   1% /dev/shm
tmpfs           5.3M  4.1k  5.3M   1% /run/lock
/dev/sda6       870G  654G  172G  80% /home

In this example, the / partition is on sda1 and the /home partition is sda6.

Within /home, you will have one or more user directories; for example chili so /home/chili. Within /home/chili, you can set any storage directories you want; for example, Photos, Music, Downloads, etc.

All system changes, updates, etc., automatically find and use / on, in my example, sda1, without any user intervention.

mook765 avatar
cn flag
No, the `/home`-folder always resides in the `/`-partition, no way around. It's the content of `/home` which may be stored on a different partition.
uz flag
Jos
@mook765 That is correct. Even if `/dev/sda6` is not mounted, there is still a directory `/home`, but it's empty.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.