Gentoo Archives: gentoo-amd64

From: Duncan <1i5t5.duncan@×××.net>
To: gentoo-amd64@l.g.o
Subject: [gentoo-amd64] Re: Re: Re: Wow! KDE 3.5.1 & Xorg 7.0 w/ Composite
Date: Mon, 06 Feb 2006 18:54:55
Message-Id: pan.2006.02.06.18.50.41.410798@cox.net
In Reply to: Re: [gentoo-amd64] Re: Re: Wow! KDE 3.5.1 & Xorg 7.0 w/ Composite by David Guerizec
1 David Guerizec posted <200602060112.16917.david@××××××××.net>, excerpted
2 below, on Mon, 06 Feb 2006 01:12:16 +0100:
3
4 > On Friday 03 February 2006 17:28, Duncan wrote:
5 > <large cut of very interesting things ;)>
6 >> PKGDIR="/pkg"
7 >> PORTAGE_TMPDIR="/tmp"
8 >> PORTDIR="/p"
9 >> PORTDIR_OVERLAY="/l/p"
10 >>
11 >> Here you can see some of my path customization.
12 >
13 > Are these different partitions ? And if so, does that relate in any way to
14 > filesystem fragmentation ?
15 >
16 > (waiting explanation on how to fight against fragmentation here ;))
17
18 Yes, different "partitions". Or, they /were/ different partitions on my
19 old single hard drive. I'm now running md, the multi-disk kernel-RAID
20 driver, with four Seagate 300 gig drives, partitioned and multi-RAIDed
21 into RAID-1 (/boot), RAID-6 (most of the system) and RAID-0 (the stuff
22 like /tmp and /p, $PORTDIR, as these are either temporary anyway, or
23 easily replaced off the net, so the speed and additional capacity of
24 RAID-0 is good, and the redundancy of real RAID unneeded).
25
26 Fragmentation doesn't tend to be as much of an issue on Linux, with "real"
27 filesystems, as on MSWormOS, particularly FAT/FAT32. I'm running all
28 reiserfs here, FWIW. It doesn't have a compaction tool (defrag, on
29 MSWormOS), but I've not noticed any issues as a result.
30
31 That said, yes, the partitioning does help, as does the better separation
32 of executables vs data on Linux, as compared to MSWormOS. There are other
33 reasons to partition that I consider more important, but it does help
34 fragmentation, as well.
35
36 First, while it's possible to separate /, /usr, and /var, and I've
37 separated them in the past, I've come to the conclusion that it's more
38 trouble than benefit, altho I do put some subdirs on their own partitions.
39 Keeping those three together means all the locations portage will normally
40 place merged package components are on the same partition, along with
41 portage's database of what's merged. I've had them get out of sync
42 before (long story, suffice it to say it can happen, particularly if they
43 are on separate partitions), and take it from me, it's /much/ simpler if
44 the database is always synced with what's on your system.
45
46 I /do/ however keep two copies (and I should have made three) of that /
47 partition (with /var and /usr), a working copy and a backup, such that I
48 ever fat-finger something, or if a package upgrade kills my ability to
49 boot for some reason (possible, running ~arch), I can simply boot the
50 backup copy. (That's actually how the de-syncing happened above, after
51 something happened, I ended up with a /var from the working copy and a /
52 and /usr from the backup, so portage thought everything was up to date,
53 when it was all as old as the backup snapshot -- a difference large enough
54 to complicate things.) If it's three, working, fallback, and second
55 fallback, you'll have a working fallback at all times, even if something
56 happens in the middle of your update of the first fallback, since you'll
57 have the second, and wouldn't attempt an update to it until you've
58 verified the first fallback works after you updated it.
59
60 As I mentioned, some of the subdirs of the above are separate partitions.
61 /var/log is on its own partition so a runaway logging incident can't ever
62 use up all available space anywhere but the log partition. This is common
63 Unix practice. /tmp is its own partition because it just makes sense to
64 keep temporary files isolated from the rest of the system. (Here,
65 /var/tmp is a symlink to /tmp, so it's the same partition. They do have
66 slightly different uses, so that's not for everyone, but it was standard
67 on Mandrake, which I switched to Gentoo from, and it suits my needs.
68 Servers and true multi-human-user systems where not all human users are
69 trusted will be most likely to wish to keep these separate.) /usr/local
70 is its own partition, so I can keep the scripts and stuff I have there
71 across main system reinstalls, if necessary.
72
73 /home is of course one of the first partitions often split off, again,
74 allowing system reinstall without killing the stuff in /home.
75
76 Of course, note that these splits also tend to be useful in a multi-boot
77 situation. It's likely that the same /tmp could be used for all *ix boots
78 anyway, whether that's 32-bit and 64-bit Gentoo, or Red Hat and Gentoo, or
79 even Solaris or one of the BSDs and Linux, provided you choose your
80 partition type appropriately. Likewise with /home and possibly the stuff
81 in /usr/local, altho some *ix use that for more than Gentoo does. You'd
82 likely wish to keep separate log partitions, of course.
83
84 The /l from my previous mail is /usr/local as well. Here, I use the /l in
85 my paths and local settings, so it's the real mount-point and /usr/local
86 is the symlink to it, but that's purely personal preference. Likewise
87 with /h and /home, only /h is the symlink since there's more system stuff
88 that's going to have /home in its default path. I've done that with most
89 of the system dirs as well, so /u->/usr, /e->/etc, /usr/portage->/p,
90 /mnt->/m...
91
92 There are three dirs other than /tmp and /var/tmp that store non-critical
93 data. These are /usr/src, which will normally contain the Linux kernel
94 sources and likely little else, and thus be easily redownloaded,
95 /usr/portage, with the easily resynced portage tree (and the $DISTDIR
96 subdir, package sources, automatically redownloaded if portage needs them
97 again), and for those of us running ccache, the portage ccache dir.
98 I have all three of these symlinked to subdirs of a single RAID-0
99 partition on the same RAID-0 (but a different partition) as /tmp. On a
100 single disk, you could either leave them in place or symlink them
101 similarly, to a single partition. Note that these are all good candidates
102 for reiserfs even if you don't trust it with your valuable data (some
103 don't, as I said, I'm all reiserfs, but I have backup images of my
104 critical data), because the files tend to be small and reiserfs is more
105 efficient with small files than most fs, and because the data is
106 non-critical anyway. Therefore, even if you prefer ext3 or similar for
107 your critical data, putting these three on their own partition and making
108 it reiserfs is a good idea.
109
110 /pkg, my portage $PKGDIR, is its own partition as well (/p being already
111 taken, as the portage dir). Don't worry about this if you don't have
112 FEATURES=buildpkg set (make it 2-4 gig if you do, 1 gig minimum but that
113 requires cleaning up old package versions too often for comfort), but the
114 idea since I do, is to allow me to rebuild the system quickly from binary
115 packages (no recompiling from source), should I decide I need to for
116 whatever reason. Thus, keeping it off of the main system partition is a
117 good idea.
118
119 Purely due to personal use and preferences, I have separate /mail, /news,
120 and /mm (multimedia) partitions as well. They'd normally subdirs of /home
121 or for mail and news, maybe subdirs of /var, but they tend to be big
122 enough to justify their own partitions, here, leaving /home to mainly
123 config settings and a few trivial files, and /var to system use.
124
125 There's a BIG potential gotcha once you start getting into double-digit
126 numbers of partitions, however. IDE/PATA allows 64 partitions per device.
127 SCSI, and therefore libsata based SATA, only allows 16. I moved directly
128 from PATA single drive, to SATA RAID, and avoided the problem, but had I
129 switched to single SATA instead of going RAID, I'd have had a problem due
130 to too many partitions, forcing me to choose to merge some of them. On
131 PATA, I think I had 20, but that was before I combined /usr and /var onto
132 /, and combined ccache, /usr/src, and /pkg, into a single partition with
133 subdirs and symlinks to them. I also had separate portage and DISTDIR at
134 the time; now I don't. I don't recall what the md kernel
135 driver partitioned RAID partition limit is, but it's high enough that with
136 the multiple RAID partitions on the physical drives, I don't have to
137 worry about it. Even if I did, there's LVM, which I'm using in place of
138 partitioning where it makes sense, that is, for all my RAID-6 stuff other
139 than the root partition and its mirror (which are on separate partitions,
140 so I don't have to worry about an initrd/initramfs as I would with LVM
141 based roots, md works without an initrd/initramfs).
142
143 --
144 Duncan - List replies preferred. No HTML msgs.
145 "Every nonfree program has a lord, a master --
146 and if you use the program, he is your master." Richard Stallman in
147 http://www.linuxdevcenter.com/pub/a/linux/2004/12/22/rms_interview.html
148
149
150 --
151 gentoo-amd64@g.o mailing list

Replies

Subject Author
Re: [gentoo-amd64] Fragmentation (Was: Re: Re: Re: Wow! KDE 3.5.1 & Xorg 7.0 w/ Composite) David Guerizec <david@××××××××.net>