On 10/09/2013 00:26, gottl...@nyu.edu wrote:
> On Mon, Sep 09 2013, Canek Peláez Valdés wrote:
> 
>> On Mon, Sep 9, 2013 at 1:51 PM,  <gottl...@nyu.edu> wrote:
>>> In fstab I have
>>>   /dev/vg/var  /mnt/var  ext4  defaults  0 2
>>> I also have
>>>   lrwxrwxrwx 1 root root 7 Aug 31 16:13 /var -> mnt/var
>>>
>>> This has worked ok but revdep-rebuild is not happy
>>
>> I think it's the symlink the thing that is making revdep-rebuild
>> unhappy. Have you tried to bind mount /mnt/var into /var?
>>
>> mount -o bind /mnt/var /var
> 
> Works great.  Thanks.  To make it permanent I put
>     /mnt/var     /var      ext4     bind       0 0
> right under
>     /dev/vg/var  /mnt/var  ext4     defaults   0 2
> in /etc/fstab

I'm curious as to why you do that, I can't see any benefit at all.

The "var" filesystem is an LV and is only useful if it is mounted at
/var where packages expect it to be. Why add the extra complexity  of
mounting it somewhere else and then bind mounting it to the pnly place
it can be useful?

If you really want a bind mount (to for example work with only that
filesystem's objects and not have to deal with submounts below /var),
why not just mount the LV directly at /var and bind mount it to /mnt/var?

I'm assuming you do this for backup purposes or similar - some really
dumb backup software out there can't detect when it crosses a mount
point (I know this because I've had to deal with idiots who purchase
such software and have the power to insist I use it...)

If so, why not have your backup script mount the fs in /mnt, and umount
it when done?

> 
>>> Should I also mount directly onto /tmp and /opt?
>>
>> I don't think so, although /tmp is preferred to be a tmpfs now, I
>> believe (in both systemd and OpenRC, if I'm not mistaken).
> 
> To use tmpfs I will first have to teach myself not to put things in /tmp
> that I expect to need for only a few days (I have wipe_tmp="NO"; and use
> 30 days for tmpwatch).

There's rules of thumb about this that will always work:

No object in /tmp can be expected to survive successive invocations of
the program that created the object, and never survive a reboot;
No object in /var/tmp can be expected to survive a reboot

The best place for temp files, ironically, is ~



-- 
Alan McKinnon
alan.mckin...@gmail.com


Reply via email to