Gentoo Archives: gentoo-user

From: waltdnes@××××××××.org
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Re: Reducing disk usage
Date: Sat, 05 May 2007 02:47:30
Message-Id: 20070505024131.GB20036@waltdnes.org
In Reply to: Re: [gentoo-user] Re: Reducing disk usage by Alan McKinnon
1 On Fri, May 04, 2007 at 09:15:47AM +0200, Alan McKinnon wrote
2 > On Friday 04 May 2007, waltdnes@××××××××.org wrote:
3 > > I accomplish this by moving /tmp /usr and /var to the /home
4 > > partition.
5 >
6 > Surely you meant "move the /tmp, /usr and /var to the / partition"?
7
8 Let me rephrase myself...
9 - *PHYSICALLY* moving /tmp /usr and /var to the /home partition.
10 - bind mount (or symlink) these directories to the / partition
11
12 > It won't work moving them to /home unless you put symlinks in and
13 > that would just be ... odd
14
15 It may be "odd", but it gets the job done. The files end up
16 *PHYSICALLY* residing in the /home partition, but *LOGICALLY* on /tmp,
17 /usr and /var. Here's how I implement it. I set up /tmp /usr and /var
18 in /home/bindmounts/ (note the permissions on /home/bindmounts/tmp).
19
20 [m450][root][~] ll /home/bindmounts/
21 total 20
22 drwxr-xr-x 5 root root 4096 Apr 29 13:36 .
23 drwxr-xr-x 7 root root 4096 May 1 00:08 ..
24 drwxrwxrwt 10 root root 4096 May 4 22:00 tmp
25 drwxr-xr-x 15 root root 4096 Apr 29 03:53 usr
26 drwxr-xr-x 14 root root 4096 Apr 28 20:36 var
27
28
29 I create *EMPTY* directories named /tmp /usr and /var on /. And then I
30 bind mount the directories. Here's a snippet from /etc/fstab
31
32 /home/bindmounts/var /var auto bind 0 0
33 /home/bindmounts/usr /usr auto bind 0 0
34 /home/bindmounts/tmp /tmp auto bind 0 0
35
36 Symlinks would normally work, too. However, if for some reason, the
37 /home partition is unavailable at bootup, the system would complain
38 about symlinks. With empty directories, you at least get a basic system
39 booting up with fewer complaints.
40
41 Let me repeat the reason for the "oddness". The stripped-down /
42 partition is going to be pretty constant, so I don't have to allow lots
43 of empty space as a safety margin. The wildcards, in terms of filespace
44 are...
45 - /var (logs and other stuff)
46 - /usr (/usr/bin for all my apps, and /usr (share, portage, libs))
47 - /tmp (this is where big temporary files go)
48
49 --
50 Walter Dnes <waltdnes@××××××××.org> In linux /sbin/init is Job #1
51 Q. Mr. Ghandi, what do you think of Microsoft security?
52 A. I think it would be a good idea.
53 --
54 gentoo-user@g.o mailing list

Replies

Subject Author
Re: [gentoo-user] Re: Reducing disk usage Alan McKinnon <alan@××××××××××××××××.za>