硬盘操作常用命令

举报
way 发表于 2019/08/14 17:51:22 2019/08/14
【摘要】 lsblk [root@ceph1 openssl-OpenSSL_1_1_1a]# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sdb 8:16 0 3.7T 0 disk |-sdb4 8:20 0 30G 0 part |-sdb2 ...
  1. lsblk

    [root@ceph1 openssl-OpenSSL_1_1_1a]# lsblk
    NAME         MAJ:MIN RM    SIZE RO TYPE MOUNTPOINT
    sdb            8:16   0    3.7T  0 disk
    |-sdb4         8:20   0     30G  0 part
    |-sdb2         8:18   0     10G  0 part
    |-sdb7         8:23   0  130.4G  0 part
    |-sdb5         8:21   0     30G  0 part
    |-sdb3         8:19   0     30G  0 part
    |-sdb1         8:17   0     10G  0 part
    `-sdb6         8:22   0  558.8G  0 part /sdb6
    loop0          7:0    0    6.9G  0 loop /mnt
    sda            8:0    0    3.7T  0 disk
    |-sda4         8:4    0 1007.5K  0 part
    |-sda2         8:2    0      1G  0 part /boot
    |-sda3         8:3    0    3.7T  0 part
    | |-cla-swap 253:1    0      4G  0 lvm  [SWAP]
    | |-cla-home 253:2    0    3.6T  0 lvm  /home
    | `-cla-root 253:0    0     50G  0 lvm  /
    `-sda1         8:1    0    200M  0 part /boot/efi

  2. dmsetup

    [root@ceph1 openssl-OpenSSL_1_1_1a]# dmsetup ls
    cla-home        (253:2)
    cla-swap        (253:1)
    cla-root        (253:0)

  3. lvm

    [root@ceph1 openssl-OpenSSL_1_1_1a]# pvs
      PV         VG  Fmt  Attr PSize  PFree
      /dev/sda3  cla lvm2 a--  <3.64t    0
    [root@ceph1 openssl-OpenSSL_1_1_1a]# vgs
      VG  #PV #LV #SN Attr   VSize  VFree
      cla   1   3   0 wz--n- <3.64t    0
    [root@ceph1 openssl-OpenSSL_1_1_1a]# lvs
      LV   VG  Attr       LSize  Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
      home cla -wi-ao----  3.58t
      root cla -wi-ao---- 50.00g
      swap cla -wi-ao----  4.00g

  4. uuidgen

    [root@ceph1 openssl-OpenSSL_1_1_1a]# uuidgen
    e72e3bbf-d00f-4d00-97fd-1ea642f19601

  5. blkid

    [root@ceph1 openssl-OpenSSL_1_1_1a]# blkid -o list
    device                                              fs_type         label            mount point                                             UUID
    ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    /dev/mapper/cla-root                                 xfs                              /                                                        a2a52403-13cf-4d72-9aaf-0f40904e1e93
    /dev/sda3                                            LVM2_member                      (in use)                                                 G2VCKX-p2AV-4qhm-iTQx-CkMb-VlQw-qjEBDR
    /dev/sda1                                            vfat                             /boot/efi                                                DF98-EE86
    /dev/sda2                                            xfs                              /boot                                                    7ad1997d-2ba9-464b-8586-b3430a010396
    /dev/sdb1                                            xfs                              (not mounted)                                            1d1e3dab-e2fe-433d-a7f5-7fc1bd756f22
    /dev/sdb2                                            xfs                              (not mounted)                                            eb0de806-8662-466c-9653-ea3be5bd22fb
    /dev/sdb3                                            xfs                              (not mounted)                                            7d9c1d46-c213-467c-8429-5e2c4a8ba63e
    /dev/sdb4                                            xfs                              (not mounted)                                            62131617-5d1a-4b66-a7b4-738391d236bd
    /dev/sdb5                                            xfs                              (not mounted)                                            711e3c21-059b-4468-b87c-18c98cbab551
    /dev/sdb6                                            xfs                              /sdb6                                                    52185ac6-8934-458d-8950-462c2b5bd858
    /dev/mapper/cla-swap                                 swap                             <swap>                                                   960c2154-ef85-4b93-85e4-a5f55451cd89
    /dev/mapper/cla-home                                 xfs                              /home                                                    316d173f-05f3-4440-aca2-cf95f70f2845
    /dev/loop0                                           iso9660         CentOS 7 aarch64 /mnt                                                     2017-09-10-13-10-43-00
    /dev/sda4                                                                             (not mounted)
    /dev/sdb7                                                                             (not mounted)

 

【版权声明】本文为华为云社区用户原创内容,转载时必须标注文章的来源(华为云社区)、文章链接、文章作者等基本信息, 否则作者和本社区有权追究责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@huaweicloud.com
  • 点赞
  • 收藏
  • 关注作者

评论(0

0/1000
抱歉,系统识别当前为高风险访问,暂不支持该操作

全部回复

上滑加载中

设置昵称

在此一键设置昵称,即可参与社区互动!

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。