1

Problem

I want to fix corrupted logical volumes and a partition. The SSD is originally used by Proxmox OS. However, I try to recover it by Ubuntu (Safe graphics) from Live USB.

At first, I have tried to run fsck directly to corrupted logical volumes. However, I detect that fixing super-blocks cause another error in the partition level.

$ sudo fsck -b 32768 /dev/dm-11

...
fsck.ext2: Bad magic number in super-block while trying to open /dev/mapper/pve-data_meta1
...


$ journalctl | grep error

...
Apr 03 05:43:30 ubuntu kernel: blk_update_request: critical medium error, dev nvme0n1, sector 1902965000 op 0x0:(READ) flags 0x80700
Apr 03 05:43:30 ubuntu kernel: Buffer I/O error on dev dm-11, logical block 42, async page read

After seeing this error log, I started to try to fix nvme0n1. However, the warning said it is in use.

$ sudo fsck -n /dev/nvme0n1

...
Warning! /dev/nvme0n1 is in use.
ext2fs_open2: Superblock invalid, trying backup blocks...
ext2fs_open2: Bad magi number in super-block while trying to open /dev/nvme0n1
...

$ sudo fsck -b 32768 /dev/nvme0n1

...
/dev/nvme0n1 is in use.
e2fsck: Cannot continue, aborting.

What I tried

  • Run umount /dev/nvme0n1 but it returns umount: /dev/nvem0n1: not mounted.
  • Run mount /dev/nvme0n1 /mnt says mount: /mnt: /dev/nvme0n1 already mounted or mount point busy.
  • Run sudo systemctl stop systemd-udevd but not works.
  • Run sudo swapoff -a but not works.
  • Run lsof /dev/nvme0, lsof /dev/nvme0n1 and lsof /dev/dm-11 return nothing.
  • Run sudo e2fsck -f -b 32768 /dev/nvme0n1 but not works.

Any ideas or comments are welcome. Please give me hints to resolve this.

Version

  • ubuntu-20.04.4
  • desktop
  • amd64
2
  • Hello. I do not see a Ubuntu version in this question.
    – David
    Apr 3, 2022 at 8:27
  • @David Appended. Thanks.
    – hiroga
    Apr 3, 2022 at 20:28

2 Answers 2

1

In my case the device was used by Docker which was running. After I stopped it, everything is fine

sudo systemctl stop docker
0

I had very similar problem on Rockylinux 8. Essentially the root of the problem is Linux mount namespaces ( https://man7.org/linux/man-pages/man7/mount_namespaces.7.html ).

Explanation: Let assume you have mounted /dev/sda5 to /mnt/1. If some process mount /dev/sda5 inside their namespace, utilities like mount or fuser -vm will not see it. So if you unmount /mnt/1 it will be unmounted from /mnt/1, but /dev/sda5 still be mounted inside some namespace. In my case it was flatpak application, in case of topic starter it was docker.

So if you exit said application, namespace got cleared (fs unmounted?) and /dev/sda5 will not be mounted anymore. So fsck (or resize2fs) will work.

PS /me still in search of utility that can scan all namespaces to find hidden mounts.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .