1

I had large file 200GB in my ext2 disk, then I deleted it(three are no files in Trash). And I haven't gained any free space. I don't want to use fsck as it requres me to unmount disk. I were windows user for a long time, there I could scan disk without unmounting it, is there are similar posibility in Ubuntu 10?

  • 3
    Even on Windows, you can only run a read-only scan on mounted disks. – grawity Apr 22 '11 at 12:09
3

Is the file a database file by chance or something that might be still "open" by a long running program or daemon? Generally, if you didn't see a decrease in disk space it's most likely that something still has the file open.

If it truly is the file system itself that is in error (which would be odd), I'm afraid you'll need to umount the disk to run fsck on it.

  • Thanks, its really other process that was still using it. – yura Apr 24 '11 at 9:56
2

No. You cannot safely fsck a mounted disk. You can force it to, but be aware that doing so can eat your data. To do so, if you are VERY sure you want to, just move to fsck it - fsck will ask for your confirmation to proceed.

You might be able to do what you need using "debugfs" - this can be used on a live filesystem I believe... but please realize it's a debugging shell for ext2/ext3 and can EASILY destroy your filesystem and/or data.

  • This is wrong. You can fsck mounted disk, but you can't repair it without unmounting first. You can use -N switch to skip doing anything to a filesystem. – Vladislav Rastrusny Mar 27 '17 at 8:30
  • The problem with this is the filesystem can have datastructures/journal half-written at the time of the scan, unless you take steps to quiesce first. You will likely get false positives unless you do that. – draeath Mar 30 '17 at 19:13
  • Looks, like you are right. I wonder why this -n switch is there at all then. – Vladislav Rastrusny Mar 31 '17 at 9:36

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.