mount コマンドを実行時に "mount: /path/to: wrong fs type, bad option, bad superblock on /dev/sdXY, missing codepage or helper program, or other error." というエラーが出たとき

結論

以下を実行する。

$ sudo e2fsck /dev/sdXY
$ sudo resize2fs /dev/sdXY

実行状況

「ファイルシステムは変更されました」の箇所は WARNING が出ることもあるが、スルーでよい。

$ sudo mount /dev/sdXY /path/to
mount: /path/to: wrong fs type, bad option, bad superblock on /dev/sdXY, missing codepage or helper program, or other error.
$ sudo e2fsck /dev/sdXY
e2fsck 1.46.5 (30-Dec-2021)
The ファイルシステム size (according to the superblock) is 244190976 blocks
The physical size of the device is 244190975 blocks
Either the superblock or the partition table is likely to be corrupt!
中止<y>? no
/dev/sdXY contains a file system with errors, check forced.
Pass 1: Checking iノードs, blocks, and sizes
Pass 2: Checking ディレクトリ structure
Pass 3: Checking ディレクトリ connectivity
/lost+found not found.  Create<y>? yes
Pass 4: Checking reference counts
Pass 5: Checking グループ summary information

/dev/sdXY: ***** ファイルシステムは変更されました *****
/dev/sdXY: 3392360/61054976 files (0.1% non-contiguous), 172349849/244190976 blocks
$ sudo resize2fs /dev/sdXY
resize2fs 1.46.5 (30-Dec-2021)
Resizing the filesystem on /dev/sdXY to 244190975 (4k) blocks.
The filesystem on /dev/sdXY is now 244190975 (4k) blocks long.
$ sudo mount /dev/sdXY /path/to
$

参考

unix.stackexchange.com

Powered by はてなブログ