linux 磁盘

1.查看内存

[root@greymouster ~]# free -m    #以M查内容
             total       used       free     shared    buffers     cached
Mem:          1006        163        843          0      22         72
-/+ buffers/cache:         68        938
Swap:         2047          0       2047
[root@greymouster ~]# free 
             total       used       free     shared    buffers     cached
Mem:       1030492     166972     863520        248      23160      73992
-/+ buffers/cache:      69820     960672
Swap:      2097148          0    2097148
[root@greymouster ~]# 

提示:1)linux系统的特性是将系统不用的物理内存缓存起来,因此843 不是系统的真实内存

        2) 系统真正系统内存是938M

        3)buffers 为写入缓冲区,sync 将buffer缓冲区数据写入磁盘,cache 为读出缓存

查看磁盘:

[root@greymouster ~]# fdisk -l

Disk /dev/sda: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000e5001

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          26      204800   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              26         287     2097152   82  Linux swap / Solaris
Partition 2 does not end on cylinder boundary.
/dev/sda3             287        2611    18668544   83  Linux

[root@greymouster ~]# echo $((2610*255*512*63))

  21467980800


    磁盘大小=磁道数*磁头数*512字节*扇区数


           =  2610 *  255  *  512   *63

 
原文地址:https://www.cnblogs.com/chenchenphp/p/6261958.html