-2

I want to check the healthiness of my disk, partitions, filesystems, and LVs. So I run fsck. I heard to use fsck on a filesystem, I need to boot into a live Lubuntu from a bootable flash drive and umount filesystem beforehand, so I did. But why fsck always return immediately? How can I make fsck actually check the healthiness of my disk, partitions, filesystems, and LVs? Thanks.

$ sudo fsck /dev/sda
fsck from util-linux 2.31.1
e2fsck 1.44.1 (24-Mar-2018)
/dev/sda is in use.
e2fsck: Cannot continue, aborting.

$ sudo umount /dev/sda
umount: /dev/sda: not mounted.

$ sudo fsck /dev/sda
fsck from util-linux 2.31.1
e2fsck 1.44.1 (24-Mar-2018)
/dev/sda is in use.
e2fsck: Cannot continue, aborting.

$ sudo fsck /dev/sda1
fsck from util-linux 2.31.1
fsck.fat 4.1 (2017-01-24)
/dev/sda1: 12 files, 1557/130812 clusters
$ sudo fsck /dev/sda2
fsck from util-linux 2.31.1
lubuntu@lubuntu:~$ echo $?
0



$ sudo parted -l
Model: ATA TOSHIBA MQ01ABF0 (scsi)
Disk /dev/sda: 500GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End    Size   File system  Name                  Flags
 1      1049kB  538MB  537MB  fat32        EFI System Partition  boot, esp
 2      538MB   500GB  500GB                                     lvm


Warning: The driver descriptor says the physical block size is 2048 bytes, but
Linux says it is 512 bytes.
Ignore/Cancel? I                                                          
Model: General UDisk (scsi)
Disk /dev/sdb: 16.1GB
Sector size (logical/physical): 2048B/512B
Partition Table: mac
Disk Flags: 

Number  Start   End     Size    File system  Name   Flags
 1      2048B   6143B   4096B                Apple
 2      6222kB  8614kB  2392kB               EFI


Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/lubuntu--vg-home: 444GB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Disk Flags: 

Number  Start  End    Size   File system  Flags
 1      0.00B  444GB  444GB  ext4


Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/lubuntu--vg-swap: 4295MB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Disk Flags: 

Number  Start  End     Size    File system     Flags
 1      0.00B  4295MB  4295MB  linux-swap(v1)


Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/lubuntu--vg-root: 51.5GB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Disk Flags: 

Number  Start  End     Size    File system  Flags
 1      0.00B  51.5GB  51.5GB  ext4


Model: Unknown (unknown)
Disk /dev/zram3: 444MB
Sector size (logical/physical): 4096B/4096B
Partition Table: loop
Disk Flags: 

Number  Start  End    Size   File system     Flags
 1      0.00B  444MB  444MB  linux-swap(v1)


Model: Unknown (unknown)
Disk /dev/zram1: 444MB
Sector size (logical/physical): 4096B/4096B
Partition Table: loop
Disk Flags: 

Number  Start  End    Size   File system     Flags
 1      0.00B  444MB  444MB  linux-swap(v1)


Model: Unknown (unknown)
Disk /dev/zram2: 444MB
Sector size (logical/physical): 4096B/4096B
Partition Table: loop
Disk Flags: 

Number  Start  End    Size   File system     Flags
 1      0.00B  444MB  444MB  linux-swap(v1)


Model: Unknown (unknown)
Disk /dev/zram0: 444MB
Sector size (logical/physical): 4096B/4096B
Partition Table: loop
Disk Flags: 

Number  Start  End    Size   File system     Flags
 1      0.00B  444MB  444MB  linux-swap(v1)
2

From man fsck.ext2

e2fsck is used to check the ext2/ext3/ext4 family of file systems. For ext3 and ext4 filesystems that use a journal, if the system has been shut down uncleanly without any errors, normally, after replaying the committed transactions in the journal, the file system should be marked as clean. Hence, for filesystems that use journalling, e2fsck will normally replay the journal and exit, unless its superblock indi‐ cates that further checking is required.

From further down in the same man page:

-f Force checking even if the file system seems clean.

So... running sudo fsck -f /dev/sda1 will cause fsck to check the disk, even if the superblock is marked as clean.

1
  • /dev/sda (sdb, sdc...) are (hardware) devices -- the actual disk you can use as a brick!
  • /dev/sda1 (2,3...) are partitions of the above
  • fsck can only work on the second
  • you need something like SMART for the first
  • gparted shows how the second nests in the first

Admittedly Linux causes some confusion by calling both "device".

LVs are an extra abstraction on top of (physical) FSes (above).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.