如何在Linux中列出磁盘的所有分区?

Operating systems use storage or disks to save data persistently. Disks are used with partitions to manage them easily. Generally operating system and data partitions are placed separately. Home directory of the Linux is separated because a problem in the home directory like fulling do no effect to the general system. Modern Linux system use a lot of partitions. And here is the question How can I list partitions exists in my Linux system.

操作系统使用存储或磁盘来持久保存数据。 磁盘与分区一起使用可轻松管理它们。 通常,操作系统和数据分区是分开放置的。 Linux的主目录是分开的,因为主目录中的问题(例如填满)不会影响整个系统。 现代Linux系统使用很多分区。 这是一个问题:如何列出Linux系统中存在的分区。

使用fdisk列出分区 (List Partitions With fdisk)

fdisk is number one tool used by system administrators to manage disk. fdisk provides creating, deleting, listing of partitions. We need to use  sudo in order to get root privileges.

fdisk是系统管理员用来管理磁盘的第一工具。 fdisk提供创建,删除,列出分区的信息。 我们需要使用sudo以获得root特权。

$ sudo fdisk -l
List Partitions With fdisk
List Partitions With fdisk
使用fdisk列出分区
  • There is a lot of information from system administrator perspective.

    从系统管理员的角度来看,有很多信息。
  • /dec/vda is disk to list partitions

    / dec / vda是列出分区的磁盘

  • /dev/vda1 is the partition of the disk

    / dev / vda1是磁盘的分区

列出具有/ proc / partitions的分区(List Partitions with /proc/partitions)

We can get more simpler list by using kernel provided information like below

我们可以通过使用内核提供的信息来获得更简单的列表,如下所示

$ cat /proc/partitions
List Partitions with /proc/partitions
List Partitions with /proc/partitions
列出具有/ proc / partitions的分区
  • /proc/partitions provides information about partitions in a simple manner

    / proc / partitions以简单的方式提供有关分区的信息

  • vda1 is a partition

    vda1是一个分区

列出分区的分区(List Partitions with parted)

Parted is popular application especially creating, deleting partitions and file systems. We can use parted to list partitions too. We will also  use -l option in order to list partitions.

Parted是流行的应用程序,尤其是创建,删除分区和文件系统。 我们也可以使用parted列出分区。 我们还将使用-l选项来列出分区。

$ parted -l
List Partitions with parted
List Partitions with parted
列出分区的分区

Disk information like Model, Sector Size and Partition Table type is also provided.

还提供了磁盘信息,例如型号,扇区大小和分区表类型。

列出具有blkid的分区 (List Partitions with blkid)

blkid is a command which will list block information with the related ID or UUID. This will also print partitions too. We need to provide sudo command too.

blkid是将列出具有相关ID或UUID的块信息的命令。 这也将打印分区。 我们也需要提供sudo命令。

$ blkid
List Partitions with blkid
List Partitions with blkid
列出具有blkid的分区

列出具有lsblk的分区(List Partitions with lsblk)

lsblk is generally used to get mount points of the partitions but also used to list partitions. This command will list partitions and disk in a tree form.

lsblk通常用于获取分区的安装点,但也用于列出分区。 该命令将以树形形式列出分区和磁盘。

$lsblk
List Partitions with lsblk
List Partitions with lsblk
列出具有lsblk的分区

As we can see that fedora-root and fedora-swap are partitions created in the sda. There is also information like partition and disk size, type and mount point.

如我们所见, fedora-rootfedora-swap是在sda创建的分区。 还有诸如分区和磁盘大小,类型和安装点之类的信息。

LEARN MORE  Overview Of Linux File Systems Like Ext3, Btrfs, Zfs
了解更多Linux文件系统概述,例如Ext3,Btrfs,Zfs

如何在Linux中列出磁盘的所有分区? 信息移植 (How To List All Partitions Of A Disk In Linux? Infografic)

How To List All Partitions Of A Disk In Linux? Infografic
How To List All Partitions Of A Disk In Linux? Infografic
如何在Linux中列出磁盘的所有分区? 信息移植

翻译自: https://www.poftut.com/list-partitions-disk-linux/

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值