I am unable to mount a device on my server due to error when mounting, the device is type XFS. The mount command returns message: "mount: structure needs cleaning"

I've tried using xfs_check and it just returns a message saying that there are entries in the log that need relaying and that you need to run xfs_repair -L where "-L" option deletes the log file but might/will result in data loss/corruption.

Does anyone know if you can access/mount the drive without repairing, or anyway to minimise data loss?

1 Answer 1


no, you have to repair it first before it will allow it for you to mount.

however, it is a good idea to save your partition or device with dd or ddrescure to an image file, before you do the repair, if you are concerned about data loss.

  • Thanks, do you know if you can run xfs_repair without any flags on the device would that cause any issues or is it best to go straight to "-L" option. I did try the "-n" flag and it output a lot of messages that I'm not sure what they mean.
    – gunnx
    May 31, 2012 at 11:06
  • -L removes the logs even if they are dirty, i.e., unwritten data, so you are more likely to lose files. If the dry run shows a lot of errors, it is better to run it without the -L flag, and use the latter only if the repair fails.
    – johnshen64
    May 31, 2012 at 12:51
  • Just to update it wouldnt run without flags so used -L but all seems ok. I guess there is no way to tell what files are missing. I did find files in lost+found but nothing important.
    – gunnx
    May 31, 2012 at 13:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.