Linux下的硬盘信息查看


1.fdisk -l 查看硬盘

/dev/hd0 -----------IDE设备老式硬盘,并口硬盘
sda 串口硬盘  sata
 s  串口d硬盘 a第一块
/dev/sro  /dev/cdrom 光驱
/dev/mapper  虚拟设备
blkid  识别系统可以用的设备
blkid<=cat/proc/partitions <=fdisk -l
  小于等于


df -h   查看设备大小以2n计数,结果更加准确。1G=1024M

df -H  查看设备大小 10n计数,查询结果d大于 “df -h”所查询的.1G=1000M


[

root@foundation42 ~]# blkid 
/dev/sda1: UUID="c0764391-f54b-49d1-a60a-9f85cb90bbbd" TYPE="xfs"
/dev/sda2: UUID="32975f91-edb0-4ce4-a234-1286dd2b52d0" TYPE="swap"
/dev/sda3: UUID="804af6c8-6aae-42c6-bd7e-57f6d1946aae" TYPE="xfs"
/dev/loop0: UUID="2014-05-07-03-58-46-00" LABEL="RHEL-7.0 Server.x86_64" TYPE="iso9660" PTTYPE="dos"
/dev/loop1: UUID="2015-10-30-11-11-49-00" LABEL="RHEL-7.2 Server.x86_64" TYPE="iso9660" PTTYPE="dos"
/dev/sdb1: UUID="44ED-5693" TYPE="vfat"
[root@foundation42 ~]# fuser -vm /dev/sdb1
                     USER        PID ACCESS COMMAND
/dev/sdb1:           root     kernel mount /run/media/kiosk/44ED-5693


2.设备的挂载

[root@foundation42 ~]# umount /dev/sdb1 
umount: /mnt: target is busy.
        (In some cases useful info about processes that use
         the device is found by lsof(8) or fuser(1))
[root@foundation42 ~]# fuser -kvm /dev/sdb1
                     USER        PID ACCESS COMMAND
/dev/sdb1:           root     kernel mount /mnt
                     kiosk     30926 ..c.. bash
[root@foundation42 ~]# ls /mnt
??     homework                        unit12
????   picture                         unit13
?????  rhel-server-7.0-x86_64-dvd.iso  unit14
4.21   rhel-server-7.2-x86_64-dvd.iso  unit15
422    System Volume Information
[root@foundation42 ~]# umount /dev/sdb1
[root@foundation42 ~]# ls /mnt
test


umount /dev/sdb1  解除挂载
mount /dev/sdb1   挂载


你可能感兴趣的:(学习日志)