1 |
On 10/09/2013 00:26, gottlieb@×××.edu wrote: |
2 |
> On Mon, Sep 09 2013, Canek Peláez Valdés wrote: |
3 |
> |
4 |
>> On Mon, Sep 9, 2013 at 1:51 PM, <gottlieb@×××.edu> wrote: |
5 |
>>> In fstab I have |
6 |
>>> /dev/vg/var /mnt/var ext4 defaults 0 2 |
7 |
>>> I also have |
8 |
>>> lrwxrwxrwx 1 root root 7 Aug 31 16:13 /var -> mnt/var |
9 |
>>> |
10 |
>>> This has worked ok but revdep-rebuild is not happy |
11 |
>> |
12 |
>> I think it's the symlink the thing that is making revdep-rebuild |
13 |
>> unhappy. Have you tried to bind mount /mnt/var into /var? |
14 |
>> |
15 |
>> mount -o bind /mnt/var /var |
16 |
> |
17 |
> Works great. Thanks. To make it permanent I put |
18 |
> /mnt/var /var ext4 bind 0 0 |
19 |
> right under |
20 |
> /dev/vg/var /mnt/var ext4 defaults 0 2 |
21 |
> in /etc/fstab |
22 |
|
23 |
I'm curious as to why you do that, I can't see any benefit at all. |
24 |
|
25 |
The "var" filesystem is an LV and is only useful if it is mounted at |
26 |
/var where packages expect it to be. Why add the extra complexity of |
27 |
mounting it somewhere else and then bind mounting it to the pnly place |
28 |
it can be useful? |
29 |
|
30 |
If you really want a bind mount (to for example work with only that |
31 |
filesystem's objects and not have to deal with submounts below /var), |
32 |
why not just mount the LV directly at /var and bind mount it to /mnt/var? |
33 |
|
34 |
I'm assuming you do this for backup purposes or similar - some really |
35 |
dumb backup software out there can't detect when it crosses a mount |
36 |
point (I know this because I've had to deal with idiots who purchase |
37 |
such software and have the power to insist I use it...) |
38 |
|
39 |
If so, why not have your backup script mount the fs in /mnt, and umount |
40 |
it when done? |
41 |
|
42 |
> |
43 |
>>> Should I also mount directly onto /tmp and /opt? |
44 |
>> |
45 |
>> I don't think so, although /tmp is preferred to be a tmpfs now, I |
46 |
>> believe (in both systemd and OpenRC, if I'm not mistaken). |
47 |
> |
48 |
> To use tmpfs I will first have to teach myself not to put things in /tmp |
49 |
> that I expect to need for only a few days (I have wipe_tmp="NO"; and use |
50 |
> 30 days for tmpwatch). |
51 |
|
52 |
There's rules of thumb about this that will always work: |
53 |
|
54 |
No object in /tmp can be expected to survive successive invocations of |
55 |
the program that created the object, and never survive a reboot; |
56 |
No object in /var/tmp can be expected to survive a reboot |
57 |
|
58 |
The best place for temp files, ironically, is ~ |
59 |
|
60 |
|
61 |
|
62 |
-- |
63 |
Alan McKinnon |
64 |
alan.mckinnon@×××××.com |