Score:0

e2fsck aborts even though filesystem is unmounted

in flag

I am using a live Ubuntu USB disk (20.04) to repair a filesystem on another USB disk. The e2fsck command aborts because the filesystem is perceived as "in use".

  • The filesystem is unmounted, and this is confirmed when I use the umount command.
  • I run fuser to identify any processes using the unmounted filesystem.
  • Fuser identifies 3 processes using the filesystem: cupsd, rsyslogd and unattended-upgrade...
  • I try killing the processes but cupsd and rsyslogd simply restart.
  • Afterwards, e2fsck still aborts
  • If I reboot, the problem replicates itself.

You can see the code I've used and the results below. How can I repair this filesystem?

ubuntu@ubuntu:~$ sudo umount /dev/sdb5
umount: /dev/sdb5: not mounted.

ubuntu@ubuntu:~$ sudo e2fsck -p /dev/sdb5
/dev/sdb5 is in use.
e2fsck: Cannot continue, aborting.

ubuntu@ubuntu:~$ sudo fuser -m /dev/sdb5
/dev/sdb5:            1584  1590  1722
ubuntu@ubuntu:~$ ps -p 1584
    PID TTY          TIME CMD
   1584 ?        00:00:00 rsyslogd
ubuntu@ubuntu:~$ ps -p 1590
    PID TTY          TIME CMD
   1590 ?        00:00:00 cupsd
ubuntu@ubuntu:~$ ps -p 1722
    PID TTY          TIME CMD
   1722 ?        00:00:00 unattended-upgr
Score:0
in flag

In my case, it happens after cloning a drive with dd. So I believe e2fsck is using only the UUID for its mount check (and the UUID is not unique anymore as dd clones it)

django avatar
in flag
I am not using any cloned disks in my scenario, so this doesn't explain my problem. Thanks anyway @eddygeek
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.