本文主要是介绍Linux 查看硬盘类型,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
Linux 查看硬盘类型
root@user-PC:~# lsblk -d -o name,rota
NAME ROTA
loop0 1
sda 1
sdb 1
sdc 1
sdd 0
sde 1
sdi 1
sdj 1
sdk 1
sdl 1
sr0 1
sr1 1
# 返回0:SSD盘 返回1:SATA盘
root@user-PC:~# lsscsi # 查看SCSI控制器设备的信息
[0:0:0:0] disk ATA ST2000NM0008-2F3 SN02 /dev/sda
[1:0:0:0] disk ATA ST2000NM0008-2F3 SN02 /dev/sdb
[2:0:0:0] disk ATA ST2000NM0008-2F3 SN02 /dev/sdc
[3:0:0:0] disk ATA TS512GSSD452K S7JA /dev/sdd
[5:0:0:0] cd/dvd Slimtype DVD A DS8ACSH LC2M /dev/sr0
[6:0:0:0] disk ATA ST2000NM0008-2F3 SN02 /dev/sde
[7:0:0:0] cd/dvd AMI Virtual CDROM0 1.00 /dev/sr1
[8:0:0:0] disk AMI Virtual Floppy0 1.00 /dev/sdf
[9:0:0:0] disk AMI Virtual HDisk0 1.00 /dev/sdg
[9:0:0:1] disk AMI Virtual HDisk1 1.00 /dev/sdh
[10:0:0:0] disk TOYOU Disk-Array 3123 /dev/sdi
[10:0:1:0] disk TOYOU Disk-Array 3123 /dev/sdj
[11:0:0:0] disk TOYOU Disk-Array 3123 /dev/sdk
[11:0:1:0] disk TOYOU Disk-Array 3123 /dev/sdl
root@user-PC:~# fdisk -l /dev/sdd
Disk /dev/sdd: 477 GiB, 512110190592 bytes, 1000215216 sectors
Disk model: TS512GSSD452K
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: D085E238-459F-4F36-9022-1FE98F8BC83F
Device Start End Sectors Size Type
/dev/sdd1 2048 616447 614400 300M EFI System
/dev/sdd2 616448 3762175 3145728 1.5G Linux filesystem
/dev/sdd3 3762176 203804671 200042496 95.4G Linux filesystem
/dev/sdd4 203804672 905842687 702038016 334.8G Linux filesystem
/dev/sdd5 905842688 966660095 60817408 29G Linux filesystem
/dev/sdd6 966660096 1000214527 33554432 16G Linux swap
root@user-PC:~# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
loop0 7:0 0 547.7M 0 loop /kbdata/test
sda 8:0 0 1.8T 0 disk
sdb 8:16 0 1.8T 0 disk
sdc 8:32 0 1.8T 0 disk
sdd 8:48 1 477G 0 disk
├─sdd1 8:49 1 300M 0 part /boot/efi
├─sdd2 8:50 1 1.5G 0 part /boot
├─sdd3 8:51 1 95.4G 0 part /
├─sdd4 8:52 1 334.8G 0 part /data
├─sdd5 8:53 1 29G 0 part /recovery
└─sdd6 8:54 1 16G 0 part [SWAP]
sde 8:64 1 1.8T 0 disk
sdi 8:128 0 4T 0 disk
└─mpatha 253:0 0 4T 0 mpath /kbdata
sdj 8:144 0 4T 0 disk
└─mpatha 253:0 0 4T 0 mpath /kbdata
sdk 8:160 0 4T 0 disk
└─mpatha 253:0 0 4T 0 mpath /kbdata
sdl 8:176 0 4T 0 disk
└─mpatha 253:0 0 4T 0 mpath /kbdata
sr0 11:0 1 5.6G 0 rom
sr1 11:1 1 1024M 0 rom
root@user-PC:~# df -h
文件系统 容量 已用 可用 已用% 挂载点
udev 32G 0 32G 0% /dev
tmpfs 6.4G 6.1M 6.4G 1% /run
/dev/sdd3 94G 7.2G 82G 9% /
tmpfs 32G 46M 32G 1% /dev/shm
tmpfs 5.0M 16K 5.0M 1% /run/lock
tmpfs 32G 0 32G 0% /sys/fs/cgroup
/dev/sdd2 1.5G 49M 1.4G 4% /boot
/dev/sdd4 329G 29G 284G 10% /data
/dev/sdd5 29G 8.1G 19G 30% /recovery
/dev/sdd1 300M 6.5M 293M 3% /boot/efi
/dev/mapper/mpatha 4.0T 94G 4.0T 3% /kbdata
tmpfs 6.4G 128K 6.4G 1% /run/user/1001
tmpfs 6.4G 160K 6.4G 1% /run/user/0
/dev/loop0 548M 548M 0 100% /kbdata/test
这篇关于Linux 查看硬盘类型的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!