31

I got this output:

fsck from util-linux 2.20.1
e2fsck 1.42.9 (4-Feb-2014)
/dev/mapper/ubuntu--vg-root is mounted.
e2fsck: Cannot continue, aborting.

after I used the fsck command. Any answers?

αғsнιη
  • 35,660
  • 3
    As it says, the device is mounted. You can't fsck a volume while it is mounted. – psusi Oct 14 '14 at 13:47
  • 1
    I ran across the same thing. A little confusing. The line about it being mounted looks like a general statement rather than an error report. :-) – Brian Knoblauch Apr 25 '18 at 18:16

6 Answers6

27

If you just use fsck to check the volume you can run

fsck -nf /dev/sda1
  • n -> dry-run: will not do any change (just checking)
  • f -> force : sometimes it says clean but you can force a new check

If you want to fix filesystem errors, first unmount your partition: umount /dev/sda1

Boop
  • 371
8

I don't know why, but I had to service udev stop (on debian based system).

After stopping udev the e2fsck -f /dev/sda1-command worked and didn't print the e2fsck: Cannot continue, aborting-Message anymore.

I dont't know, if it has something to do with http://dev.bizo.com/2012/07/mdadm-device-or-resource-busy.html - but this page gave me the hint to try it.

MacMartin
  • 353
  • 1
    Stopping udev with systemctl stop udev did the trick for me. Bloody complicated Linux layers upon layers these days. – Greg Bell Jan 01 '23 at 07:20
4

I encountered similar issue especially when you are still accessing the mount point. It can below any one of below two reasons.

You cannot run on the root FS Say you can in directory "/mnt" and you have unmounted the volume mounted on "/mnt". You will encounter same error. Make use that you are not in same directory.

Before :

root@ip-172-31-28-38 /mnt# fsck -f /dev/xvdh
fsck from util-linux 2.23.2
e2fsck 1.42.12 (29-Aug-2014)
/dev/xvdh is in use.
e2fsck: Cannot continue, aborting.


root@ip-172-31-28-38 /mnt# 
root@ip-172-31-28-38 /mnt# cd /

After :

root@ip-172-31-28-38 /# fsck -f /dev/xvdh
fsck from util-linux 2.23.2
e2fsck 1.42.12 (29-Aug-2014)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/xvdh: 12/524288 files (0.0% non-contiguous), 70287/2097152 blocks
root@ip-172-31-28-38 /# 
1

The following solution worked for me:

  • boot to a Ubuntu Live DVD/USB (Use this guide to make an Ubuntu Live DVD/USB) and start gparted; then determine which /dev/sdaX is your Ubuntu EXT4 partition and quit gparted
  • open a terminal window type sudo fsck -f /dev/sda4 replacing 4 with the number you found earlier -- repeat the fsck command if there were errors --
  • type reboot
ShirinJZ
  • 65
  • 1
  • 10
0

I've had this error when I tried to fsck my root partition. The solution was found here:

  1. touch /forcefsck to force the check on the next system boot.
  2. Reboot the machine.
  3. Make sure the /forcefsck file is no longer there after the system is back up again.
tolache
  • 101
0

Try the below command this file fix it for you.

resize2fs /dev/sda1

Originally this command is for resizing the partition but it also refreshes the file system and does what you guys want to achieve with the fsck command.