尝试减少 LV;无法进行 fsck

尝试减少 LV;无法进行 fsck

我有一台 Linux 虚拟机(由 VM Ware ESXi 虚拟机管理程序托管)。它有 1 TB 的驱动器,并在大约 2 年前安装操作系统时配置了板载 LVM。lvs 工具输出显示了物理卷如何划分为逻辑卷。

lvs
LV   VG   Attr       LSize    Pool Origin Data%  Meta%  Move Log
Cpy%Sync Convert   
home part -wi-a----- <965,12g                      
root part -wi-ao----   50,00g                                         
swap part -wi-ao----   <7,88g

我需要调整(扩展)根分区(VLM 中的逻辑卷)的大小,因为那里的空间已经快用完了。为了实现这一点,我必须减小 /home 卷的大小,这个卷相当大,而且那里有很多可用空间。

减少卷的程序说首先我必须从 /home 卸载 /dev/mapper/part-home。

umount -v /home 
umount: /home (/dev/mapper/part-home) unmounted

然后我必须对卸载的卷进行 fsck :

e2fsck -ff /dev/mapper/part-home 
e2fsck 1.42.9 (28-Dec-2013)
e2fsck_open2: Bad magic number in super-block 
e2fsck: Superblock invalid, trying backup blocks... 
e2fsck: Bad magic number in super-block while trying to open /dev/mapper/part-home

The superblock could not be read or does not describe a correct ext2
filesystem.  If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the
superblock is corrupt, and you might try running e2fsck with an
alternate superblock:
    e2fsck -b 8193 <device>

但是 - 正如您所看到的 - 我收到一条错误消息。

因此我使用另一个工具,它模拟在逻辑卷上创建文件系统,并为我提供一些有关备份超级块位置的提示。

mkfs.ext4 -n /dev/mapper/part-home  
mke2fs 1.42.9 (28-Dec-2013)
Filesystem label= 
OS Type: Linux 
Block size=4096 (log=2) 
Fragment size=4096 (log=2) 
Stride=0 blocks, Stripe width=0 blocks 
63250432 i-nodes, 252999680 blocks 
12649984 blocks (5.00%) reserved for the super user 
First data block=0 
Maximum filesystem blocks=2401239040
7721 block groups 32768 blocks per group, 32768 fragments per group
8192 i-nodes per group 
Superblock backups stored on blocks: 
     32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
     4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 
     102400000, 214990848

因此,我使用以下命令来使用备份超级块,但收到另一条错误消息。我使用前一个 32768、98304 等给出的每个数字都得到了相同的结果。

e2fsck -b 71663616 -B 4096 /dev/mapper/part-home 
e2fsck 1.42.9 (28-Dec-2013) 
e2fsck: Bad magic number in super-block while trying to open /dev/mapper/part-home

The superblock could not be read or does not describe a correct ext2
filesystem.  If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the
superblock is corrupt, and you might try running e2fsck with an
alternate superblock:
    e2fsck -b 8193 <device>

你能帮我缩小 part-home 卷吗?我要补充的是,一旦安装,一切都会顺利进行。我可以看到并列出并分类存储在其中的所有文件。

相关内容