Solved How to invoke e2scrub and e2scrub_all?

Solved issue

CaffeineAddict

Well-Known Member
Joined
Jan 21, 2024
Messages
1,688
Reaction score
1,190
Credits
14,023
The following is what I'm doing, I want to check metadata on a mounted filesystem which is /dev/sdb3 where /root and swap partitions are located but I have no clue how to invoke it.
My SSD is encrypted with crypsetup and is managed by LVM

Bash:
user@msi:~$ lsblk
NAME               MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
sda                  8:0    0 931,5G  0 disk
└─sda1               8:1    0 931,5G  0 part  /media/user/Data
sdb                  8:16   0 465,8G  0 disk
├─sdb1               8:17   0   512M  0 part  /boot/efi
├─sdb2               8:18   0   488M  0 part  /boot
└─sdb3               8:19   0 464,8G  0 part
  └─sdb3_crypt     253:0    0 464,8G  0 crypt
    ├─msi--vg-root 253:1    0 442,4G  0 lvm   /
    └─msi--vg-swap 253:2    0  22,4G  0 lvm   [SWAP]
sr0                 11:0    1  1024M  0 rom

user@msi:~$ sudo e2scrub /dev/sdb3
/dev/sdb3: Not an ext[234] filesystem.
Usage: /usr/sbin/e2scrub [OPTIONS] mountpoint | device

mountpoint must be on an LVM-managed block device
-n: Show what commands e2scrub would execute.
-r: Remove e2scrub snapshot and exit, do not check anything.
-t: Run fstrim if successful.
-V: Print version information and exit.

Bash:
man e2scrub

DESCRIPTION
e2scrub attempts to check (but not repair) all metadata in a mounted ext[234] file system if the file system resides on an LVM logical volume. The block device of the LVM logical volume can also be passed in.

Likewise how would I invoke e2scrub_all which does the same but all mounted file systems.
 


Figured out that lsblk does not output same VG and LV names as they're called, so I had to:

Bash:
sudo lvdisplay

And that gave me the actual LV name which is /dev/msi-vg/root.
So running e2scrub in my case boils down to:

Bash:
sudo e2scrub /dev/msi-vg/root

For it to work I had to also reduce root partition from live USB.

This whole procedure is necessary to run fstrim safely because running fstrim on LVM requires first running e2scrub which in turn requires 256M of non partitioned free space on LVM.

As per man e2scrub
 


Latest posts

Top