<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>系统运维 &#187; LVM</title>
	<atom:link href="http://www.osyunwei.com/archives/tag/lvm/feed" rel="self" type="application/rss+xml" />
	<link>https://www.osyunwei.com</link>
	<description>国产化OS/AnolisOS/openEuler/RHEL/CentOS/Rocky Linux/Debian/Ubuntu Linux FreeBSD 服务器教程 &#124; Windows Server 2003/2008/2012/2016/2019/2022/2025服务器教程</description>
	<lastBuildDate>Wed, 01 Apr 2026 08:27:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>使用xfsdump缩小XFS文件系统的LVM磁盘分区</title>
		<link>https://www.osyunwei.com/archives/14150.html</link>
		<comments>https://www.osyunwei.com/archives/14150.html#comments</comments>
		<pubDate>Wed, 10 Jan 2024 14:40:45 +0000</pubDate>
		<dc:creator>qihang01</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[LVM]]></category>

		<guid isPermaLink="false">https://www.osyunwei.com/?p=14150</guid>
		<description><![CDATA[说明：XFS格式的LVM磁盘分区默认只能扩大不能缩小，需要利用xfsdump/xfsrestore备份恢复的方法缩小LVM分区 目前的环境： 1、根/分区10GB 2、/home分区40GB，实际使用空间不到1GB 分区都是都是使用XFS文件系统挂载的LVM分区 需求：把/home分区缩小到10GB，把空余出来的磁盘空间全部扩容到根分区/ 具体操作： 1、查看磁盘以及LVM信息 #查看分区信息 df -Th #查看磁盘信息 fdisk -l #查看LVM lvdisplay #查看卷组信息 sudo vgs 2、安装LVM分区备份工具xfsdump yum -y install xfsdump 3、备份/home分区的数据 #xfsdump -f "备份文件存放的绝对路径加备份文件名" "需要缩容的目录" xfsdump -f /opt/home.bak /home  #根据提示输入enter回车进行备份 注意： （1）/opt是目录，home.bak是文件名，不是文件夹 （2）要确保备份目录/opt的剩余容量比/home实际使用的容量要大，否则无法进行备份操作 4、卸载需要缩容的分区/home umount /home #如果提示无法卸载，可以使用强制卸载 fuser -m /home #查看在使用/home目录的进程  yum  install psmisc umount -l /home #强制卸载 xfs_repair /dev/mapper/centos-home  #检查文件系统是否有错误 5、创建逻辑卷 [...]<p><a rel="bookmark" href="https://www.osyunwei.com/archives/14150.html" target="_blank">查看全文</a></p>]]></description>
		<wfw:commentRss>https://www.osyunwei.com/archives/14150.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux下缩小ext4文件系统的LVM磁盘分区</title>
		<link>https://www.osyunwei.com/archives/14133.html</link>
		<comments>https://www.osyunwei.com/archives/14133.html#comments</comments>
		<pubDate>Thu, 28 Dec 2023 10:07:36 +0000</pubDate>
		<dc:creator>qihang01</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[LVM]]></category>

		<guid isPermaLink="false">https://www.osyunwei.com/?p=14133</guid>
		<description><![CDATA[需求：把/data缩小至5GB，把空闲容量扩容到/root分区（LVM分区为ext4文件系统，xfs文件系统不能无损缩小） 操作系统：CentOS 说明： 1、缩小LVM中的文件系统必须离线操作，需要先卸载分区 2、缩小操作需要先缩小文件系统、再缩小LVM逻辑卷 3、扩容分区需要先扩容LVM逻辑卷、再扩容文件系统 具体操作： 一、缩小/data分区 1、查看分区信息 df -h /data 2、卸载分区 umount /data fuser -m /data #查看在使用/data目录的进程  yum  install psmisc umount -l /data #强制卸载 3、检查文件系统是否有错误 e2fsck -f /dev/mapper/centos-data 4、缩小文件系统大小到5GB resize2fs /dev/mapper/centos-data 5G 5、缩小逻辑卷大小到5GB lvreduce -L 5G /dev/mapper/centos-data 6、再次检查文件系统是否有错误 e2fsck -f /dev/mapper/centos-data 7、 挂载文件系统并验证其大小 mount /data df -h /data 二、扩容/根分区 1、扩容/root逻辑卷的容量 lvextend -l +100%FREE [...]<p><a rel="bookmark" href="https://www.osyunwei.com/archives/14133.html" target="_blank">查看全文</a></p>]]></description>
		<wfw:commentRss>https://www.osyunwei.com/archives/14133.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux下扩容LVM根分区</title>
		<link>https://www.osyunwei.com/archives/13896.html</link>
		<comments>https://www.osyunwei.com/archives/13896.html#comments</comments>
		<pubDate>Thu, 20 Jul 2023 06:09:20 +0000</pubDate>
		<dc:creator>qihang01</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[LVM]]></category>

		<guid isPermaLink="false">https://www.osyunwei.com/?p=13896</guid>
		<description><![CDATA[需求：在磁盘/dev/sda剩余未使用的空间上创建新分区，并扩容到lvm根分区 1、磁盘分区操作 df  -h  #查看当前磁盘分区信息 fdisk -l #查看磁盘容量 parted /dev/sda #运行parted并指定磁盘设备 print free #查看可用空闲空间 quit #退出 fdisk /dev/sda #进行分区操作 p #查看当前的分区情况 n #创建一个新分区 回车 #当要求输入起始扇区时，按回车键使用默认值（将新分区放置在可用空间的开头） 回车 #当要求输入结束扇区时，同样按回车键以使用默认值（将新分区延伸到可用空间的末尾） w #保存修改并退出fdisk partprobe #刷新分区表并识别新创建的分区信息 #如果提示：Do you want to remove the signature? [Y]es/[N]o:切记不能输入y，否则整个分区就被格式化了。 2、lvm分区操作 pvcreate /dev/sda3 #创建物理卷 lvmdiskscan &#124; grep LVM #查看已经创建的PV pvdisplay #查看卷组信息 vgs #查看已有卷组名称 bigcloud-enterprise-linux-for-euler #扩展卷组bigcloud-enterprise-linux-for-euler，把分区 /dev/sda3加入到bigcloud-enterprise-linux-for-euler卷组里 [...]<p><a rel="bookmark" href="https://www.osyunwei.com/archives/13896.html" target="_blank">查看全文</a></p>]]></description>
		<wfw:commentRss>https://www.osyunwei.com/archives/13896.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux下标准分区与LVM分区操作</title>
		<link>https://www.osyunwei.com/archives/12992.html</link>
		<comments>https://www.osyunwei.com/archives/12992.html#comments</comments>
		<pubDate>Mon, 31 Oct 2022 15:23:38 +0000</pubDate>
		<dc:creator>qihang01</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[LVM]]></category>
		<category><![CDATA[分区]]></category>

		<guid isPermaLink="false">https://www.osyunwei.com/?p=12992</guid>
		<description><![CDATA[一、Linux下标准分区 fdisk -l #查看设备，一般可以看到设备名为/dev/sdb，/dev/xvdb，或者为/dev/vdb fdisk /dev/sdb #输入m可查看帮助 g #输入g将磁盘划为gpt格式，支持容量大于2TB的磁盘 n #输入n，新增分区 1 #选择分区，默认回车，1分区 回车 #选择分区起始位置，回车，默认从2048M开始划分 回车 #选择分区终止位置，回车，默认最大空间，注：若要划分多个分区需要提前规划好，按照规划输入分区大小 w #输入w保存退出 fdisk -l #到此为止磁盘分区完成，可以看到多了个分区/dev/sdb1 mkfs.xfs /dev/sdb1 #格式化为xfs文件系统，mkfs.ext4 /dev/sdb1 #格式化ext4文件系统 mkdir -p /data #创建需要挂载的目录 mount /dev/sdb1 /data #执行挂载 umount /dev/sdb1 df -h #查看挂载情况 blkid /dev/sdb1 #查看磁盘的UUID /dev/sdb1: UUID="62412488-d0d8-4c62-9a72-59b0671b036d" BLOCK_SIZE="4096" TYPE="xfs" PARTUUID="d8a2246f-4a28-a742-88af-7650b3cf3972" vi /etc/fstab #设置开机自动挂载，在最后一行输入以下代码 UUID=62412488-d0d8-4c62-9a72-59b0671b036d /data xfs defaults 0 [...]<p><a rel="bookmark" href="https://www.osyunwei.com/archives/12992.html" target="_blank">查看全文</a></p>]]></description>
		<wfw:commentRss>https://www.osyunwei.com/archives/12992.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XenServer虚拟机扩容LVM磁盘分区</title>
		<link>https://www.osyunwei.com/archives/7956.html</link>
		<comments>https://www.osyunwei.com/archives/7956.html#comments</comments>
		<pubDate>Thu, 18 Sep 2014 07:03:37 +0000</pubDate>
		<dc:creator>qihang01</dc:creator>
				<category><![CDATA[Xen]]></category>
		<category><![CDATA[LVM]]></category>
		<category><![CDATA[XenServer]]></category>
		<category><![CDATA[磁盘分区]]></category>

		<guid isPermaLink="false">http://www.osyunwei.com/?p=7956</guid>
		<description><![CDATA[说明：XenServer里面安装的虚拟机，分区的时候采用的是LVM磁盘分区 需求：现在需要扩容虚拟机根分区/ 具体操作： 一、使用XenCenter增大虚拟机磁盘容量,如下图所示 增大当前磁盘到50GB 注意：必须在虚拟机关机状态下进行 二、查看硬盘容量 df -h #可以看到此时根分区还是12G，没有变化 fdisk -l #已经可以看到整个磁盘容量变为53.6GB了 三、创建新的磁盘分区 fdisk /dev/xvda #对磁盘/dev/xvda进行操作 p #查看当前分区 系统运维  www.osyunwei.com  温馨提醒：qihang01原创内容©版权所有,转载请注明出处及原文链 n #创建新分区 4 #创建第四个主分区 t #修改分区类型 8e #输入8e，代表分区使用LVM类型 p #查看当前分区状态 w #保存以上操作，否则不能新建分区 重新启动系统之后，再进行以下操作 四、把新创建的分区/dev/xvda4加入到与根分区/相同的LVM中 mkfs.ext3 /dev/xvda4 #格式化分区，需要等一会 pvcreate /dev/xvda4 #创建一个新的LVM分区 pvdisplay #查看已经存在的pv（物理卷） 系统运维  www.osyunwei.com  温馨提醒：qihang01原创内容©版权所有,转载请注明出处及原文链 vgdisplay #查看当前已经存在的vg（逻辑卷组） lvdisplay #查看已经存在的lv（逻辑卷） vgextend VolGroup00 /dev/xvda4 #把/dev/xvda4加入与/目录相同的vg（逻辑卷组） [...]<p><a rel="bookmark" href="https://www.osyunwei.com/archives/7956.html" target="_blank">查看全文</a></p>]]></description>
		<wfw:commentRss>https://www.osyunwei.com/archives/7956.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
