I am stuck in the problem. The fsck commands on the desktop computer showed the error of the file system for the mounted root directory. So, I created the bootable USB stick of Ubuntu, and made it boot. And then, I tried to fix the file system error with executing the fsck on the USB stick since the fsck cannot fix a mounted directory. However, the fsck on the USB stick showed no error. How should I fix this file system error?
(The fsck on the desktop computer)
$ sudo fsck -nf /dev/nvme0n1p2
fsck from util-linux 2.31.1
e2fsck 1.44.1 (24-Mar-2018)
Warning! /dev/nvme0n1p2 is mounted.
Warning: skipping journal recovery because doing a read-only filesystem check.
Pass 1: Checking inodes, blocks, and sizes
Inodes that were part of a corrupted orphan linked list found. Fix? no
Inode 6816186 was part of the orphaned inode list. IGNORED.
Inode 6816770 was part of the orphaned inode list. IGNORED.
Inode 6883264 was part of the orphaned inode list. IGNORED.
Inode 6883789 was part of the orphaned inode list. IGNORED.
Inode 6887919 was part of the orphaned inode list. IGNORED.
Inode 6887920 was part of the orphaned inode list. IGNORED.
Inode 6887925 was part of the orphaned inode list. IGNORED.
Inode 6887929 was part of the orphaned inode list. IGNORED.
Deleted inode 6887947 has zero dtime. Fix? no
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
Block bitmap differences: -(9588738--9588745) -(9588760--9588764) -(9597955--9597964) -(9998851--9998855) -(27306830--27306834) -(27307548--27307557) -34598400
Fix? no
Free blocks count wrong (43144465, counted=43144229).
Fix? no
Inode bitmap differences: -6816186 -6816770 -6883264 -6883789 -(6887919--6887920) -6887925 -6887929 -6887947
Fix? no
Free inodes count wrong (14401240, counted=14401183).
Fix? no
/dev/nvme0n1p2: ********** WARNING: Filesystem still has errors **********
/dev/nvme0n1p2: 557352/14958592 files (0.5% non-contiguous), 16670447/59814912 blocks
(The fsck on the bootable USB stick)
ubuntu@ubuntu:~$ sudo fsck -fy /dev/nvme0n1p2
fsck from util-linux 2.31.1
e2fsck 1.44.1 (24-Mar-2018)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/nvme0n1p2: 557879/14958592 files (0.6% non-contiguous), 16680714/59814912 blocks
ubuntu@ubuntu:~$ sudo fsck -fn /dev/nvme0n1p2
fsck from util-linux 2.31.1
e2fsck 1.44.1 (24-Mar-2018)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/nvme0n1p2: 557879/14958592 files (0.6% non-contiguous), 16680714/59814912 blocks
ubuntu@ubuntu:~$
FYI:
Ubuntu 18.04 LTS for both the desktop and the bootable USB stick
The terminal window fails to open while the xterm can open. I consider that the file system error may affect this opening fail.
Anyway, thank you for all your advises.
– Haru Jul 13 '20 at 09:20