0

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

1 Answer 1

0

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)

1
  • I am not using any cloned disks in my scenario, so this doesn't explain my problem. Thanks anyway @eddygeek
    – django
    Jul 24, 2023 at 9:23

You must log in to answer this question.

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