What's the name of the file system of the operating system in UNIX\Linux?

0

Is that correct to assume that the operating system is ALWAYS placed in /usr in all kinds of UNIX and Linux?

I'm writing a script that has to check the free space in the operating system's file system, and I want it to be generic for all kinds (RedHat, Solaris, AIX, SGI, Suse, CentOS etc...).

Thank you

user1762109

Posted 2014-01-22T06:15:51.557

Reputation: 183

3"operating system's file system"... quite unclear what you're asking. – Jonathon Reinhart – 2014-01-22T06:44:31.590

Answers

4

Unfortunately there is no generic answer to the question that you are asking.

The reason is that Linux and Unix system allow complete freedom to install parts of the operating system in one or many partitions, local or remote.

In addition to the partitioning freedom, some sysadmins routinely create symbolic links to well-known (i.e. FHS) OS directory names such as /usr/local accross partitions. So the operating system could in fact be spread over multiple file systems. This means that there isn't in fact any concept of "operating system filesystem" in the general case.

An extreme example of this would be a Ubuntu LiveCD running with a unionfs RAM disk of 60MiB. In this case there is 60MiB of free space that is available in total but only exists as long as the OS is running.

Jonathan Ben-Avraham

Posted 2014-01-22T06:15:51.557

Reputation: 936

3

The FHS might be of use, though as implementations might not adhere to it completely, you might want to double check.

You basically need to check /, /usr, /var (on most systems /bin and /sbin are in / and not mounted on separate filesystems). On SuSE desktop environments and some larger packages might end up in /opt and so you might want to check that as well.

michel-slm

Posted 2014-01-22T06:15:51.557

Reputation: 470

1

incorrect. FHS is cross-distroish. see http://unix.stackexchange.com/q/98751/29146

– strugee – 2014-01-22T06:38:03.283

2

Just use the df(1) tool on the actual path you're trying to write to:

$ df /usr/here-is-where-i-want-to-be/
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda2             70105504  13177408  56928096  19% /

hroptatyr

Posted 2014-01-22T06:15:51.557

Reputation: 516