4.8 - / out of space

David Kelly dkelly at HiWAAY.net
Mon Jan 3 20:10:45 PST 2005


On Jan 3, 2005, at 7:07 PM, Gregor Mosheh wrote:

> --- David Kelly <dkelly at HiWAAY.net> wrote:
>
>> Another goof is for root to "write" to an unmounted filesystem.
>> Later when the filesystem is mounted the written files are hidden
>> yet still consume space on the fs containing the mount point
>> (usually /).
>
> Could you explain how this happens (or point me to a doc)? Do you
> mean something like "tar cvf /dev/ad0s1a"?

Guessing you quoted the wrong paragraph for the question.

As for tar, yes, "tar -cvf /dev/baddevicename myfiles" will happily 
create a file (not device) named /dev/baddevicename and write the 
contents of myfiles into it. Iff you have write permission on /dev/. 
Its no different than "tar -cvf myfiles.tar myfiles" other than you 
tried to hit a device but created a file instead.

As for what I was writing about consider the case where one is running 
single user and /usr is not yet mounted. A directory named /usr exists. 
Nothing is preventing root from writing in the /usr directory. This 
will consume space on / but no longer exist in file namespace once a 
filesystem is mounted on top of the /usr directory. Files are still 
there but you can't get to them.

> Does that cause fs corruption? Would fsck reclaim that space?

No corruption. Fsck is perfectly happy with it and won't change a 
thing. The stuff hidden under the mount point is still there. The only 
way to get at it is to umount the fs on top and then the previous 
contents of /usr reappear. Assuming of course that /usr actually had 
files underneath.

Go read the manpage for mount. Search for "union". Its talking about 
the same thing as above only a union mount appends the underlying 
namespace at the end of the mounted filesystem's namespace. Without 
"union" the underlying namespace is unreachable.

--
David Kelly N4HHE, dkelly at HiWAAY.net
========================================================================
Whom computers would destroy, they must first drive mad.



More information about the freebsd-questions mailing list