Chinaunix首页 | 论坛 | 博客
  • 博客访问: 53142
  • 博文数量: 26
  • 博客积分: 1295
  • 博客等级: 中尉
  • 技术积分: 280
  • 用 户 组: 普通用户
  • 注册时间: 2005-12-12 08:38
文章分类

全部博文(26)

文章存档

2010年(23)

2009年(3)

我的朋友

分类: LINUX

2010-04-06 14:05:00

For this article, assume that the file system in question is 1GB mounted at /data on the logical volume /dev/vg0/LV. This file system needs to be reduced by 100MB, bringing it down to 900MB. Note: there must be enough free space on the file system to reduce it. If the file system is at 99% full, this may not work or may cause unrecoverable data loss.

 

Begin by unmounting the file system:

 



$ umount /data

 

Reduce the file system. Please note that this is done on /dev/vg0/LV. The number at the end is the final size of the filesystem, not the amount it is reduced by.

 



$ resize2fs /dev/vg0/LV 900M

 

The final logical volume shouldn't extend past the filesystem. Because the filesystem has been reduced by 100MB, the volume must also be reduced that amount:

 



$ lvreduce -L -105M /dev /vg0/LV -reduces the logical volume

 

Mount the filesystem and run df to verify the change was made.

 

WARNING: Reducing LVM can cause a catastrophe which could result in data loss. Plan and act accordingly. ALWAYS create backups!

阅读(333) | 评论(0) | 转发(0) |
0

上一篇:ha-lvm

下一篇:没有了

给主人留下些什么吧!~~