Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 1 Jul 2018 22:31:44 +0200
From:      Polytropon <freebsd@edvax.de>
To:        Paul Schmehl <paul.schmehl@gmail.com>
Cc:        FreeBSD Questions <freebsd-questions@freebsd.org>
Subject:   Re: Problem deleting files
Message-ID:  <20180701223144.d331ae10.freebsd@edvax.de>
In-Reply-To: <85B4CFC22AC0CA70B917D42D@Pauls-MacBook-Pro.local>
References:  <85B4CFC22AC0CA70B917D42D@Pauls-MacBook-Pro.local>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 01 Jul 2018 14:13:30 -0500, Paul Schmehl wrote:
> I have a problem with a directory full of files that I can't seem to delete.
> [...]
> If I try to delete that specific filename, it seems to work. (Running rm 
> twice returns no such file the second time.) Yet the file count remains the 
> same.

Is this on UFS or ZFS?

If UFS, unmount the partition and perform a "fsck -f" for
that partition. In worst case, do it twice.

What you're observing looks a bit like filesystem inconsistency
problems. Putting the filesystem back into a consistent
state should solve the problem.



> Nothing I've tried to delete these files seems to work. What can I do to 
> get rid of these files?

There is a way to do it with "lower level tools", but I would
not suggest this for now. But let me mention it anyway:

You can unmount the partition, and then use "fsdb" to examine
the file system to check for the inodes that point to the files,
or the one pointing to the directory that contains the files.
Then remove them interactively from within the "fsdb" program,
or use "clri" to do it. Afterwards, run "fsck -f" at least
once (check for error messages!) to return the file system
into a consistent state - the formerly occupied space will
then be contributed to the free blocks list, and the space
is then available again.

See "man fsdb" and "man clri" for details.

And be very careful if you decide to do it this way.



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20180701223144.d331ae10.freebsd>