FreeBSD中如何查看硬盘大小信息
时间:2019-11-20 08:54:00 来源:igfitidea点击:
在Linux中,如何查看所有的硬盘信息?
在FreeBSD中,如何检查硬盘的大小?
FreeBSD中,硬盘的命名约定
FreeBSD Linux中硬盘的命名约定:
- IDE硬盘名称以"ad"开头。 第一个IDE硬盘/dev/ad0,第二个/dev/ad1,依此类推。
- SATA/SSD(ATA直接访问设备驱动程序)磁盘名称以"sd"开头。 例如:/dev/sda,/dev/sdb。
- SCSI硬盘名称以
da
开头。例如/dev/da - IDE CDROM/RW/DVD名称以
acd
开头。 例如: /dev/acd0,/dev/acd1 - SCSI CDROM/RW/DVD名称以
cd
开头。 例如: /dev/cd0,/dev/cd1
在FreeBSD中查看所有硬盘和光驱设备
执行以下grep命令:
# egrep 'da[0-9]|cd[0-9]' /var/run/dmesg.boot
或者
# egrep 'ad[0-9]|cd[0-9]' /var/run/dmesg.boot
输出示例:
acd0: DVDROM at ata0-slave UDMA33 ad4: 239372MB at ata2-master SATA150 ad6: 239372MB at ata3-master SATA150 Trying to mount root from ufs:/dev/ad4s1a
geom实用程序
使用geom查看磁盘相关的详细信息:
# geom disk list # geom disk list ada5 # geom disk list ada2
输出示例:
Geom name: ada2 Providers: 1. Name: ada2 Mediasize: 64023257088 (60G) Sectorsize: 512 Stripesize: 4096 Stripeoffset: 0 Mode: r0w0e0 descr: SanDisk SD6SB1M064G1022I lunid: 5001b44e71f4a5a6 ident: 152041400742 rotationrate: 0 fwsectors: 63 fwheads: 16
atacontrol命令
在老版本的FreeBSD中,可以使用atacontrol对硬盘系统进行访问和控制。
如何列出当前分区信息?
使用以下命令:
# gpart show
输出示例:
=> 34 31277165 ada3 GPT (14G) 34 1024 1 bios-boot (512k) 1058 6 - free - (3.0k) 1064 31275184 2 freebsd-zfs (14G) 31276248 951 - free - (475k) => 34 11721045101 ada0 GPT (5.5T) 34 94 - free - (47k) 128 4194304 1 freebsd-swap (2.0G) 4194432 11716850696 2 freebsd-zfs (5.5T) 11721045128 7 - free - (3.5k) => 34 11721045101 ada1 GPT (5.5T) 34 94 - free - (47k) 128 4194304 1 freebsd-swap (2.0G) 4194432 11716850696 2 freebsd-zfs (5.5T) 11721045128 7 - free - (3.5k) => 34 11721045101 ada5 GPT (5.5T) 34 94 - free - (47k) 128 4194304 1 freebsd-swap (2.0G) 4194432 11716850696 2 freebsd-zfs (5.5T) 11721045128 7 - free - (3.5k) => 34 11721045101 ada6 GPT (5.5T) 34 94 - free - (47k) 128 4194304 1 freebsd-swap (2.0G) 4194432 11716850696 2 freebsd-zfs (5.5T) 11721045128 7 - free - (3.5k) => 34 234441581 ada4 GPT (111G) 34 94 - free - (47k) 128 234441480 1 freebsd-zfs (111G) 234441608 7 - free - (3.5k) => 34 125045357 ada2 GPT (59G) 34 94 - free - (47k) 128 125045256 1 freebsd-zfs (59G) 125045384 7 - free - (3.5k)
FreeBSD如何查看硬盘的大小
运行diskinfo命令:
diskinfo -v disk_name diskinfo -v ada4 diskinfo -v ada1
输出示例:
ada1 512 # sectorsize 6001175126016 # mediasize in bytes (5.5T) 11721045168 # mediasize in sectors 4096 # stripesize 0 # stripeoffset 11628021 # Cylinders according to firmware. 16 # Heads according to firmware. 63 # Sectors according to firmware. HGST HDN726060ALE614 # Disk descr. K1JVDUGD # Disk ident. No # TRIM/UNMAP support 7200 # Rotation rate in RPM Not_Zoned # Zone Mode
lsblk命令
安装lsblk命令:
sudo pkg install lsblk
使用lsblk命令查看硬盘信息:
lsblk ## get a list of actual disks ## sysctl kern.disks ## find info about the ada0 disk ## lsblk da0