• Conmi的正确答案——linux硬盘管理命令(持续更新中)


    系统:Ubuntu 22.04 Server


    命令:lsblk
    功能:列出所有可用或指定块设备的信息。默认情况下,该命令以树状格式打印所有块设备(RAM磁盘除外)。

    示例:

    $ lsblk
    loop0                       7:0    0 61.9M  1 loop /snap/core20/1405
    loop1                       7:1    0 79.9M  1 loop /snap/lxd/22923
    loop2                       7:2    0 44.7M  1 loop /snap/snapd/15534
    loop3                       7:3    0   47M  1 loop /snap/snapd/16292
    loop4                       7:4    0   62M  1 loop /snap/core20/1611
    loop5                       7:5    0  103M  1 loop /snap/lxd/23541
    sda                         8:0    0    1T  0 disk
    ├─sda1                      8:1    0    1M  0 part
    ├─sda2                      8:2    0    2G  0 part /boot
    └─sda3                      8:3    0 1022G  0 part
      └─ubuntu--vg-ubuntu--lv 253:0    0  100G  0 lvm  /
    sr0                        11:0    1 1024M  0 rom
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14

    命令:df
    作用:“df”显示包含每个文件名参数的文件系统上的可用磁盘空间量。如果没有给出文件名,则显示当前挂载的所有文件系统上的可用空间。

    学习链接:【菜鸟教程】——Linux df 命令

    示例:

    $ df -h # 一般直接这样使用
    
    • 1

    命令:fdisk
    作用:fdisk是一个对话框驱动的程序,用于创建和操作分区表。它能识别GPT、MBR、Sun、SGI和BSD的分区表。可用于增删改查分区,是运维中用的比较多的。

    学习链接:【菜鸟教程】—— Linux fdisk 命令

    示例:

    $ fdisk -l
    Disk /dev/loop0: 61.89 MiB, 64901120 bytes, 126760 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    
    
    Disk /dev/loop1: 79.95 MiB, 83832832 bytes, 163736 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    
    
    Disk /dev/loop2: 44.68 MiB, 46845952 bytes, 91496 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    
    
    Disk /dev/loop3: 46.96 MiB, 49242112 bytes, 96176 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    
    
    Disk /dev/loop4: 61.96 MiB, 64966656 bytes, 126888 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    
    
    Disk /dev/loop5: 102.98 MiB, 107986944 bytes, 210912 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    
    
    Disk /dev/sda: 1 TiB, 1099511627776 bytes, 2147483648 sectors
    Disk model: Virtual disk
    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: DF20645D-D630-4E8E-9995-65DB460E13DC
    
    Device       Start        End    Sectors  Size Type
    /dev/sda1     2048       4095       2048    1M BIOS boot
    /dev/sda2     4096    4198399    4194304    2G Linux filesystem
    /dev/sda3  4198400 2147481599 2143283200 1022G Linux filesystem
    
    
    Disk /dev/mapper/ubuntu--vg-ubuntu--lv: 100 GiB, 107374182400 bytes, 209715200 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56

  • 相关阅读:
    UVA 10050【埃筛】【set】
    【消息队列笔记】chp2-如何选择消息队列
    对一个即将上线的网站,如何做一个较完整的Web应用/网站测试?
    滤波算法_扩展卡尔曼滤波(EKF, Extended Kalman filter)_全网最详细的数学推导_Part2
    SORA 到底是什么?如何用bitget wallet购买?
    Ribbon负载均衡
    rk3399-linux_v2.8 编译报错 lb config: unrecognized option ‘--debootstrap-options‘
    esp-idf 安装(Windows )
    2012-2020中国地区银行多指标数据
    【多线程】线程池 详解
  • 原文地址:https://blog.csdn.net/fengwangzhe000/article/details/126652066