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

可以使用命令

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).

openstack热添加磁盘的更多相关文章

  1. kvm热添加和热迁移

    a.热添加磁盘 1.创建磁盘 qemu-img create -f qcow2 web01-add01.qcow2 5G 2.附加磁盘设备 virsh attach-disk web01 /opt/w ...

  2. openstack热迁移和冷迁移

    转自: http://www.cnblogs.com/pycode/p/6494848.html 迁移类型: *非在线迁移 (有时也称之为‘迁移’).也就是在迁移到另外的计算节点时的这段时间虚拟机实例 ...

  3. Kvm--03 kvm克隆,桥接网络,热添加

    目录 1.Kvm克隆 1). 完整克隆 2). 链接克隆 2.kvm虚拟机的桥接网络 3.在线热添加网卡,cpu 1). 热添加网卡 2). 热添加内存 3). 热添加cpu参数 1.Kvm克隆 1) ...

  4. KVM热添加技术

    1.KVM热添加的种类 硬盘.网卡.内存.cpu 2.KVM热添加硬盘 1.在宿主机上创建硬盘 qemu-img create -f qcow2 /opt/web02_add01.qcow2 10G ...

  5. 在线添加磁盘,扩展LVM卷案例

    一.添加硬盘,在线扫描出来 首先到虚拟机那里添加一块硬盘,注意必须是SCSI类型的硬盘. 扫描硬盘,不用重启操作系统的. echo "- - -" > /sys/class/ ...

  6. VMware虚拟机下为Ubuntu添加磁盘

    20G的磁盘还是不够用啊,正好复习下磁盘分区和逻辑卷. 关闭虚拟机,打开VMware,右键虚拟机点击设置,点下下方的添加,就可以添加磁盘了. 进入虚拟机,查看: root@ubuntu:/# fdis ...

  7. Hadoop-HBASE 热添加新节点

    Hadoop-HBASE 热添加新节点 环境:192.168.137.101 hd1192.168.137.102 hd2192.168.137.103 hd3192.168.137.104 hd4四 ...

  8. KVM -> 虚拟机在线热添加技术_04

    热添加技术 1.KVM在线热添加硬盘

  9. LINUX下添加磁盘空间的方法详解

    给Linux系统添加磁盘空间在工作会经常遇到. 在添加第二块磁盘一般系统默认为hdb(IDE硬盘)sdb(SCSI 硬盘),以hdb为例. linux-isep:~ # fdisk /dev/hdb ...

随机推荐

  1. 我的TDD实践---TDD概念篇

    “我的TDD实践”系列之TDD概念篇 写在前面: 我的TDD实践这几篇文章主要是围绕测试驱动开发所展开的,其中涵盖了一小部分测试理论,更多的则是关注工具的使用及环境的搭建,做到简单实践先行,后理论专精 ...

  2. Linux 修改yum源

    第一种方式: wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo 第二种方式: ...

  3. mysql 之mvcc多版本控制

    MVCC是multiversion concurrency control的缩写,提供MySQL事物隔离级别下无锁读,例如一个事物在执行update等修改数据的sql,并未提交时其他事物进行数据读取是 ...

  4. 【转载】Win10打开U盘提示“文件或目录损坏无法读取”怎么办?

    以下文转载至系统之家 网址:http://www.xitongzhijia.net/xtjc/20190314/152334.html (PS:暂未亲测) Win10打开U盘提示“文件或目录损坏无法读 ...

  5. JS正则表达式验证身份证号码

    function isCardNo(card) { // 身份证号码为15位或者18位,15位时全为数字,18位前17位为数字,最后一位是校验位,可能为数字或字符X var reg = /(^\d{1 ...

  6. BTrace学习总结

    一.简介: 在生产环境中经常遇到格式各样的问题,如OOM或者莫名其妙的进程死掉.一般情况下是通过修改程序,添加打印日志:然后重新发布程序来完成.然而,这不仅麻烦,而且带来很多不可控的因素.有没有一种方 ...

  7. css中权重与继承

    出处:http://blog.csdn.net/xf616510229/article/details/53613212

  8. 利用pipeline批量插入数据到redis

    在推荐系统中,推荐候选集格式一般是,itemid itemid_list.要把itemid作为key,推荐列表作为value批量插入到redis. 比如文件cf.data为: cf_763500210 ...

  9. Package has no installation candidate解决方法

    今天在安装软件的时候出现了Package has no installation candidate的问题,如:# apt-get install <packagename>Reading ...

  10. Maven3.5.0安装与配置+Eclipse应用

    Maven是一个优秀的构建工具(类似于 Ant, 但比 Ant 更加方便使用),能帮助我们自动化构建过程,从清理.编译.测试到生成报告,再到打包和部署.只需要输入简单的命令,Maven就可以帮我们处理 ...