美文网首页
CentOS新加磁盘fdisk看不到解决

CentOS新加磁盘fdisk看不到解决

作者: Saxon_323e | 来源:发表于2021-05-09 18:46 被阅读0次

    测试环境硬盘不够用了,做了lvm新插了块硬盘扩容,结果在系统里 fdisk -l 却看不到新加的硬盘,又不想重启怎么办?

    [root@owner-node1:~]# fdisk -l
    
    Disk /dev/sda: 536.9 GB, 536870912000 bytes
    255 heads, 63 sectors/track, 65270 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x000387ab
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1   *           1          26      204800   83  Linux
    Partition 1 does not end on cylinder boundary.
    /dev/sda2              26        1046     8192000   82  Linux swap / Solaris
    /dev/sda3            1046       65271   515890176   83  Linux
    

    一条命令就可以搞定:

    # 注意“- - -”中间有空格
    [root@owner-node1:~]# echo "- - -" >  /sys/class/scsi_host/host0/scan
    [root@owner-node1:~]# echo "- - -" >  /sys/class/scsi_host/host1/scan
    [root@owner-node1:~]# echo "- - -" >  /sys/class/scsi_host/host2/scan
    [root@owner-node1:~]# echo "- - -" >  /sys/class/scsi_host/host3/scan
    [root@owner-node1:~]# echo "- - -" >  /sys/class/scsi_host/host4/scan
    [root@owner-node1:~]# echo "- - -" >  /sys/class/scsi_host/host5/scan
    [root@owner-node1:~]# echo "- - -" >  /sys/class/scsi_host/host6/scan
    

    再用 fdisk -l 就看到了

    [root@owner-node1:~]# fdisk -l
    
    Disk /dev/sda: 536.9 GB, 536870912000 bytes
    255 heads, 63 sectors/track, 65270 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x000387ab
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1   *           1          26      204800   83  Linux
    Partition 1 does not end on cylinder boundary.
    /dev/sda2              26        1046     8192000   82  Linux swap / Solaris
    /dev/sda3            1046       65271   515890176   83  Linux
    
    Disk /dev/sdb: 214.7 GB, 214748364800 bytes
    255 heads, 63 sectors/track, 26108 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x00000000
    

    其中是host0还是host1…,跟新插入的硬盘口有关系,不清楚就逐个试一遍好了

    相关文章

      网友评论

          本文标题:CentOS新加磁盘fdisk看不到解决

          本文链接:https://www.haomeiwen.com/subject/vclvdltx.html