帮助文档
openailab@openailab-System-Product-Name:~/oaldata$ df --help
Usage: df [OPTION]... [FILE]...
Show information about the file system on which each FILE resides,
or all file systems by default.
Mandatory arguments to long options are mandatory for short options too.
-a, --all include pseudo, duplicate, inaccessible file systems
-B, --block-size=SIZE scale sizes by SIZE before printing them; e.g.,
'-BM' prints sizes in units of 1,048,576 bytes;
see SIZE format below
-h, --human-readable print sizes in powers of 1024 (e.g., 1023M)
-H, --si print sizes in powers of 1000 (e.g., 1.1G)
-i, --inodes list inode information instead of block usage
-k like --block-size=1K
-l, --local limit listing to local file systems
--no-sync do not invoke sync before getting usage info (default)
--output[=FIELD_LIST] use the output format defined by FIELD_LIST,
or print all fields if FIELD_LIST is omitted.
-P, --portability use the POSIX output format
--sync invoke sync before getting usage info
--total elide all entries insignificant to available space,
and produce a grand total
-t, --type=TYPE limit listing to file systems of type TYPE
-T, --print-type print file system type
-x, --exclude-type=TYPE limit listing to file systems not of type TYPE
-v (ignored)
--help display this help and exit
--version output version information and exit
Display values are in units of the first available SIZE from --block-size,
and the DF_BLOCK_SIZE, BLOCK_SIZE and BLOCKSIZE environment variables.
Otherwise, units default to 1024 bytes (or 512 if POSIXLY_CORRECT is set).
The SIZE argument is an integer and optional unit (example: 10K is 10*1024).
Units are K,M,G,T,P,E,Z,Y (powers of 1024) or KB,MB,... (powers of 1000).
FIELD_LIST is a comma-separated list of columns to be included. Valid
field names are: 'source', 'fstype', 'itotal', 'iused', 'iavail', 'ipcent',
'size', 'used', 'avail', 'pcent', 'file' and 'target' (see info page).
GNU coreutils online help: <http://www.gnu.org/software/coreutils/>
Full documentation at: <http://www.gnu.org/software/coreutils/df>
or available locally via: info '(coreutils) df invocation'
有个疑惑
如图,我的Linux系统,有1T固态硬盘和3.6T机械硬盘,我想知道“/home/openailab/oaldata/datasets”路径使用哪个磁盘进行存储。我该怎么做?
Linux文件存储在哪里?
一个想法
从挂载情况来看,根目录挂载在固态硬盘上,也就是所有路径的起点 “/”。如果这样的话,目测路径“/home/openailab/oaldata/datasets”的存储,使用的就是固态硬盘。
一个实践
为了验证这个想法,我们往这个路径下存东西,先存他一个T。
结果没到1个T,固态硬盘就满了。这也就验证了我的想法,该路径使用的是固态硬盘存储。
两个需求
1、我该如何判断该路径使用的是哪个磁盘?
通过帮助文档,df命令带了一个参数file:df [OPTION]… [FILE]…
所以,可以把这个file加上,来查看挂载目录:
df -h /home/openailab/oaldata
2、我想让该路径使用机械硬盘,我该如何做?
因为这个路径下面已经存有东西,如果直接挂载的话,将会导致该目录下的文件直接丢失。因此,我们需要进行备份,请看我下一篇博客:mount命令。
阅读全文