2fs ext4パーティションのサイズを変更する方法e2fsck -fなしでスーパーブロックまたはパーティションテーブルについて文句を言わずにpartedに縮小しました。

2fs ext4パーティションのサイズを変更する方法e2fsck -fなしでスーパーブロックまたはパーティションテーブルについて文句を言わずにpartedに縮小しました。

partedを使用してパーティションのサイズを元のサイズに戻すと、/dev/vda1パーティションを問題なくマウントできます。

しかし、8GBに縮小した後にどのようにマウントできますか? (上記のデータは1GBのみ)

parted resizepartを使用して縮小してresize2fs /dev/vda1を実行しようとすると、最初にe2fsck -f /dev/vda1を実行するように求められますが、常にエラーが発生します。

:~/e2fsprogs-1.44.1# ./e2fsck/e2fsck -f /dev/vda1
e2fsck 1.44.1 (24-Mar-2018)
The filesystem size (according to the superblock) is 5214459 blocks
The physical size of the device is 1924709 blocks
Either the superblock or the partition table is likely to be corrupt!
Abort<y>? cancelled!

rootfs: ********** WARNING: Filesystem still has errors **********

いくつかのバックアップスーパーブロックを入手できますが、e2fsck -b backupsuperblockNumber /dev/vda1のいずれかを使用しようとするとエラーが発生します...下の貼り付けを参照してください。

Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632

:~/e2fsprogs-1.44.1# ./e2fsck/e2fsck -b 32768 /dev/vda1
e2fsck 1.44.1 (24-Mar-2018)
rootfs: recovering journal
./e2fsck/e2fsck: unable to set superblock flags on rootfs

rootfs: ***** FILE SYSTEM WAS MODIFIED *****
rootfs: ********** WARNING: Filesystem still has errors **********

これはパーティションの現在のfdiskです(縮小後)fdisk -l /dev/vda1

Disk /dev/vda1: 7.4 GiB, 7883608576 bytes, 15397673 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

sfdisk -d /dev/vda > sfdiskDump
:~/e2fsprogs-1.44.1# cat sfdiskDump
# partition table of /dev/vda
unit: sectors

/dev/vda1 : start=        1, size= 41943039, Id=ee
/dev/vda2 : start=        0, size=        0, Id= 0
/dev/vda3 : start=        0, size=        0, Id= 0
/dev/vda4 : start=        0, size=        0, Id= 0

And gdisk:
Found valid GPT with protective MBR; using GPT.
Disk /dev/vda: 41943040 sectors, 20.0 GiB
Logical sector size: 512 bytes
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 41943006
Partitions will be aligned on 2048-sector boundaries
Total free space is 26320020 sectors (12.6 GiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1          227328        15625000   7.3 GiB     8300
  14            2048           10239   4.0 MiB     EF02
  15           10240          227327   106.0 MiB   EF00

ベストアンサー1

おすすめ記事