linux缩小lv发生文件系统错误
2012-02-29 15:26
197 查看
众所周知,linux lvm 扩大lv是先扩大lv,然后再扩大文件系统,所以有的人就认为缩小lv也是先缩小lv,再缩小文件系统,当然博主刚开始也那么认为,导致lvresize 以后,lv的大小小于文件系统大小而无法挂载,以下分享下解决办法。
案例:
缩小/opt from 8.46G to 4G.
HostA:~ # lvresize -L 4G /dev/vg00/lv_opt
WARNING: Reducing active logical volume to 4.00 GB
THIS MAY DESTROY YOUR DATA (filesystem etc.)
Do you really want to reduce lv_opt? [y/n]: y
Reducing logical volume lv_opt to 4.00 GB
Logical volume lv_opt successfully resized
HostA:~ # lvs
lv_opt vg00 -wi-a- 4.00G
HostA:~ # e2fsck -f /dev/vg00/lv_opt
e2fsck 1.41.9 (22-Aug-2009)
Error reading block 1049100 (Invalid argument). Ignore error<y>? no
Error reading block 1050125 (Invalid argument). Ignore error<y>? no
Error reading block 1049100 (Invalid argument). Ignore error<y>? no
Error reading block 1050125 (Invalid argument). Ignore error<y>? no
Superblock has an invalid journal (inode 8).
Clear<y>? yes
*** ext3 journal has been deleted - filesystem is now ext2 only ***
The filesystem size (according to the superblock) is 2217984 blocks
The physical size of the device is 1048576 blocks
Either the superblock or the partition table is likely to be corrupt!
Abort<y>? no
Pass 1: Checking inodes, blocks, and sizes
Journal inode is not in use, but contains data. Clear<y>? yes
Error reading block 1048578 (Invalid argument) while getting next inode from scan. Ignore error<y>? yes
HostA:~ # resize2fs /dev/vg00/lv_opt
resize2fs 1.41.9 (22-Aug-2009)
Please run 'e2fsck -f /dev/vg00/lv_opt' first.
会发生以上文件系统大于lv大小导致无法通过e2fsck
网上找了很多方法如何修复系统,其实方法很简单,只要先把lv扩大至原来大小,再重新用正确的方法缩小lv即可
HostA:~ # lvresize -L 8.46G /dev/vg00/lv_opt
HostA:~ # e2fsck -f /dev/vg00/lv_opt
e2fsck 1.41.9 (22-Aug-2009)
Pass 1: Checking inodes, blocks, and sizes
Inode 8, i_blocks is 0, should be 262408. Fix<y>? yes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/vg00/lv_opt: ***** FILE SYSTEM WAS MODIFIED *****
/dev/vg00/lv_opt: 12703/554880 files (0.3% non-contiguous), 246796/2217984 blocks
HostA:~ # resize2fs /dev/vg00/lv_opt 4G
resize2fs 1.41.9 (22-Aug-2009)
Resizing the filesystem on /dev/vg00/lv_opt to 1048576 (4k) blocks.
The filesystem on /dev/vg00/lv_opt is now 1048576 blocks long.
HostA:~ # lvresize -L 4G /dev/vg00/lv_opt
WARNING: Reducing active logical volume to 4.00 GB
THIS MAY DESTROY YOUR DATA (filesystem etc.)
Do you really want to reduce lv_opt? [y/n]: y
Reducing logical volume lv_opt to 4.00 GB
Logical volume lv_opt successfully resized
HostA:~ # mount /opt/
HostA:~ # df -h /opt/
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg00-lv_opt
4.0G 826M 3.0G 22% /opt
HostA:~ #
本文出自 “天涯第一号” 博客,请务必保留此出处http://loofeer.blog.51cto.com/707932/792739
案例:
缩小/opt from 8.46G to 4G.
HostA:~ # lvresize -L 4G /dev/vg00/lv_opt
WARNING: Reducing active logical volume to 4.00 GB
THIS MAY DESTROY YOUR DATA (filesystem etc.)
Do you really want to reduce lv_opt? [y/n]: y
Reducing logical volume lv_opt to 4.00 GB
Logical volume lv_opt successfully resized
HostA:~ # lvs
lv_opt vg00 -wi-a- 4.00G
HostA:~ # e2fsck -f /dev/vg00/lv_opt
e2fsck 1.41.9 (22-Aug-2009)
Error reading block 1049100 (Invalid argument). Ignore error<y>? no
Error reading block 1050125 (Invalid argument). Ignore error<y>? no
Error reading block 1049100 (Invalid argument). Ignore error<y>? no
Error reading block 1050125 (Invalid argument). Ignore error<y>? no
Superblock has an invalid journal (inode 8).
Clear<y>? yes
*** ext3 journal has been deleted - filesystem is now ext2 only ***
The filesystem size (according to the superblock) is 2217984 blocks
The physical size of the device is 1048576 blocks
Either the superblock or the partition table is likely to be corrupt!
Abort<y>? no
Pass 1: Checking inodes, blocks, and sizes
Journal inode is not in use, but contains data. Clear<y>? yes
Error reading block 1048578 (Invalid argument) while getting next inode from scan. Ignore error<y>? yes
HostA:~ # resize2fs /dev/vg00/lv_opt
resize2fs 1.41.9 (22-Aug-2009)
Please run 'e2fsck -f /dev/vg00/lv_opt' first.
会发生以上文件系统大于lv大小导致无法通过e2fsck
网上找了很多方法如何修复系统,其实方法很简单,只要先把lv扩大至原来大小,再重新用正确的方法缩小lv即可
HostA:~ # lvresize -L 8.46G /dev/vg00/lv_opt
HostA:~ # e2fsck -f /dev/vg00/lv_opt
e2fsck 1.41.9 (22-Aug-2009)
Pass 1: Checking inodes, blocks, and sizes
Inode 8, i_blocks is 0, should be 262408. Fix<y>? yes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/vg00/lv_opt: ***** FILE SYSTEM WAS MODIFIED *****
/dev/vg00/lv_opt: 12703/554880 files (0.3% non-contiguous), 246796/2217984 blocks
HostA:~ # resize2fs /dev/vg00/lv_opt 4G
resize2fs 1.41.9 (22-Aug-2009)
Resizing the filesystem on /dev/vg00/lv_opt to 1048576 (4k) blocks.
The filesystem on /dev/vg00/lv_opt is now 1048576 blocks long.
HostA:~ # lvresize -L 4G /dev/vg00/lv_opt
WARNING: Reducing active logical volume to 4.00 GB
THIS MAY DESTROY YOUR DATA (filesystem etc.)
Do you really want to reduce lv_opt? [y/n]: y
Reducing logical volume lv_opt to 4.00 GB
Logical volume lv_opt successfully resized
HostA:~ # mount /opt/
HostA:~ # df -h /opt/
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg00-lv_opt
4.0G 826M 3.0G 22% /opt
HostA:~ #
本文出自 “天涯第一号” 博客,请务必保留此出处http://loofeer.blog.51cto.com/707932/792739
相关文章推荐
- virtualbox 中的linux 共享文件 发生文件系统类型错误的解决办法
- virtualbox 中的linux 共享文件 发生文件系统类型错误的解决办法
- 如何处理在linux下装TDS的时候,系统提示找不到文件之类的错误
- VMware安装Linux,出现错误-未找到要在其中创建新文件系统的有效设备(转)
- mysql安装常见问题(系统找不到指定的文件、发生系统错误 1067 进程意外终止)
- linux启动时文件系统错误问题
- Linux系统Vsftp 传文件出现 553 Could Not Create File错误的解决方法
- Linux下C编程-----文件操作(1) 通过系统调用简单操作标准输入、标准输出、标准错误
- linux物理卷pv、卷组vg、逻辑卷lv、文件系统及关系
- 在linux下向U盘复制文件时发生错误,显示目标是只读的,windows下能够正常使用,应该怎么解决?
- MySQL安装或重装后出现无法启动MySQL服务错误:发生系统错误2 系统找不到指定的文件
- mysql安装常见问题(系统找不到指定的文件、发生系统错误 1067 进程意外终止)
- mysql安装常见问题(系统找不到指定的文件、发生系统错误 1067 进程意外终止)
- 在linux下向U盘复制文件时发生错误,显示目标是只读的,windows下能够正常使用,应该怎么解决?
- linux下安装mysql my.cnf配置文件发生错误
- /etc/fstab文件错误导致Linux系统不能启动故障解决
- vbox安装linux系统时发生严重错误
- mysql安装常见问题(系统找不到指定的文件、发生系统错误 1067 进程意外终止)
- ThinkPHP框架在Linux系统中报找不到模版文件的错误
- em/console/aboutApplication 发生系统错误 2 系统找不到指定的文件。