博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
磁盘满了导致OpenStack虚拟机异常
阅读量:4229 次
发布时间:2019-05-26

本文共 1066 字,大约阅读时间需要 3 分钟。

OpenStack的磁盘已经满了。默认装centos的时候root分区很小,而home分区却很大。

之前创建的一台虚拟机连不上virsh了。OpenStack界面上不能重启了。只能删除。

virsh list也看不到了
这里写图片描述
发现虚拟机文件里面的disk和console.log文件被改成了root权限,正常的应该是qemu权限。
这里写图片描述

而且libvirt.xml文件的配置信息被清除了。这个应该是libvirt里面的机制。

libvirt里面也有autodestory这个选项

这里写图片描述

那么重新进行分区。缩小home的大小,增大root的大小

1.备份/home目录数据

2.卸载这个/home并删除这个逻辑卷home

umount /home

3.删除/dev/mapper/centos-home这个逻辑卷

lvremove /dev/mapper/centos-homeDo you really want to remove active logical volume home? [y/n]: y  Logical volume "home" successfully removed

4.新建一个卷home,fdisk格式化为8e格式,文件系统还是搞为xfs,同时分配挂载到home

lvcreate -L 50G -n home centosWARNING: xfs signature detected on /dev/centos/home at offset 0. Wipe it? [y/n]: y  Wiping xfs signature on /dev/centos/home.  Logical volume "home" created.

5.激活卷组centos,使得这个新建的home逻辑卷生效(用vgchange而不用lvchange)

vgchange -ay centos

6.在新建的逻辑卷home上建立xfs文件系统

mkfs -t xfs /dev/centos/home

7.把这个新逻辑卷home挂到之前的文件夹/home中去

mount /dev/centos/home /home/

8.最后再把释放出来多余的空间分配给root卷并xfs_growfs扩展文件系统

lvextend -L +823G /dev/centos/root

9.再次激活下卷组centos

vgchange -ay centos

10.扩展这个区

xfs_growfs /dev/mapper/centos-root
你可能感兴趣的文章
Java Concurrency in Practice
查看>>
Red Hat Fedora 5 Unleashed
查看>>
AdvancED Flash Interface Design (Advanced Design)
查看>>
Quartz Job Scheduling Framework: Building Open Source Enterprise Applications
查看>>
C++ GUI Programming with Qt 4
查看>>
Effective Use of Microsoft Enterprise Library: Building Blocks for Creating Enterprise Applications
查看>>
Java For Artists: The Art, Philosophy, And Science Of Object-Oriented Programming
查看>>
Moodle E-learning Course Development
查看>>
VoIP For Dummies
查看>>
Administrator's Guide to SQL Server 2005
查看>>
Ajax Design Patterns
查看>>
DNS and BIND (5th Edition)
查看>>
Firewall Fundamentals
查看>>
Learning PHP and MySQL
查看>>
Agile Software Construction
查看>>
Computer Security Basics
查看>>
Sams Teach Yourself MySQL in 10 Minutes
查看>>
Information Systems : The State of the Field
查看>>
IPv6 Essentials
查看>>
Microsoft Visual C++ 2005 Express Edition Programming for the Absolute Beginner
查看>>