/var removal to /usr/var

FreeBSD 9.0: I am repositioning my /var directory from the root level to /usr/var and resetting them (/var and /tmp) to soft links at the root level. This, in order to avoid frequent disk full conditions.

The /var directory is currently empty except for the .sujournal file and the run/ directory which contains the automounter.and.mnt sub-directory which is empty. Attempts to remove these have failed.

Both rmdir automounter.and.mnt and rm -rf automounter.and.mnt returns a 'device busy' message, attempts to change permissions from dr-xr-xr-x (555) to 755 or 777 fail with a read-only file system message.

It does not seem to matter whether I am in multi or single user mode.

Similarly, .sujournal, permissions could be reset, but removal attempts returns an "Operation not permitted" message.

Suggested solution welcomed.
 
Well, FreeBSD 9.0 is no longer supported so the best permanent solution would probably to re-install as part of an upgrade and fix the partition sizing during the process. Or use the default single partition during a re-install and not have to worry about it. Shuffling stuff around rather than fixing the application that are filling it up or fixing how it was setup is just a band-aid.

If you intend to keep going with your plan, the .sujournal is part of UFS SU+J so you can disable journaling by dropping to single user, running tunefs -j disable /dev/<partition> and reboot. You should be able to remove the file after rebooting. I can't answer the automount part, I would think stopping the automount daemon would let you remove that file but that doesn't appear to be the case.
 
I'll go ahead with the upgrade, but in single user mode tunefs -j disable /dev/ada1p5 was followed by a
Code:
tunefs: soft updates journaling remains unchanged as disabled
message

rmdir /var resulted in
Code:
rmdir: /var: Read-only file system

Just wanted to know how it was to be accomplished if faced with a similar dilemma.

Thanks again!
 
Sorry I didn't reply sooner.

ls -alo / will show you that chlags are set on .sujournal to prevent unlinking it. That would be why you couldn't just remove it.

tunefs -j disable /dev/ada1p5 showing it as disabled can be confirmed with tunefs -p /dev/ada1p5 to print out all the properties of that file system. Chances are it was disabled at some point.

rmdir /var failing was probably just the result of it being mounted. Remove it from your /etc/fstab and umount /var probably would have done the trick.
 
Back
Top