• openstack热添加磁盘


    假定在虚拟机当中添加了磁盘,但是虚拟机没有识别出来;如何识别出来

    可以使用命令

    echo '- - -' >/sys/class/scsi_host/host0/scan

    使用后就可以识别出来了

     

     

    ###增加两块硬盘 默认是不会识别

     

    [root@compute1 ~]# fdisk -l

     

    Disk /dev/sda: 53.7 GB, 53687091200 bytes, 104857600 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 label type: dos

    Disk identifier: 0x0009fb23

     

    Device Boot Start End Blocks Id System

    /dev/sda1 2048 4196351 2097152 82 Linux swap / Solaris

    /dev/sda2 * 4196352 104857599 50330624 83 Linux

     

     

     

    #scsi是内核参数

    echo '- - -' >/sys/class/scsi_host/host0/scan

    [root@compute1 ~]# fdisk -l

     

    Disk /dev/sda: 53.7 GB, 53687091200 bytes, 104857600 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 label type: dos

    Disk identifier: 0x0009fb23

     

    Device Boot Start End Blocks Id System

    /dev/sda1 2048 4196351 2097152 82 Linux swap / Solaris

    /dev/sda2 * 4196352 104857599 50330624 83 Linux

     

    Disk /dev/sdb: 10.7 GB, 10737418240 bytes, 20971520 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/sdc: 6442 MB, 6442450944 bytes, 12582912 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

     

     

     

    #进行格式化

    mkfs.ext4 /dev/sdb

     

    #将指定目录进行挂载

    mount /dev/sdb / ceshi

    mount /dev/mapper/vgdata-lvdata1 /data1 将目录/data1 挂载到/dev/mapper/vgdata-lvdata1

     

    umount 参数

    umount /data1

    umount -lf /data1 强制卸载

    Options:

    -a, --all unmount all filesystems

    -A, --all-targets unmount all mountpoins for the given device

    in the current namespace

    -c, --no-canonicalize don't canonicalize paths

    -d, --detach-loop if mounted loop device, also free this loop device

    --fake dry run; skip the umount(2) syscall

    -f, --force force unmount (in case of an unreachable NFS system)

    -i, --internal-only don't call the umount.<type> helpers

    -n, --no-mtab don't write to /etc/mtab

    -l, --lazy detach the filesystem now, and cleanup all later

    -O, --test-opts <list> limit the set of filesystems (use with -a)

    -R, --recursive recursively unmount a target with all its children

    -r, --read-only In case unmounting fails, try to remount read-only

    -t, --types <list> limit the set of filesystem types

    -v, --verbose say what is being done

     

    -h, --help display this help and exit

    -V, --version output version information and exit

     

    For more details see umount(8).

  • 相关阅读:
    快速幂 --- CSU 1556: Jerry's trouble
    iOS masonry 不规则tagView布局 并自适应高度
    iOS 渐变色实现,渐变色圆环,圆环进度条
    iOS scrollView中嵌套多个tableView处理方案
    iOS 多网络请求同步并发
    iOS UIView添加阴影
    什么是比特币,什么是区块链,什么是挖矿,为什么要挖?关于比特币,关于区块链,你想要知道的
    Xcode wifi连接真机调试
    iOS 添加WKWebView导致控制器无法释放的问题
    解决百度网盘非会员下载速度限制的完整方案
  • 原文地址:https://www.cnblogs.com/nodchen/p/9522013.html
Copyright © 2020-2023  润新知