How to clean up an unprocessed orphan inode list?

31,345

Solution 1

You clean up the unprocessed orphan inode list by unmounting and remounting the filesystem.

An extended discussion from the linux-ext4 mailing list has more information about what this message is and why it may appear. In short, one of two things has happened: Either you've run into a kernel bug, or much more likely, some filesystem corruption happened one of the previous times you remounted the filesystem readonly. Which is probably why the system thinks something is still using the filesystem when there isn't.

If it's been a year and you still haven't rebooted the machine, just give up and schedule a maintenance window.

Solution 2

If you're using ext2 / ext3 / ext4 you should be able to use e2fsck to clean up orphaned inodes:

e2fsck -f

For reiserfs, you can use reiserfsck which will also clean up orphaned inodes.

Solution 3

e2fsck -f <mount point> won't work.

First find out the mount points with

sudo mount -l

Then fsck the drive directly.

For example for me

sudo e2fsck -f /dev/xvda2

Solution 4

You should probably try a lazy unmount, i.e:

umount -l

Solution 5

I would recommend to first unmount the partition forcefully, i.e. using the -f option, and the running a file system check using fsck.

Share:
31,345

Related videos on Youtube

bmk
Author by

bmk

Updated on September 18, 2022

Comments

  • bmk
    bmk over 1 year

    I tried to mount a formerly readonly mounted filesystem read-writeable:

    mount -o remount,rw /mountpoint
    

    Unfortunately it did not work:

    mount: /mountpoint not mounted already, or bad option
    

    dmesg reports:

    [2570543.520449] EXT4-fs (dm-0): Couldn't remount RDWR because of unprocessed orphan inode list.  Please umount/remount instead
    

    A umount does not work, too:

    umount /mountpoint
    umount: /mountpoint: device is busy.
        (In some cases useful info about processes that use
         the device is found by lsof(8) or fuser(1))
    

    Unfortunately neither lsof of fuser don't show any process accessing something located under the mount point.

    So - how can I clean up this unprocessed orphan list to be able to mount the filesystem again without rebooting the computer?

    • Richard Keller
      Richard Keller almost 12 years
      Have you tried fuser -km /mountpoint yet? Beware though, the -k flag will kill all processes accessing that directory.
    • thinice
      thinice almost 12 years
      Can you provide a little bit more insight to what dm-0 consists of?
    • Matthew Ife
      Matthew Ife almost 12 years
      I have feeling I know whats up, but can you tell me, was the filesystem originally rw, remounted (due to ata error or whatever) ro, and now you are trying to rw again?
    • bmk
      bmk almost 12 years
      @Mlfe: The filesystem was formerly remountend ro by purpose. It's a filesystem on an LVM holding a daily backup snapshot that will be set to rw during backup operation and ro after finishing the backup.
  • bmk
    bmk almost 13 years
    Unfortunately umount -f didn't succeed, too. The error message is the same as with a plain umount.
  • bmk
    bmk over 11 years
    Meanwhile I scheduled a maintenance window and rebooted the machine. That solved the problem (I didn't expect anything else...). I will accept your answer. Probably you are right that there was some filesystem corruption - although I cannot prove that.
  • whitehat
    whitehat almost 8 years
    Thanks thanks a lot.. I spend hours figuring out the error. Doing 'e2fsck -f /dev/sda1' fixed the orphaned nodes for me along with some other fixes. I just said yes to all and works fine now :)
  • Andrew
    Andrew over 6 years
    Thanks a lot!!. Yours commands fixed readonly VirtualBox VM disc after unsucessfull new VirtualBox version install: sudo e2fsck -f /dev/sda1
  • AdamS
    AdamS over 6 years
    Perfect, worked for me on root partition. The accepted answer (reboot) did not work alone. I did have to reboot after e2fsck so seems like you do still need a maintenance window.
  • Brain Foo Long
    Brain Foo Long over 6 years
    Better answer than the accepted one. That worked perfectly for my VPS. Found a lot errors and fixed it, than reboot and everything is running again. Saved my day.
  • deepdive
    deepdive over 4 years
    this worked for me. :yay:
  • Ganesh Krishnan
    Ganesh Krishnan over 4 years
    When you google a problem and arrive at your own solution on stackoverflow. My life is now complete.
  • MunkyOnline
    MunkyOnline almost 4 years
    This also saved my VirtualBox VM. However I had to use recovery mode as root, I then found the mount point using mount -t ext4, which then gave me /dev/sda2